remove Fortran, Objective C, and C++

This commit is contained in:
YamaArashi 2016-02-08 03:04:42 -08:00
parent 476b5c86e5
commit a5c638ceac
216 changed files with 31 additions and 340665 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.exe

View File

@ -360,10 +360,6 @@ EXTRA_PASSES =@extra_passes@
# Like EXTRA_PASSES, but these are used when linking.
EXTRA_PROGRAMS = @extra_programs@
# List of extra object files that should be compiled for this target machine.
# The rules for compiling them should be in the t-* file for the machine.
EXTRA_PARTS = @extra_parts@
# List of extra object files that should be compiled and linked with
# compiler proper (cc1, cc1obj, cc1plus).
EXTRA_OBJS = @extra_objs@
@ -376,13 +372,6 @@ EXTRA_GCC_OBJS =@host_extra_gcc_objs@
# Often this is edited directly by `configure'.
EXTRA_HEADERS =@extra_headers_list@
# Set this to `collect2' to enable use of collect2.
USE_COLLECT2 = @will_use_collect2@
MAYBE_USE_COLLECT2 = @maybe_use_collect2@
# It is convenient for configure to add the assignment at the beginning,
# so don't override it here.
USE_COLLECT2 = collect2$(exeext)
# List of extra C and assembler files to add to libgcc1.a.
# Assembler files should have names ending in `.asm'.
LIB1FUNCS_EXTRA =
@ -426,7 +415,7 @@ GCC_PASSES=xgcc$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES)
# List of things which should already be built whenever we try to use xgcc
# to link anything.
GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS)
# Directory to link to, when using the target `maketest'.
DIR = ../gcc
@ -484,15 +473,6 @@ RUNTESTFLAGS =
# Extra symbols for fixproto to define when parsing headers.
FIXPROTO_DEFINES =
# Extra flags to use when compiling crt{begin,end}.o.
CRTSTUFF_T_CFLAGS =
# Extra flags to use when compiling [m]crt0.o.
CRT0STUFF_T_CFLAGS =
# "t" or nothing, for building multilibbed versions of, say, crtbegin.o.
T =
# End of variables for you to override.
# Definition of `all' is here so that new rules inserted by sed
@ -671,17 +651,17 @@ STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
insn-attr.h insn-attrtab.c insn-opinit.c genrtl.c genrtl.h tree-check.h \
s-flags s-config s-codes s-mlib s-under\
s-output s-recog s-emit s-extract s-peep s-check \
s-attr s-attrtab s-opinit s-crt s-crtS s-crt0 \
s-attr s-attrtab s-opinit \
genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \
genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \
gencheck$(build_exeext) \
xgcc$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES) \
$(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
$(EXTRA_PROGRAMS) gcc-cross$(exeext) \
$(CCCP)$(exeext) cc1obj$(exeext) enquire$(exeext) \
protoize$(exeext) unprotoize$(exeext) \
specs collect2$(exeext) $(USE_COLLECT2) underscore.c \
specs underscore.c \
gcov$(exeext) *.bp \
$(CYGNUS-LOCAL-range) *.range \
*.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop \
@ -734,7 +714,6 @@ RTL_BASE_H = rtl.h rtl.def machmode.h machmode.def
RTL_H = $(RTL_BASE_H) genrtl.h
TREE_H = tree.h real.h tree.def machmode.h machmode.def tree-check.h
BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h
DEMANGLE_H = $(srcdir)/../include/demangle.h
RECOG_H = recog.h
EXPR_H = expr.h insn-codes.h
REGS_H = regs.h varray.h machmode.h machmode.def
@ -819,17 +798,17 @@ all.internal: start.encap rest.encap
# Note that we can compile enquire using the cross-compiler just built,
# although we can't run it on this machine.
all.cross: native gcc-cross specs stmp-headers $(STMP_FIXPROTO) $(LIBGCC) \
$(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross
$(LIBGCC1_TEST) lang.all.cross
# This is what to compile if making gcc with a cross-compiler.
all.build: native xgcc$(exeext) $(EXTRA_PARTS) lang.all.build
all.build: native xgcc$(exeext) lang.all.build
# This is what must be made before installing GCC and converting libraries.
start.encap: native xgcc$(exeext) specs $(LIBGCC1) xlimits.h lang.start.encap
# These can't be made until after GCC can run.
rest.encap: stmp-headers $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap
rest.encap: stmp-headers $(STMP_FIXPROTO) $(LIBGCC) lang.rest.encap
# This is what is made with the host's compiler
# whether making a cross compiler or not.
native: config.status auto-host.h cpp$(exeext) $(LANGUAGES) \
$(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
$(EXTRA_PASSES) $(EXTRA_PROGRAMS)
# Define the names for selecting languages in LANGUAGES.
C c: cc1$(exeext)
@ -1025,9 +1004,9 @@ libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) stmp-int-hdrs $(STMP_FIXPROTO)
touch libgcc2.ready; \
fi
LIB2ADD = $(srcdir)/frame.c $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS)
LIB2ADD = $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS)
libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(FPBIT) $(DPBIT) $(LIB2ADD) \
machmode.h longlong.h frame.h gbl-ctors.h config.status
machmode.h longlong.h config.status
# Actually build it in tmplibgcc2.a, then rename at end,
# so that libgcc2.a itself remains nonexistent if compilation is aborted.
-rm -f tmplibgcc2.a
@ -1159,8 +1138,7 @@ s-mlib: $(srcdir)/genmultilib Makefile
# Build multiple copies of libgcc.a, one for each target switch.
stmp-multilib: $(LIBGCC1) libgcc2.c libgcc2.ready $(CONFIG_H) \
frame.h \
$(LIB2ADD) machmode.h longlong.h gbl-ctors.h config.status
$(LIB2ADD) machmode.h longlong.h config.status
for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
dir=`echo $$i | sed -e 's/;.*$$//'`; \
flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
@ -1236,47 +1214,6 @@ stmp-multilib-sub:
else true; \
fi; done
# Compile two additional files that are linked with every program
# linked using GCC on systems using COFF or ELF, for the sake of C++
# constructors.
$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
defaults.h frame.h gbl-ctors.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions -fno-exceptions $(CRTSTUFF_T_CFLAGS) \
-c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext)
$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
defaults.h frame.h gbl-ctors.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions -fno-exceptions $(CRTSTUFF_T_CFLAGS) \
-c $(srcdir)/crtstuff.c -DCRT_END -o $(T)crtend$(objext)
# On some systems we also want to install versions of these files
# compiled using PIC for use in shared libraries.
crtbeginS.o crtendS.o: s-crtS ; @true
s-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
defaults.h frame.h gbl-ctors.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
-DCRT_BEGIN -DCRTSTUFFS_O -finhibit-size-directive -fno-inline-functions \
-fno-exceptions -g0 -c $(srcdir)/crtstuff.c
mv crtstuff$(objext) crtbeginS$(objext)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
-DCRT_END -DCRTSTUFFS_O -finhibit-size-directive -fno-inline-functions \
-fno-exceptions -g0 -c $(srcdir)/crtstuff.c -o crtendS$(objext)
touch s-crtS
# Compile the start modules crt0.o and mcrt0.o that are linked with every program
crt0.o: s-crt0 ; @true
mcrt0.o: s-crt0; @true
s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
-o crt0.o -c $(CRT0_S)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
-o mcrt0.o -c $(MCRT0_S)
touch s-crt0
#
# Compiling object files from source files.
# Note that dependencies on obstack.h are not written
@ -1326,27 +1263,8 @@ graph.o: graph.c $(CONFIG_H) system.h toplev.h flags.h output.h $(RTL_H) \
hard-reg-set.h $(BASIC_BLOCK_H)
sbitmap.o: sbitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H)
collect2$(exeext): collect2.o tlink.o hash.o cplus-dem.o underscore.o \
version.o choose-temp.o mkstemp.o $(LIBDEPS)
# Don't try modifying collect2 (aka ld) in place--it might be linking this.
-rm -f collect2$(exeext)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ collect2.o tlink.o hash.o \
cplus-dem.o underscore.o version.o choose-temp.o mkstemp.o $(LIBS)
collect2.o : collect2.c $(CONFIG_H) system.h gstab.h \
$(srcdir)/../include/obstack.h $(DEMANGLE_H) collect2.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \
-c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) system.h toplev.h collect2.h
hash.o: hash.c hash.h system.h toplev.h
cplus-dem.o: $(srcdir)/../libiberty/cplus-dem.c $(DEMANGLE_H)
rm -f cplus-dem.c
$(LN_S) $(srcdir)/../libiberty/cplus-dem.c cplus-dem.c
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) cplus-dem.c
pexecute.o: $(srcdir)/../libiberty/pexecute.c $(CONFIG_H) system.h
rm -f pexecute.c
$(LN_S) $(srcdir)/../libiberty/pexecute.c pexecute.c
@ -1450,7 +1368,7 @@ toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) \
insn-codes.h insn-config.h $(RECOG_H) Makefile toplev.h dwarfout.h \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \
$(lang_options_files)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DTARGET_NAME=\"$(target_alias)\" \
-c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
# END CYGNUS LOCAL
@ -2322,7 +2240,7 @@ mostlyclean: lang.mostlyclean
-rm -f */*.sched2 */*.stack */*.regmove */*.gcse
# Delete some files made during installation.
-rm -f specs float.h-* enquire SYSCALLS.c.X SYSCALLS.c
-rm -f collect collect2 mips-tfile mips-tdump alloca.s
-rm -f collect mips-tfile mips-tdump alloca.s
# Delete files generated for fixproto
# CYGNUS LOCAL: binary installation
-rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \
@ -2427,7 +2345,6 @@ realclean: maintainer-clean
# END CYGNUS LOCAL
#
# Entry points `install' and `uninstall'.
# Also use `install-collect2' to install collect2 when the config files don't.
# The semicolon is to prevent the install.sh -> install default rule
# from doing anything. Having it run true helps avoid problems and
@ -2489,7 +2406,7 @@ installdirs:
-if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; chmod a+rx $(man1dir) ; fi
# Install the compiler executables built during cross compilation.
install-common: native installdirs $(EXTRA_PARTS) lang.install-common
install-common: native installdirs lang.install-common
for file in $(COMPILERS); do \
if [ -f $$file ] ; then \
rm -f $(libsubdir)/$$file; \
@ -2497,19 +2414,12 @@ install-common: native installdirs $(EXTRA_PARTS) lang.install-common
else true; \
fi; \
done
for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) ..; do \
if [ x"$$file" != x.. ]; then \
rm -f $(libsubdir)/$$file; \
$(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
else true; fi; \
done
for file in $(EXTRA_PARTS) ..; do \
if [ x"$$file" != x.. ]; then \
rm -f $(libsubdir)/$$file; \
$(INSTALL_DATA) $$file $(libsubdir)/$$file; \
chmod a-x $(libsubdir)/$$file; \
else true; fi; \
done
# Don't mess with specs if it doesn't exist yet.
-if [ -f specs ] ; then \
rm -f $(libsubdir)/specs; \
@ -2714,12 +2624,6 @@ install-assert-h: assert.h installdirs
chmod a-x $(assertdir)/assert.h; \
fi
# Use this target to install the program `collect2' under the name `collect2'.
install-collect2: collect2 installdirs
$(INSTALL_PROGRAM) collect2$(exeext) $(libsubdir)/collect2$(exeext)
# Install the driver program as $(libsubdir)/gcc for collect2.
$(INSTALL_PROGRAM) xgcc$(exeext) $(libsubdir)/gcc$(exeext)
# Cancel installation by deleting the installed files.
uninstall: lang.uninstall
-rm -rf $(libsubdir)
@ -3055,7 +2959,6 @@ stage1-start:
# dir will work properly.
-if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage1 ; else true ; fi
-if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage1 ; else true ; fi
-if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage1 ; else true ; fi
-rm -f stage1/libgcc.a
-cp libgcc.a stage1
-if $(RANLIB_TEST_FOR_TARGET) ; then \
@ -3078,7 +2981,6 @@ stage2-start:
# dir will work properly.
-if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage2 ; else true ; fi
-if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage2 ; else true ; fi
-if [ -f collect-ld ] ; then $(LN_S) ../collect-ld$(exeext) stage2 ; else true ; fi
-rm -f stage2/libgcc.a
-cp libgcc.a stage2
-if $(RANLIB_TEST_FOR_TARGET) ; then \
@ -3101,7 +3003,6 @@ stage3-start:
# dir will work properly.
-if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage3 ; else true ; fi
-if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage3 ; else true ; fi
-if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage3 ; else true ; fi
-rm -f stage3/libgcc.a
-cp libgcc.a stage3
-if $(RANLIB_TEST_FOR_TARGET) ; then \
@ -3124,7 +3025,6 @@ stage4-start:
# dir will work properly.
-if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage4 ; else true ; fi
-if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage4 ; else true ; fi
-if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage4 ; else true ; fi
-rm -f stage4/libgcc.a
-cp libgcc.a stage4
-if $(RANLIB_TEST_FOR_TARGET) ; then \

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +0,0 @@
/* Header file for collect/tlink routines.
Copyright (C) 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. */
#ifndef __COLLECT2_H__
#define __COLLECT2_H__
extern void do_tlink PARAMS ((char **, char **));
extern void collect_execute PARAMS ((char *, char **, char *));
extern void collect_exit PARAMS ((int)) ATTRIBUTE_NORETURN;
extern int collect_wait PARAMS ((char *));
extern void dump_file PARAMS ((char *));
extern int file_exists PARAMS ((char *));
#endif /* ! __COLLECT2_H__ */

View File

@ -4,8 +4,6 @@ LIB1ASMSRC = arm/lib1funcs.asm
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX
# END CYGNUS LOCAL interworking
EXTRA_PARTS = crtbegin.o crtend.o
# These are really part of libgcc1, but this will cause them to be
# built correctly, so...
@ -30,7 +28,6 @@ MULTILIB_OPTIONS = mlittle-endian/mbig-endian mhard-float/msoft-float mapcs-32/
MULTILIB_DIRNAMES = le be fpu soft 32bit 26bit normal interwork elf under nofmult
MULTILIB_EXCEPTIONS = *mapcs-26/*mthumb-interwork* *mthumb-interwork*/*mcpu=arm7*
MULTILIB_MATCHES = mbig-endian=mbe mlittle-endian=mle mcpu?arm7=mcpu?arm7d mcpu?arm7=mcpu?arm7di mcpu?arm7=mcpu?arm70 mcpu?arm7=mcpu?arm700 mcpu?arm7=mcpu?arm700i mcpu?arm7=mcpu?arm710 mcpu?arm7=mcpu?arm710c mcpu?arm7=mcpu?arm7100 mcpu?arm7=mcpu?arm7500 mcpu?arm7=mcpu?arm7500fe mcpu?arm7=mcpu?arm6 mcpu?arm7=mcpu?arm60 mcpu?arm7=mcpu?arm600 mcpu?arm7=mcpu?arm610 mcpu?arm7=mcpu?arm620
EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
# END CYGNUS LOCAL

View File

@ -4,7 +4,6 @@ LIB1ASMSRC = arm/lib1thumb.asm
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX
# adddi3/subdi3 added to machine description
EXTRA_PARTS=crtbegin.o crtend.o
# These are really part of libgcc1, but this will cause them to be
# built correctly, so...
@ -28,7 +27,6 @@ dp-bit.c: $(srcdir)/config/fp-bit.c
MULTILIB_OPTIONS = mlittle-endian/mbig-endian mno-thumb-interwork/mthumb-interwork fno-leading-underscore/fleading-underscore
MULTILIB_DIRNAMES = le be normal interwork elf under
MULTILIB_MATCHES = mbig-endian=mbe mlittle-endian=mle
EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib

2878
gcc/configure vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +0,0 @@
Makefile
parse.c
parse.h
parse.output
stamp-parse
y.tab.c
*.bb
*.bbg
*.da
*.gcov

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,93 +0,0 @@
1999-01-15 Brendan Kehoe <brendan@cygnus.com>
* typeck2.c (my_friendly_abort): Adjust where to report bugs as a
cygnus-local change.
Fri Jan 15 12:32:23 1999 Dave Brolley (brolley@cygnus.com)
* lex.c (lang_init_options): Fix typo: data->opts.
Tue Oct 27 23:48:33 1998 Jeffrey A Law (law@cygnus.com)
* lang-specs.h (default_compilers): Remove spurious backslashes.
Thu Oct 8 11:00:50 1998 Nick Clifton <nickc@cygnus.com>
* decl.c (duplicate_decls): Remove code to copy data_area
field of struct tree_decl.
1998-08-27 Benjamin Kosnik <bkoz@cygnus.com>
* decl.c (duplicate_decls): Add DECL_DATA_AREA bits.
Thu May 21 10:21:04 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
* TODO: Updated the exception handling todo list a bit.
Wed Feb 18 12:18:23 1998 Michael Tiemann <tiemann@axon.cygnus.com>
* inc/new: (__THROW, __nothing): New macros, for making libgcc2
functionality conditional on -fembedded-cxx.
(operator new*, operator delete*): Change type signatures to be
correct when -fembedded-cxx is specified.
* new1.cc (operator new): Change `throw' to __THROW, so that file
can be compiled with -fembedded-cxx. Also, don't try to call
`handler' if __EMBEDDED_CXX__ is defined.
* new2.cc (operator new[], operator delete, operator delete []):
Likewise.
* new.cc (nothrow): Only define if not __EMBEDDED_CXX__.
* exception.cc: Contents of this file depend on __EMBEDDED_CXX__
not being defined.
* tinfo2.cc: Ditto.
Mon Feb 9 17:28:39 EST 1998 Andrew MacLeod <amacleod@torpedo.to.cygnus.com>
* TODO: Add new file with G++ todo items.
Tue Jan 27 12:04:38 1998 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (lang_decode_option): -fembedded-cxx implies
-fvtable-thunks.
Wed Jan 21 10:01:32 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
* inc/new: Remove orphan C-style end comment.
1997-10-31 Brendan Kehoe <brendan@lisa.cygnus.com>
* lex.c (embedded_pedwarn): Change its return type to void.
1997-10-14 Brendan Kehoe <brendan@lisa.cygnus.com>
Compliance with the Embedded C++ language specification.
By default we generate warnings; use -pedantic-errors to turn them
into hard errors.
* decl2.c (flag_embedded_cxx): Define.
(struct lang_f_options): Add -fembedded-cxx.
(lang_decode_option): If -fembedded-cxx, set FLAG_EMBEDDED_CXX,
and clear FLAG_RTTI and FLAG_EXCEPTIONS.
* lang-options.h: Add -fembedded-cxx and -fno-embedded-cxx.
* lang-specs.h: If -fembedded-cxx, define __EMBEDDED_CXX__.
* cp-tree.h (flag_embedded_cxx): Add decl.
* parse.y (base_class_list): Give a pedwarn about inheritance if
FLAG_EMBEDDED_CXX.
(base_class): Likewise for the base_class_access_list case.
* lex.c (real_yylex): Give pedwarns if FLAG_EMBEDDED_CXX is true and
the token VALUE is any of TRY, CATCH, THROW, TEMPLATE, TYPENAME,
USING, or NAMESPACE. Likewise for DYNAMIC_CAST, STATIC_CAST,
REINTERPRET_CAST, CONST_CAST, or TYPEID.
(embedded_{template,eh,namespace}_error): New global variables to
make us only give a warning/error about each once.
(embedded_pedwarn): New fn to do the actual pedwarn.
* decl.c (grokdeclarator): Give a pedwarn for using mutable.
* inc/new: Only make the EH stuff appear if !__EMBEDDED_CXX__.
(new, new[]) [__EMBEDDED_CXX__]: For placement versions, take out
the default throw. This particular bit is under discussion with
the EC++ committee currently.

View File

@ -1,317 +0,0 @@
# Top level makefile fragment for GNU C++.
# Copyright (C) 1994, 1995, 1997, 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 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.distdir,
# 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.
#
# Extra flags to pass to recursive makes.
CXX_FLAGS_TO_PASS = \
"CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
"CXXFLAGS=$(CXXFLAGS)" \
"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
# Actual names to use when installing a native compiler.
CXX_INSTALL_NAME = `t='$(program_transform_name)'; echo c++ | sed $$t`
GXX_INSTALL_NAME = `t='$(program_transform_name)'; echo g++ | sed $$t`
DEMANGLER_INSTALL_NAME = `t='$(program_transform_name)'; echo c++filt | sed $$t`
# Actual names to use when installing a cross-compiler.
CXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++ | sed $$t`
GXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g++ | sed $$t`
DEMANGLER_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++filt | sed $$t`
# The name to use for the demangler program.
DEMANGLER_PROG = c++filt$(exeext)
# Extra headers to install.
CXX_EXTRA_HEADERS = $(srcdir)/cp/inc/typeinfo $(srcdir)/cp/inc/exception \
$(srcdir)/cp/inc/new $(srcdir)/cp/inc/new.h
# Extra code to include in libgcc2.
CXX_LIB2FUNCS = tinfo.o tinfo2.o new.o opnew.o opnewnt.o opvnew.o opvnewnt.o \
opdel.o opdelnt.o opvdel.o opvdelnt.o exception.o
CXX_LIB2SRCS = $(srcdir)/cp/new.cc $(srcdir)/cp/new1.cc $(srcdir)/cp/new2.cc \
$(srcdir)/cp/exception.cc $(srcdir)/cp/tinfo.cc \
$(srcdir)/cp/tinfo2.cc $(srcdir)/cp/tinfo.h
#
# Define the names for selecting c++ in LANGUAGES.
# Note that it would be nice to move the dependency on g++
# into the C++ rule, but that needs a little bit of work
# to do the right thing within all.cross.
C++ c++: cc1plus$(exeext)
# Tell GNU make to ignore these if they exist.
.PHONY: C++ c++
g++.c: $(srcdir)/gcc.c
-rm -f $@
$(LN_S) $(srcdir)/gcc.c $@
g++spec.o: $(srcdir)/cp/g++spec.c
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/cp/g++spec.c
# N.B.: This is a copy of the gcc.o rule, with -DLANG_SPECIFIC_DRIVER added.
# It'd be nice if we could find an easier way to do this---rather than have
# to track changes to the toplevel gcc Makefile as well.
# We depend on g++.c last, to make it obvious where it came from.
g++.o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) g++.c \
system.h prefix.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(DRIVER_DEFINES) \
-DLANG_SPECIFIC_DRIVER \
-c g++.c
# Create the compiler driver for g++.
g++$(exeext): g++.o g++spec.o version.o choose-temp.o pexecute.o prefix.o mkstemp.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ g++.o g++spec.o prefix.o \
version.o choose-temp.o pexecute.o mkstemp.o $(EXTRA_GCC_OBJS) $(LIBS)
# Create a version of the g++ driver which calls the cross-compiler.
g++-cross$(exeext): g++$(exeext)
-rm -f g++-cross$(exeext)
cp g++$(exeext) g++-cross$(exeext)
cxxmain.o: $(srcdir)/../libiberty/cplus-dem.c $(DEMANGLE_H)
rm -f cxxmain.c
$(LN_S) $(srcdir)/../libiberty/cplus-dem.c cxxmain.c
$(CC) -c -DMAIN $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DVERSION=\"$(version)\" cxxmain.c
# Apparently OpenVM needs the -o to be at the beginning of the link line.
$(DEMANGLER_PROG): cxxmain.o underscore.o getopt.o getopt1.o $(LIBDEPS)
$(CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) \
cxxmain.o underscore.o getopt.o getopt1.o $(LIBS)
CXX_SRCS = $(srcdir)/cp/call.c $(srcdir)/cp/decl2.c \
$(srcdir)/cp/except.c $(srcdir)/cp/input.c $(srcdir)/cp/pt.c \
$(srcdir)/cp/spew.c $(srcdir)/cp/xref.c $(srcdir)/cp/class.c \
$(srcdir)/cp/expr.c $(srcdir)/cp/lex.c \
$(srcdir)/cp/ptree.c $(srcdir)/cp/tree.c $(srcdir)/cp/cvt.c \
$(srcdir)/cp/errfn.c $(srcdir)/cp/rtti.c $(srcdir)/cp/method.c \
$(srcdir)/cp/search.c $(srcdir)/cp/typeck.c $(srcdir)/cp/decl.c \
$(srcdir)/cp/error.c $(srcdir)/cp/friend.c $(srcdir)/cp/init.c \
$(srcdir)/cp/parse.y $(srcdir)/cp/sig.c $(srcdir)/cp/typeck2.c \
$(srcdir)/cp/repo.c $(srcdir)/cp/semantics.c
cc1plus$(exeext): $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o c-pragma.o \
$(srcdir)/cp/cp-tree.h $(srcdir)/cp/cp-tree.def hash.o
cd cp; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) ../cc1plus$(exeext)
#
# Build hooks:
c++.all.build: g++$(exeext)
c++.all.cross: g++-cross$(exeext) $(DEMANGLER_PROG)
c++.start.encap: g++$(exeext)
c++.rest.encap: $(DEMANGLER_PROG)
c++.info:
c++.dvi:
# C++ language-support library pieces for libgcc.
tinfo.o: cc1plus$(exeext) $(srcdir)/cp/tinfo.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/tinfo.cc
tinfo2.o: cc1plus$(exeext) $(srcdir)/cp/tinfo2.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/tinfo2.cc
exception.o: cc1plus$(exeext) $(srcdir)/cp/exception.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c -fexceptions $(srcdir)/cp/exception.cc
new.o: cc1plus$(exeext) $(srcdir)/cp/new.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new.cc
opnew.o: cc1plus$(exeext) $(srcdir)/cp/new1.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new1.cc -DL_op_new -o opnew.o
opnewnt.o: cc1plus$(exeext) $(srcdir)/cp/new1.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new1.cc -DL_op_newnt -o opnewnt.o
opvnew.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_vnew -o opvnew.o
opvnewnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_vnewnt -o opvnewnt.o
opdel.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_delete -o opdel.o
opdelnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_delnt -o opdelnt.o
opvdel.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_vdel -o opvdel.o
opvdelnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_vdelnt -o opvdelnt.o
# We want to update cplib2.txt if any of the source files change...
cplib2.txt: $(CXX_LIB2SRCS) $(CXX_EXTRA_HEADERS) cplib2.ready
case " $(LANGUAGES) " in \
*" "[cC]"++ "*) \
echo $(CXX_LIB2FUNCS) > cplib2.new;; \
*) \
echo "" > cplib2.new;; \
esac
mv -f cplib2.new cplib2.txt
# Or if it would be different.
cplib2.ready: $(GCC_PASSES) $(LANGUAGES) $(LIBGCC2_DEPS) stmp-int-hdrs
@if [ -r cplib2.txt ]; then \
case " $(LANGUAGES) " in \
*" "[cC]"++ "*) \
echo $(CXX_LIB2FUNCS) > cplib2.new;; \
*) \
echo "" > cplib2.new;; \
esac; \
if cmp -s cplib2.new cplib2.txt; then true; else \
touch cplib2.ready; \
fi; \
rm -f cplib2.new; \
else true ; \
fi
@if [ -f cplib2.ready ]; then true; else \
touch cplib2.ready; \
fi
#
# Install hooks:
# cc1plus is installed elsewhere as part of $(COMPILERS).
# Nothing to do here.
c++.install-normal:
# Install the driver program as $(target)-g++
# and also as either g++ (if native) or $(tooldir)/bin/g++.
c++.install-common:
-if [ -f cc1plus$(exeext) ] ; then \
if [ -f g++-cross$(exeext) ] ; then \
rm -f $(bindir)/$(GXX_CROSS_NAME)$(exeext); \
$(INSTALL_PROGRAM) g++-cross$(exeext) $(bindir)/$(GXX_CROSS_NAME)$(exeext); \
chmod a+x $(bindir)/$(GXX_CROSS_NAME)$(exeext); \
rm -f $(bindir)/$(CXX_CROSS_NAME)$(exeext); \
$(LN) $(bindir)/$(GXX_CROSS_NAME)$(exeext) $(bindir)/$(CXX_CROSS_NAME)$(exeext); \
else \
rm -f $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
$(INSTALL_PROGRAM) g++$(exeext) $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
chmod a+x $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
rm -f $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
$(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
fi ; \
if [ x$(DEMANGLER_PROG) != x ] && [ -x "$(DEMANGLER_PROG)" ]; then \
if [ -f g++-cross$(exeext) ] ; then \
rm -f $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
$(INSTALL_PROGRAM) $(DEMANGLER_PROG) $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
chmod a+x $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
else \
rm -f $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
$(INSTALL_PROGRAM) $(DEMANGLER_PROG) $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
chmod a+x $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
fi ; \
fi ; \
fi
c++.install-info:
c++.install-man: $(srcdir)/cp/g++.1
-if [ -f cc1plus$(exeext) ] ; then \
if [ -f g++-cross$(exeext) ] ; then \
rm -f $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
$(INSTALL_DATA) $(srcdir)/cp/g++.1 $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
chmod a-x $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
else \
rm -f $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
$(INSTALL_DATA) $(srcdir)/cp/g++.1 $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
chmod a-x $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
fi; \
else true; fi
c++.uninstall:
-rm -rf $(bindir)/$(CXX_INSTALL_NAME)$(exeext)
-rm -rf $(bindir)/$(CXX_CROSS_NAME)$(exeext)
-rm -rf $(bindir)/$(GXX_INSTALL_NAME)$(exeext)
-rm -rf $(bindir)/$(GXX_CROSS_NAME)$(exeext)
-rm -rf $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext)
-rm -rf $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext)
-rm -rf $(man1dir)/$(GXX_INSTALL_NAME)$(manext)
-rm -rf $(man1dir)/$(GXX_CROSS_NAME)$(manext)
#
# Clean hooks:
# A lot of the ancillary files are deleted by the main makefile.
# We just have to delete files specific to us.
c++.mostlyclean:
-rm -f cp/*$(objext) $(DEMANGLER_PROG)
# CYGNUS LOCAL - Delete these files here instead of in realclean because they
# are now created in the build subdirectories.
-rm -f cp/parse.c cp/parse.h cp/parse.output cp/y.tab.c
c++.clean:
-rm -f cplib2.txt cplib2.ready
c++.distclean:
-rm -f cp/config.status cp/Makefile
-rm -f cp/parse.output
-rm -f g++.c
c++.extraclean:
c++.maintainer-clean:
-rm -f cp/parse.c cp/parse.h
#
# Stage hooks:
# The main makefile has already created stage?/cp.
c++.stage1: stage1-start
-mv cp/*$(objext) stage1/cp
c++.stage2: stage2-start
-mv cp/*$(objext) stage2/cp
c++.stage3: stage3-start
-mv cp/*$(objext) stage3/cp
c++.stage4: stage4-start
-mv cp/*$(objext) stage4/cp
#
# Maintenance hooks:
# This target creates the files that can be rebuilt, but go in the
# distribution anyway. It then copies the files to the distdir directory.
c++.distdir:
mkdir tmp/cp
mkdir tmp/cp/inc
cd cp ; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) parse.c hash.h
cd cp; \
for file in *[0-9a-zA-Z+]; do \
$(LN) $$file ../tmp/cp; \
done
cd cp/inc; \
for file in *[0-9a-zA-Z+]; do \
ln $$file ../../tmp/cp/inc >/dev/null 2>&1 \
|| cp $$file ../../tmp/cp/inc; \
done

View File

@ -1,343 +0,0 @@
# Makefile for GNU C++ compiler.
# Copyright (C) 1987, 88, 90-5, 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.
# The makefile built from this file lives in the language subdirectory.
# Its 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:
# It defines the c++ interface name. It should be changed when the
# c++ interface is changed.
INTERFACE = 1
# Variables that exist for you to override.
# See below for how to change them for certain systems.
ALLOCA =
# 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@
BISON = `if [ -f ../../bison/bison ] ; then echo ../../bison/bison -L $(srcdir)/../../bison/ ; else echo bison ; fi`
BISONFLAGS =
LEX = `if [ -f ../../flex/flex ] ; then echo ../../flex/flex ; else echo flex ; fi`
LEXFLAGS =
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 in the definition of SUBDIR_USE_ALLOCA.
# ??? Perhaps it would be better if it just looked for *gcc*.
OLDCC = cc
# 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@
# Additional system libraries to link with.
CLIB=
# Change this to a null string if obstacks are installed in the
# system library.
OBSTACK=obstack.o
# Choose the real default target.
ALL=all
# 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@
####cross overrides
@cross_defines@
@cross_overrides@
####build overrides
@build_overrides@
# CYGNUS LOCAL --site
####site overrides
# END CYGNUS LOCAL
#
# Now figure out from those variables how to compile and link.
all.indirect: Makefile ../cc1plus$(exeext)
# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
# 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)
# CYGNUS LOCAL: SUBDIR_USE_ALLOCA is different from FSF.
# Even if ALLOCA is set, don't use it if compiling with GCC.
SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
#SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
SUBDIR_USE_ALLOCA = `if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi`
SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
# 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
# Always use -I$(srcdir)/config when compiling.
.c.o:
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
# The only suffixes we want for implicit rules are .c and .o.
.SUFFIXES:
.SUFFIXES: .c .o
# 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 g++
CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
except.o friend.o init.o method.o search.o semantics.o tree.o xref.o \
repo.o @extra_cxx_objs@
# Language-independent object files.
OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o ../hash.o
OBJDEPS = ../stamp-objlist ../c-common.o ../c-pragma.o ../hash.o
compiler: ../cc1plus$(exeext)
../cc1plus$(exeext): $(P) $(OBJDEPS) $(CXX_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(CXX_OBJS) $(LIBS)
Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
cd ..; $(SHELL) config.status
native: config.status ../cc1plus$(exeext)
#
# Compiling object files from source files.
# Note that dependencies on obstack.h are not written
# because that file is not part of GCC.
# C++ language specific files.
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
CXX_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
# CYGNUS LOCAL: We build parse.[ch] in the build directory.
PARSE_H = parse.h
PARSE_C = parse.c
parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
$(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
`echo $(PARSE_C) | sed 's,^\./,,'`
CONFLICTS = expect 36 shift/reduce conflicts and 42 reduce/reduce conflicts.
# CYGNUS LOCAL build in build tree
$(PARSE_H) : $(PARSE_C)
$(PARSE_C) : $(srcdir)/parse.y
@echo $(CONFLICTS)
$(BISON) $(BISONFLAGS) -d -o $(PARSE_C) $(srcdir)/parse.y
grep '^#define[ ]*YYEMPTY' $(PARSE_C) >>$(PARSE_H)
# END CYGNUS LOCAL
# We used to try to protect people from having to rerun gperf. But,
# the C front-end already requires this if c-parse.gperf is changed,
# so we should be consistent.
$(srcdir)/hash.h: $(srcdir)/gxx.gperf
gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word \
'-k1,4,7,$$' $(srcdir)/gxx.gperf >$(srcdir)/hash.h
spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
lex.o : lex.c $(CONFIG_H) $(CXX_TREE_H) \
$(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \
$(srcdir)/../c-pragma.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
$(srcdir)/../output.h $(srcdir)/../mbchar.h
decl.o : decl.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h \
$(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
$(srcdir)/../hash.h
decl2.o : decl2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
lex.h decl.h $(EXPR_H) $(srcdir)/../except.h \
$(srcdir)/../output.h $(srcdir)/../except.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h $(srcdir)/../dwarf2out.h $(srcdir)/../dwarfout.h
typeck2.o : typeck2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
typeck.o : typeck.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
$(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
class.o : class.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
call.o : call.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
friend.o : friend.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
$(srcdir)/../system.h $(srcdir)/../toplev.h
init.o : init.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
$(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
method.o : method.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
$(srcdir)/../toplev.h
cvt.o : cvt.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h decl.h \
$(srcdir)/../flags.h $(srcdir)/../toplev.h $(srcdir)/../convert.h
search.o : search.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h \
$(srcdir)/../flags.h $(srcdir)/../system.h $(srcdir)/../toplev.h
tree.o : tree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
ptree.o : ptree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h
rtti.o : rtti.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
except.o : except.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
$(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
expr.o : expr.c $(CONFIG_H) $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
xref.o : xref.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../input.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
pt.o : pt.c $(CONFIG_H) $(CXX_TREE_H) decl.h $(PARSE_H) lex.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
error.o : error.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
$(srcdir)/../toplev.h
errfn.o : errfn.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
$(srcdir)/../toplev.h
sig.o : sig.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
repo.o : repo.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
$(srcdir)/../toplev.h
semantics.o: semantics.c $(CONFIG_H) $(CXX_TREE_H) lex.h \
$(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
#
# These exist for maintenance purposes.
# Update the tags table.
TAGS: force
cd $(srcdir) ; \
etags *.c *.h ; \
echo 'l' | tr 'l' '\f' >> TAGS ; \
echo 'parse.y,0' >> TAGS ; \
etags -a ../*.h ../*.c;
.PHONY: TAGS
force:
g++FAQ.info: $(srcdir)/g++FAQ.texi
$(MAKEINFO) --no-split -o ./g++FAQ.info $(srcdir)/g++FAQ.texi
# Preprocess the texi file so that the final document will have
# hyperlinks.
# It would be nice if texi2html could do something like this itself.
# Assumption 1: the FAQ puts all http: and ftp: links in a @file{...}.
# Assumption 2: newsgroups are like @file{comp.foo}
# Assumption 3: email addresses match the regexp shown.
g++FAQ.html: $(srcdir)/g++FAQ.texi
mkdir work
sed -e 's?@file{\([fth]*p://[^}]*\)}?@strong{<A HREF="\1">\1</A>}?' \
-e 's?@file{\(comp\.[-a-z+.]*\)}?<A HREF="news:\1">\1</A>?' \
-e 's?@file{\(gnu\.[-a-z+.]*\)}?<A HREF="news:\1">\1</A>?' \
-e 's?\([.+a-zA-Z0-9-]*@@[.a-zA-Z0-9-]*[a-zA-Z0-9]\)?<A HREF="mailto:\1">\1</A>?' \
$(srcdir)/g++FAQ.texi > work/g++FAQ.texi
cd work; texi2html g++FAQ.texi
mv work/*.html .
rm -r work
# Make plain-text form.
g++FAQ.txt: $(srcdir)/g++FAQ.texi
$(MAKEINFO) --no-split --no-headers -o - $(srcdir)/g++FAQ.texi |\
sed '/^Concept Index/,$$d' > g++FAQ.txt

View File

@ -1,232 +0,0 @@
*** Changes since EGCS 1.1:
* Messages about non-conformant code that we can still handle ("pedwarns")
are now errors by default, rather than warnings. This can be reverted
with -fpermissive, and is overridden by -pedantic or -pedantic-errors.
*** Changes in EGCS 1.1:
* Namespaces are fully supported. The library has not yet been converted
to use namespace std, however, and the old std-faking code is still on by
default. To turn it off, you can use -fhonor-std.
* Massive template improvements:
+ member template classes are supported.
+ template friends are supported.
+ template template parameters are supported.
+ local classes in templates are supported.
+ lots of bugs fixed.
* operator new now throws bad_alloc where appropriate.
* Exception handling is now thread safe, and supports nested exceptions and
placement delete. Exception handling overhead on x86 is much lower with
GNU as 2.9.
* protected virtual inheritance is now supported.
* Loops are optimized better; we now move the test to the end in most
cases, like the C frontend does.
* For class D derived from B which has a member 'int i', &D::i is now of
type 'int B::*' instead of 'int D::*'.
* An _experimental_ new ABI for g++ can be turned on with -fnew-abi. The
current features of this are more efficient allocation of base classes
(including the empty base optimization), and more compact mangling of C++
symbol names (which can be turned on separately with -fsquangle). This
ABI is subject to change without notice, so don't use it for anything
that you don't want to rebuild with every release of the compiler.
As with all ABI-changing flags, this flag is for experts only, as all
code (including the library code in libgcc and libstdc++) must be
compiled with the same ABI.
*** Changes in EGCS 1.0:
* A public review copy of the December 1996 Draft of the ISO/ANSI C++
standard is now available. See
http://www.cygnus.com/misc/wp/
for more information.
* g++ now uses a new implementation of templates. The basic idea is that
now templates are minimally parsed when seen and then expanded later.
This allows conformant early name binding and instantiation controls,
since instantiations no longer have to go through the parser.
What you get:
+ Inlining of template functions works without any extra effort or
modifications.
+ Instantiations of class templates and methods defined in the class
body are deferred until they are actually needed (unless
-fexternal-templates is specified).
+ Nested types in class templates work.
+ Static data member templates work.
+ Member function templates are now supported.
+ Partial specialization of class templates is now supported.
+ Explicit specification of template parameters to function templates
is now supported.
Things you may need to fix in your code:
+ Syntax errors in templates that are never instantiated will now be
diagnosed.
+ Types and class templates used in templates must be declared
first, or the compiler will assume they are not types, and fail.
+ Similarly, nested types of template type parameters must be tagged
with the 'typename' keyword, except in base lists. In many cases,
but not all, the compiler will tell you where you need to add
'typename'. For more information, see
http://www.cygnus.com/misc/wp/dec96pub/template.html#temp.res
+ Guiding declarations are no longer supported. Function declarations,
including friend declarations, do not refer to template instantiations.
You can restore the old behavior with -fguiding-decls until you fix
your code.
Other features:
+ Default function arguments in templates will not be evaluated (or
checked for semantic validity) unless they are needed. Default
arguments in class bodies will not be parsed until the class
definition is complete.
+ The -ftemplate-depth-NN flag can be used to increase the maximum
recursive template instantiation depth, which defaults to 17. If you
need to use this flag, the compiler will tell you.
+ Explicit instantiation of template constructors and destructors is
now supported. For instance:
template A<int>::A(const A&);
Still not supported:
+ Member class templates.
+ Template friends.
* Exception handling support has been significantly improved and is on by
default. The compiler supports two mechanisms for walking back up the
call stack; one relies on static information about how registers are
saved, and causes no runtime overhead for code that does not throw
exceptions. The other mechanism uses setjmp and longjmp equivalents, and
can result in quite a bit of runtime overhead. You can determine which
mechanism is the default for your target by compiling a testcase that
uses exceptions and doing an 'nm' on the object file; if it uses __throw,
it's using the first mechanism. If it uses __sjthrow, it's using the
second.
You can turn EH support off with -fno-exceptions.
* RTTI support has been rewritten to work properly and is now on by default.
This means code that uses virtual functions will have a modest space
overhead. You can use the -fno-rtti flag to disable RTTI support.
* On ELF systems, duplicate copies of symbols with 'initialized common'
linkage (such as template instantiations, vtables, and extern inlines)
will now be discarded by the GNU linker, so you don't need to use -frepo.
This support requires GNU ld from binutils 2.8 or later.
* The overload resolution code has been rewritten to conform to the latest
C++ Working Paper. Built-in operators are now considered as candidates
in operator overload resolution. Function template overloading chooses
the more specialized template, and handles base classes in type deduction
and guiding declarations properly. In this release the old code can
still be selected with -fno-ansi-overloading, although this is not
supported and will be removed in a future release.
* Standard usage syntax for the std namespace is supported; std is treated
as an alias for global scope. General namespaces are still not supported.
* New flags:
+ New warning -Wno-pmf-conversion (don't warn about
converting from a bound member function pointer to function
pointer).
+ A flag -Weffc++ has been added for violations of some of the style
guidelines in Scott Meyers' _Effective C++_ books.
+ -Woverloaded-virtual now warns if a virtual function in a base
class is hidden in a derived class, rather than warning about
virtual functions being overloaded (even if all of the inherited
signatures are overridden) as it did before.
+ -Wall no longer implies -W. The new warning flag, -Wsign-compare,
included in -Wall, warns about dangerous comparisons of signed and
unsigned values. Only the flag is new; it was previously part of
-W.
+ The new flag, -fno-weak, disables the use of weak symbols.
* Synthesized methods are now emitted in any translation units that need
an out-of-line copy. They are no longer affected by #pragma interface
or #pragma implementation.
* __FUNCTION__ and __PRETTY_FUNCTION__ are now treated as variables by the
parser; previously they were treated as string constants. So code like
`printf (__FUNCTION__ ": foo")' must be rewritten to
`printf ("%s: foo", __FUNCTION__)'. This is necessary for templates.
* local static variables in extern inline functions will be shared between
translation units.
* -fvtable-thunks is supported for all targets, and is the default for
Linux with glibc 2.x (also called libc 6.x).
* bool is now always the same size as another built-in type. Previously,
a 64-bit RISC target using a 32-bit ABI would have 32-bit pointers and a
64-bit bool. This should only affect Irix 6, which was not supported in
2.7.2.
* new (nothrow) is now supported.
* Synthesized destructors are no longer made virtual just because the class
already has virtual functions, only if they override a virtual destructor
in a base class. The compiler will warn if this affects your code.
* The g++ driver now only links against libstdc++, not libg++; it is
functionally identical to the c++ driver.
* (void *)0 is no longer considered a null pointer constant; NULL in
<stddef.h> is now defined as __null, a magic constant of type (void *)
normally, or (size_t) with -ansi.
* The name of a class is now implicitly declared in its own scope; A::A
refers to A.
* Local classes are now supported.
* __attribute__ can now be attached to types as well as declarations.
* The compiler no longer emits a warning if an ellipsis is used as a
function's argument list.
* Definition of nested types outside of their containing class is now
supported. For instance:
struct A {
struct B;
B* bp;
};
struct A::B {
int member;
};
* On the HPPA, some classes that do not define a copy constructor
will be passed and returned in memory again so that functions
returning those types can be inlined.
*** The g++ team thanks everyone that contributed to this release,
but especially:
* Joe Buck <jbuck@synopsys.com>, the maintainer of the g++ FAQ.
* Brendan Kehoe <brendan@cygnus.com>, who coordinates testing of g++.
* Jason Merrill <jason@cygnus.com>, the g++ maintainer.
* Mark Mitchell <mmitchell@usa.net>, who implemented member function
templates and explicit qualification of function templates.
* Mike Stump <mrs@wrs.com>, the previous g++ maintainer, who did most of
the exception handling work.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,41 +0,0 @@
# Top level configure fragment for GNU C++.
# Copyright (C) 1994, 1995, 1997, 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.
# 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)
# diff_excludes - files to ignore when building diffs between two versions.
language="c++"
compilers="cc1plus\$(exeext)"
stagestuff="g++\$(exeext) g++-cross\$(exeext) cc1plus\$(exeext)"
diff_excludes="-x parse.c -x parse.h"
headers='$(CXX_EXTRA_HEADERS)'
lib2funcs=cplib2.txt
outputs=cp/Makefile

View File

@ -1,257 +0,0 @@
/* This file contains the definitions and documentation for the
additional tree codes used in the GNU C++ compiler (see tree.def
for the standard codes).
Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
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. */
/* Reference to the contents of an offset
(a value whose type is an OFFSET_TYPE).
Operand 0 is the object within which the offset is taken.
Operand 1 is the offset. The language independent OFFSET_REF
just won't work for us. */
DEFTREECODE (OFFSET_REF, "offset_ref", 'r', 2)
/* A pointer-to-member constant. For a pointer-to-member constant
`X::Y' The PTRMEM_CST_CLASS is the RECORD_TYPE for `X' and the
PTRMEM_CST_MEMBER is the _DECL for `Y'. */
DEFTREECODE (PTRMEM_CST, "ptrmem_cst", 'c', 1)
/* For NEW_EXPR, operand 0 is the placement list.
Operand 1 is the new-declarator.
Operand 2 is the initializer. */
DEFTREECODE (NEW_EXPR, "nw_expr", 'e', 3)
DEFTREECODE (VEC_NEW_EXPR, "vec_nw_expr", 'e', 3)
/* For DELETE_EXPR, operand 0 is the store to be destroyed.
Operand 1 is the value to pass to the destroying function
saying whether the store should be deallocated as well. */
DEFTREECODE (DELETE_EXPR, "dl_expr", 'e', 2)
DEFTREECODE (VEC_DELETE_EXPR, "vec_dl_expr", 'e', 2)
/* Value is reference to particular overloaded class method.
Operand 0 is the class name (an IDENTIFIER_NODE);
operand 1 is the field (also an IDENTIFIER_NODE).
The COMPLEXITY field holds the class level (usually 0). */
DEFTREECODE (SCOPE_REF, "scope_ref", 'r', 2)
/* When composing an object with a member, this is the result.
Operand 0 is the object. Operand 1 is the member (usually
a dereferenced pointer to member). */
DEFTREECODE (MEMBER_REF, "member_ref", 'r', 2)
/* Type conversion operator in C++. TREE_TYPE is type that this
operator converts to. Operand is expression to be converted. */
DEFTREECODE (TYPE_EXPR, "type_expr", 'e', 1)
/* For AGGR_INIT_EXPR, operand 0 is function which performs initialization,
operand 1 is argument list to initialization function,
and operand 2 is the slot which was allocated for this expression. */
DEFTREECODE (AGGR_INIT_EXPR, "aggr_init_expr", 'e', 3)
/* A throw expression. operand 0 is the expression, if there was one,
else it is NULL_TREE. */
DEFTREECODE (THROW_EXPR, "throw_expr", 'e', 1)
/* Initialization of a vector, used in build_new. Operand 0 is the target
of the initialization, operand 1 is the initializer, and operand 2 is
the number of elements. */
DEFTREECODE (VEC_INIT_EXPR, "vec_init_expr", 'e', 3)
/* Template definition. The following fields have the specified uses,
although there are other macros in cp-tree.h that should be used for
accessing this data.
DECL_ARGUMENTS template parm vector
DECL_TEMPLATE_INFO template text &c
DECL_VINDEX list of instantiations already produced;
only done for functions so far
For class template:
DECL_INITIAL associated templates (methods &c)
DECL_RESULT null
For non-class templates:
TREE_TYPE type of object to be constructed
DECL_RESULT decl for object to be created
(e.g., FUNCTION_DECL with tmpl parms used)
*/
DEFTREECODE (TEMPLATE_DECL, "template_decl", 'd', 0)
/* Index into a template parameter list. The TEMPLATE_PARM_IDX gives
the index (from 0) of the parameter, while the TEMPLATE_PARM_LEVEL
gives the level (from 1) of the parameter.
Here's an example:
template <class T> // Index 0, Level 1.
struct S
{
template <class U, // Index 0, Level 2.
class V> // Index 1, Level 2.
void f();
};
The DESCENDANTS will be a chain of TEMPLATE_PARM_INDEXs descended
from this one. The first descendant will have the same IDX, but
its LEVEL will be one less. The TREE_CHAIN field is used to chain
together the descendants. The TEMPLATE_PARM_DECL is the
declaration of this parameter, either a TYPE_DECL or CONST_DECL.
The TEMPLATE_PARM_ORIG_LEVEL is the LEVEL of the most distant
parent, i.e., the LEVEL that the parameter originally had when it
was declared. For example, if we instantiate S<int>, we will have:
struct S<int>
{
template <class U, // Index 0, Level 1, Orig Level 2
class V> // Index 1, Level 1, Orig Level 2
void f();
};
The LEVEL is the level of the parameter when we are worrying about
the types of things; the ORIG_LEVEL is the level when we are
worrying about instantiating things. */
DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", 'x',
/* The addition of (sizeof(char*) - 1) in the next
expression is to ensure against the case where
sizeof(char*) does not evenly divide
sizeof(HOST_WIDE_INT). */
2 + ((3 * sizeof (HOST_WIDE_INT) + sizeof(char*) - 1)
/ sizeof (char*)))
/* Index into a template parameter list. This parameter must be a type.
The TYPE_FIELDS value will be a TEMPLATE_PARM_INDEX. */
DEFTREECODE (TEMPLATE_TYPE_PARM, "template_type_parm", 't', 0)
/* Index into a template parameter list. This parameter must be a type.
If it is used in signature of a template, TEMPLATE_INFO is NULL_TREE.
Otherwise it is used to declare a type like TT<int>.
The TYPE_FIELDS value will be a TEMPLATE_PARM_INDEX. */
DEFTREECODE (TEMPLATE_TEMPLATE_PARM, "template_template_parm", 't', 0)
/* A type designated by `typename T::t'. TYPE_CONTEXT is `T',
TYPE_NAME is a TYPE_DECL for `t'. If TREE_TYPE is present, this
type was generated by the implicit typename extension, and the
TREE_TYPE is a _TYPE from a baseclass of `T'. */
DEFTREECODE (TYPENAME_TYPE, "typename_type", 't', 0)
/* A type designated by `__typeof (expr)'. TYPE_FIELDS is the
expression in question. */
DEFTREECODE (TYPEOF_TYPE, "typeof_type", 't', 0)
/* A thunk is a stub function.
Thunks are used to implement multiple inheritance:
At run-time, such a thunk subtracts THUNK_DELTA (an int, not a tree)
from the this pointer, and then jumps to DECL_INITIAL
(which is an ADDR_EXPR whose operand is a FUNCTION_DECL).
Other kinds of thunks may be defined later. */
DEFTREECODE (THUNK_DECL, "thunk_decl", 'd', 0)
/* A using declaration. DECL_INITIAL contains the specified scope.
This is not an alias, but is later expanded into multiple aliases. */
DEFTREECODE (USING_DECL, "using_decl", 'd', 0)
/* An un-parsed default argument. Looks like an IDENTIFIER_NODE. */
DEFTREECODE (DEFAULT_ARG, "default_arg", 'c', 2)
/* A template-id, like foo<int>. The first operand is the template.
The second is the list of explicitly specified arguments. The
template will be a FUNCTION_DECL, TEMPLATE_DECL, or a list of
overloaded functions and templates if the template-id refers to
a global template. If the template-id refers to a member template,
the template may be an IDENTIFIER_NODE. */
DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", 'e', 2)
/* An association between name and entity. Parameters are the scope
and the (non-type) value. TREE_TYPE indicates the type bound to
the name. */
DEFTREECODE (CPLUS_BINDING, "binding", 'x', 2)
/* A list-like node for chaining overloading candidates. TREE_TYPE is
the original name, and the parameter is the FUNCTION_DECL. */
DEFTREECODE (OVERLOAD, "overload", 'x', 1)
/* A generic wrapper for something not tree that we want to include in
tree structure. */
DEFTREECODE (WRAPPER, "wrapper", 'x', 1)
/* A node to remember a source position. */
DEFTREECODE (SRCLOC, "srcloc", 'x', 2)
/* Used to represent deferred name lookup for dependent names while
parsing a template declaration. The first argument is an
IDENTIFIER_NODE for the name in question. The TREE_TYPE is
unused. */
DEFTREECODE (LOOKUP_EXPR, "lookup_expr", 'e', 1)
/* A whole bunch of tree codes for the initial, superficial parsing of
templates. */
DEFTREECODE (MODOP_EXPR, "modop_expr", 'e', 3)
DEFTREECODE (CAST_EXPR, "cast_expr", '1', 1)
DEFTREECODE (REINTERPRET_CAST_EXPR, "reinterpret_cast_expr", '1', 1)
DEFTREECODE (CONST_CAST_EXPR, "const_cast_expr", '1', 1)
DEFTREECODE (STATIC_CAST_EXPR, "static_cast_expr", '1', 1)
DEFTREECODE (DYNAMIC_CAST_EXPR, "dynamic_cast_expr", '1', 1)
DEFTREECODE (SIZEOF_EXPR, "sizeof_expr", '1', 1)
DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", '1', 1)
DEFTREECODE (ARROW_EXPR, "arrow_expr", 'e', 1)
DEFTREECODE (DOTSTAR_EXPR, "dotstar_expr", 'e', 2)
DEFTREECODE (TYPEID_EXPR, "typeid_expr", 'e', 1)
DEFTREECODE (EXPR_STMT, "expr_stmt", 'e', 1)
DEFTREECODE (COMPOUND_STMT, "compound_stmt", 'e', 1)
DEFTREECODE (DECL_STMT, "decl_stmt", 'e', 3)
DEFTREECODE (IF_STMT, "if_stmt", 'e', 3)
DEFTREECODE (FOR_STMT, "for_stmt", 'e', 4)
DEFTREECODE (WHILE_STMT, "while_stmt", 'e', 2)
DEFTREECODE (DO_STMT, "do_stmt", 'e', 2)
DEFTREECODE (RETURN_STMT, "return_stmt", 'e', 1)
DEFTREECODE (BREAK_STMT, "break_stmt", 'e', 0)
DEFTREECODE (CONTINUE_STMT, "continue_stmt", 'e', 0)
DEFTREECODE (SWITCH_STMT, "switch_stmt", 'e', 2)
DEFTREECODE (GOTO_STMT, "goto_stmt", 'e', 1)
DEFTREECODE (ASM_STMT, "asm_stmt", 'e', 5)
DEFTREECODE (CTOR_INITIALIZER, "ctor_initializer", 'e', 2)
DEFTREECODE (CASE_LABEL, "case_label", 'e', 2)
DEFTREECODE (RETURN_INIT, "return_init", 'e', 2)
DEFTREECODE (TRY_BLOCK, "try_stmt", 'e', 2)
DEFTREECODE (HANDLER, "catch_stmt", 'e', 2)
DEFTREECODE (TAG_DEFN, "tag_defn", 'e', 0)
/* And some codes for expressing conversions for overload resolution. */
DEFTREECODE (IDENTITY_CONV, "identity_conv", 'e', 1)
DEFTREECODE (LVALUE_CONV, "lvalue_conv", 'e', 1)
DEFTREECODE (QUAL_CONV, "qual_conv", 'e', 1)
DEFTREECODE (STD_CONV, "std_conv", 'e', 1)
DEFTREECODE (PTR_CONV, "ptr_conv", 'e', 1)
DEFTREECODE (PMEM_CONV, "pmem_conv", 'e', 1)
DEFTREECODE (BASE_CONV, "base_conv", 'e', 1)
DEFTREECODE (REF_BIND, "ref_bind", 'e', 1)
DEFTREECODE (USER_CONV, "user_conv", 'e', 2)
DEFTREECODE (AMBIG_CONV, "ambig_conv", 'e', 1)
DEFTREECODE (RVALUE_CONV, "rvalue_conv", 'e', 1)
/*
Local variables:
mode:c
End:
*/

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,59 +0,0 @@
/* Variables and structures for declaration processing.
Copyright (C) 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. */
/* In grokdeclarator, distinguish syntactic contexts of declarators. */
enum decl_context
{ NORMAL, /* Ordinary declaration */
FUNCDEF, /* Function definition */
PARM, /* Declaration of parm before function body */
CATCHPARM, /* Declaration of catch parm */
FIELD, /* Declaration inside struct or union */
BITFIELD, /* Likewise but with specified width */
TYPENAME, /* Typename (inside cast or sizeof) */
MEMFUNCDEF /* Member function definition */
};
/* We need this in here to get the decl_context definition. */
extern tree grokdeclarator PROTO((tree, tree, enum decl_context, int, tree));
/* C++: Keep these around to reduce calls to `get_identifier'.
Identifiers for `this' in member functions and the auto-delete
parameter for destructors. */
extern tree this_identifier, in_charge_identifier;
/* Parsing a function declarator leaves a list of parameter names
or a chain or parameter decls here. */
extern tree last_function_parms;
/* A list of static class variables. This is needed, because a
static class variable can be declared inside the class without
an initializer, and then initialized, staticly, outside the class. */
extern tree pending_statics;
/* A list of objects which have constructors or destructors
which reside in the global scope. The decl is stored in
the TREE_VALUE slot and the initializer is stored
in the TREE_PURPOSE slot. */
extern tree static_aggregates;
#ifdef DEBUG_CP_BINDING_LEVELS
/* Purely for debugging purposes. */
extern int debug_bindings_indentation;
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,343 +0,0 @@
/* Provide a call-back mechanism for handling error output.
Copyright (C) 1993, 94-98, 1999 Free Software Foundation, Inc.
Contributed by Jason Merrill (jason@cygnus.com)
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 "toplev.h"
/* cp_printer is the type of a function which converts an argument into
a string for digestion by printf. The cp_printer function should deal
with all memory management; the functions in this file will not free
the char*s returned. See error.c for an example use of this code. */
typedef char* cp_printer PROTO((tree, int));
extern cp_printer * cp_printers[256];
/* Whether or not we should try to be quiet for errors and warnings; this is
used to avoid being too talkative about problems with tentative choices
when we're computing the conversion costs for a method call. */
int cp_silent = 0;
typedef void errorfn (); /* deliberately vague */
extern char* cp_file_of PROTO((tree));
extern int cp_line_of PROTO((tree));
#define STRDUP(f) (ap = (char *) alloca (strlen (f) +1), strcpy (ap, (f)), ap)
/* This function supports only `%s', `%d', `%%', and the C++ print
codes. */
static void
cp_thing (errfn, atarg1, format, ap)
errorfn *errfn;
int atarg1;
const char *format;
va_list ap;
{
static char *buf;
static long buflen;
int nargs = 0;
long len;
long offset;
const char *f;
tree atarg = 0;
len = strlen (format) + 1;
if (len > buflen)
{
buflen = len;
buf = xrealloc (buf, buflen);
}
offset = 0;
for (f = format; *f; ++f)
{
cp_printer * function;
int alternate;
int maybe_here;
/* ignore text */
if (*f != '%')
{
buf[offset++] = *f;
continue;
}
++f;
alternate = 0;
maybe_here = 0;
/* Check for '+' and '#' (in that order). */
if (*f == '+')
{
maybe_here = 1;
++f;
}
if (*f == '#')
{
alternate = 1;
++f;
}
/* no field width or precision */
function = cp_printers[(int)*f];
if (function || *f == 's')
{
char *p;
int plen;
if (*f == 's')
{
p = va_arg (ap, char *);
nargs++;
}
else
{
tree t = va_arg (ap, tree);
nargs++;
/* This indicates that ATARG comes from a different
location than normal. */
if (maybe_here && atarg1)
atarg = t;
/* If atarg1 is set and this is the first argument, then
set ATARG appropriately. */
if (atarg1 && nargs == 1)
atarg = t;
p = (*function) (t, alternate);
}
plen = strlen (p);
len += plen;
if (len > buflen)
{
buflen = len;
buf = xrealloc (buf, len);
}
strcpy (buf + offset, p);
offset += plen;
}
else if (*f == '%')
{
/* A `%%' has occurred in the input string. Replace it with
a `%' in the formatted message buf. */
if (++len > buflen)
{
buflen = len;
buf = xrealloc (buf, len);
}
buf[offset++] = '%';
}
else
{
if (*f != 'd')
abort ();
len += HOST_BITS_PER_INT / 2;
if (len > buflen)
{
buflen = len;
buf = xrealloc (buf, len);
}
sprintf (buf + offset, "%d", va_arg (ap, int));
nargs++;
offset += strlen (buf + offset);
/* With an ANSI C library one could write
out += sprintf (...); */
}
}
buf[offset] = '\0';
/* If ATARG1 is set, but we haven't extracted any arguments, then
extract one tree argument for ATARG. */
if (nargs == 0 && atarg1)
atarg = va_arg (ap, tree);
if (atarg)
{
char *file = cp_file_of (atarg);
int line = cp_line_of (atarg);
(*errfn) (file, line, "%s", buf);
}
else
(*errfn) ("%s", buf);
}
void
cp_error VPROTO((const char *format, ...))
{
#ifndef ANSI_PROTOTYPES
char *format;
#endif
va_list ap;
VA_START (ap, format);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
#endif
if (! cp_silent)
cp_thing ((errorfn *) error, 0, format, ap);
va_end (ap);
}
void
cp_warning VPROTO((const char *format, ...))
{
#ifndef ANSI_PROTOTYPES
char *format;
#endif
va_list ap;
VA_START (ap, format);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
#endif
if (! cp_silent)
cp_thing ((errorfn *) warning, 0, format, ap);
va_end (ap);
}
void
cp_pedwarn VPROTO((const char *format, ...))
{
#ifndef ANSI_PROTOTYPES
char *format;
#endif
va_list ap;
VA_START (ap, format);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
#endif
if (! cp_silent)
cp_thing ((errorfn *) pedwarn, 0, format, ap);
va_end (ap);
}
extern errorfn compiler_error;
void
cp_compiler_error VPROTO((const char *format, ...))
{
#ifndef ANSI_PROTOTYPES
char *format;
#endif
va_list ap;
VA_START (ap, format);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
#endif
if (! cp_silent)
cp_thing (compiler_error, 0, format, ap);
va_end (ap);
}
void
cp_sprintf VPROTO((const char *format, ...))
{
#ifndef ANSI_PROTOTYPES
char *format;
#endif
va_list ap;
VA_START (ap, format);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
#endif
cp_thing ((errorfn *) sprintf, 0, format, ap);
va_end (ap);
}
void
cp_error_at VPROTO((const char *format, ...))
{
#ifndef ANSI_PROTOTYPES
char *format;
#endif
va_list ap;
VA_START (ap, format);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
#endif
if (! cp_silent)
cp_thing ((errorfn *) error_with_file_and_line, 1, format, ap);
va_end (ap);
}
void
cp_warning_at VPROTO((const char *format, ...))
{
#ifndef ANSI_PROTOTYPES
char *format;
#endif
va_list ap;
VA_START (ap, format);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
#endif
if (! cp_silent)
cp_thing ((errorfn *) warning_with_file_and_line, 1, format, ap);
va_end (ap);
}
void
cp_pedwarn_at VPROTO((const char *format, ...))
{
#ifndef ANSI_PROTOTYPES
char *format;
#endif
va_list ap;
VA_START (ap, format);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
#endif
if (! cp_silent)
cp_thing ((errorfn *) pedwarn_with_file_and_line, 1, format, ap);
va_end (ap);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,345 +0,0 @@
// Functions for Exception Support for -*- C++ -*-
// Copyright (C) 1994, 95-97, 1998 Free Software Foundation
// 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.
// As a special exception, if you link this library with other files,
// some of which are compiled with GCC, to produce an executable,
// this library does not by itself cause the resulting executable
// to be covered by the GNU General Public License.
// This exception does not however invalidate any other reasons why
// the executable file might be covered by the GNU General Public License.
#pragma implementation "exception"
#ifndef __EMBEDDED_CXX__
#include "typeinfo"
#include "exception"
#include <stddef.h>
#include "gansidecl.h" /* Needed to support macros used in eh-common.h. */
#include "eh-common.h"
/* Define terminate, unexpected, set_terminate, set_unexpected as
well as the default terminate func and default unexpected func. */
extern std::terminate_handler __terminate_func __attribute__((__noreturn__));
using std::terminate;
void
std::terminate ()
{
__terminate_func ();
}
void
__default_unexpected ()
{
terminate ();
}
static std::unexpected_handler __unexpected_func __attribute__((__noreturn__))
= __default_unexpected;
std::terminate_handler
std::set_terminate (std::terminate_handler func)
{
std::terminate_handler old = __terminate_func;
__terminate_func = func;
return old;
}
std::unexpected_handler
std::set_unexpected (std::unexpected_handler func)
{
std::unexpected_handler old = __unexpected_func;
__unexpected_func = func;
return old;
}
void
std::unexpected ()
{
__unexpected_func ();
}
/* C++-specific state about the current exception.
This must match init_exception_processing().
Note that handlers and caught are not redundant; when rethrown, an
exception can have multiple active handlers and still be considered
uncaught. */
struct cp_eh_info
{
__eh_info eh_info;
void *value;
void *type;
void (*cleanup)(void *, int);
bool caught;
cp_eh_info *next;
long handlers;
void *original_value;
};
/* Language-specific EH info pointer, defined in libgcc2. */
extern "C" cp_eh_info **__get_eh_info (); // actually void **
/* Is P the type_info node for a pointer of some kind? */
extern bool __is_pointer (void *);
/* OLD Compiler hook to return a pointer to the info for the current exception.
Used by get_eh_info (). This fudges the actualy returned value to
point to the beginning of what USE to be the cp_eh_info structure.
THis is so that old code that dereferences this pointer will find
things where it expects it to be.*/
extern "C" void *
__cp_exception_info (void)
{
return &((*__get_eh_info ())->value);
}
#define CP_EH_INFO ((cp_eh_info *) *__get_eh_info ())
/* Old Compiler hook to return a pointer to the info for the current exception.
Used by get_eh_info (). */
extern "C" cp_eh_info *
__cp_eh_info (void)
{
cp_eh_info *p = CP_EH_INFO;
return p;
}
/* Compiler hook to return a pointer to the info for the current exception,
Set the caught bit, and increment the number of handlers that are
looking at this exception. This makes handlers smaller. */
extern "C" cp_eh_info *
__start_cp_handler (void)
{
cp_eh_info *p = CP_EH_INFO;
p->caught = 1;
p->handlers++;
return p;
}
/* Allocate a buffer for a cp_eh_info and an exception object of size SIZE,
and return a pointer to the beginning of the object's space. */
extern "C" void * malloc (size_t);
extern "C" void *
__eh_alloc (size_t size)
{
void *p = malloc (size);
if (p == 0)
terminate ();
return p;
}
/* Free the memory for an cp_eh_info and associated exception, given
a pointer to the cp_eh_info. */
extern "C" void free (void *);
extern "C" void
__eh_free (void *p)
{
free (p);
}
typedef void * (* rtimetype) (void);
extern "C" void *
__cplus_type_matcher (cp_eh_info *info, rtimetype match_info,
exception_descriptor *exception_table)
{
void *ret;
/* No exception table implies the old style mechanism, so don't check. */
if (exception_table != NULL
&& exception_table->lang.language != EH_LANG_C_plus_plus)
return NULL;
if (match_info == CATCH_ALL_TYPE)
return info->value;
/* we don't worry about version info yet, there is only one version! */
void *match_type = match_info ();
ret = __throw_type_match_rtti (match_type, info->type, info->original_value);
/* change value of exception */
if (ret)
info->value = ret;
return ret;
}
/* Compiler hook to push a new exception onto the stack.
Used by expand_throw(). */
extern "C" void
__cp_push_exception (void *value, void *type, void (*cleanup)(void *, int))
{
cp_eh_info *p = (cp_eh_info *) __eh_alloc (sizeof (cp_eh_info));
p->value = value;
p->type = type;
p->cleanup = cleanup;
p->handlers = 0;
p->caught = false;
p->original_value = value;
p->eh_info.match_function = __cplus_type_matcher;
p->eh_info.language = EH_LANG_C_plus_plus;
p->eh_info.version = 1;
cp_eh_info **q = __get_eh_info ();
p->next = *q;
*q = p;
}
/* Compiler hook to pop an exception that has been finalized. Used by
push_eh_cleanup(). P is the info for the exception caught by the
current catch block. */
extern "C" void
__cp_pop_exception (cp_eh_info *p)
{
cp_eh_info **q = __get_eh_info ();
--p->handlers;
/* Don't really pop if there are still active handlers for our exception,
or if our exception is being rethrown (i.e. if the active exception is
our exception and it is uncaught). */
if (p->handlers != 0
|| (p == *q && !p->caught))
return;
for (; *q; q = &((*q)->next))
if (*q == p)
break;
if (! *q)
terminate ();
*q = p->next;
if (p->cleanup)
/* 2 is a magic value for destructors; see build_delete(). */
p->cleanup (p->value, 2);
if (! __is_pointer (p->type))
__eh_free (p->original_value); // value may have been co-erced.
__eh_free (p);
}
extern "C" void
__uncatch_exception (void)
{
cp_eh_info *p = CP_EH_INFO;
if (p == 0)
terminate ();
p->caught = false;
}
/* As per [except.unexpected]:
If an exception is thrown, we check it against the spec. If it doesn't
match, we call unexpected (). If unexpected () throws, we check that
exception against the spec. If it doesn't match, if the spec allows
bad_exception we throw that; otherwise we call terminate ().
The compiler treats an exception spec as a try block with a generic
handler that just calls this function with a list of the allowed
exception types, so we have an active exception that can be rethrown.
This function does not return. */
extern "C" void
__check_eh_spec (int n, const void **spec)
{
cp_eh_info *p = CP_EH_INFO;
for (int i = 0; i < n; ++i)
{
if (__throw_type_match_rtti (spec[i], p->type, p->value))
throw;
}
try
{
std::unexpected ();
}
catch (...)
{
// __exception_info is an artificial var pushed into each catch block.
if (p != __exception_info)
{
p = __exception_info;
for (int i = 0; i < n; ++i)
{
if (__throw_type_match_rtti (spec[i], p->type, p->value))
throw;
}
}
const std::type_info &bad_exc = typeid (std::bad_exception);
for (int i = 0; i < n; ++i)
{
if (__throw_type_match_rtti (spec[i], &bad_exc, p->value))
throw std::bad_exception ();
}
terminate ();
}
}
extern "C" void
__throw_bad_cast (void)
{
throw std::bad_cast ();
}
extern "C" void
__throw_bad_typeid (void)
{
throw std::bad_typeid ();
}
/* Has the current exception been caught? */
bool
std::uncaught_exception ()
{
cp_eh_info *p = CP_EH_INFO;
return p && ! p->caught;
}
const char * std::exception::
what () const
{
return typeid (*this).name ();
}
#endif

View File

@ -1,433 +0,0 @@
/* Convert language-specific tree expression to rtl instructions,
for GNU compiler.
Copyright (C) 1988, 92-97, 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. */
#include "config.h"
#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
#include "expr.h"
#include "cp-tree.h"
#include "toplev.h"
#if 0
static tree extract_aggr_init PROTO((tree, tree));
static tree extract_scalar_init PROTO((tree, tree));
#endif
static rtx cplus_expand_expr PROTO((tree, rtx, enum machine_mode,
enum expand_modifier));
/* Hook used by expand_expr to expand language-specific tree codes. */
static rtx
cplus_expand_expr (exp, target, tmode, modifier)
tree exp;
rtx target;
enum machine_mode tmode;
enum expand_modifier modifier;
{
tree type = TREE_TYPE (exp);
register enum machine_mode mode = TYPE_MODE (type);
register enum tree_code code = TREE_CODE (exp);
int ignore = target == const0_rtx;
if (ignore)
target = 0;
/* No sense saving up arithmetic to be done
if it's all in the wrong mode to form part of an address.
And force_operand won't know whether to sign-extend or zero-extend. */
if (mode != Pmode && modifier == EXPAND_SUM)
modifier = EXPAND_NORMAL;
switch (code)
{
case AGGR_INIT_EXPR:
{
/* Something needs to be initialized, but we didn't know
where that thing was when building the tree. For example,
it could be the return value of a function, or a parameter
to a function which lays down in the stack, or a temporary
variable which must be passed by reference.
Cleanups are handled in a language-specific way: they
might be run by the called function (true in GNU C++
for parameters with cleanups), or they might be
run by the caller, after the call (true in GNU C++
for other cleanup needs). */
tree func = TREE_OPERAND (exp, 0);
tree args = TREE_OPERAND (exp, 1);
tree type = TREE_TYPE (exp), slot;
tree call_exp;
rtx call_target, return_target;
int pcc_struct_return = 0;
/* The expression `init' wants to initialize what
`target' represents. SLOT holds the slot for TARGET. */
slot = TREE_OPERAND (exp, 2);
/* Should always be called with a target. */
my_friendly_assert (target != NULL_RTX, 205);
/* The target the initializer will initialize (CALL_TARGET)
must now be directed to initialize the target we are
supposed to initialize (TARGET). The semantics for
choosing what CALL_TARGET is is language-specific,
as is building the call which will perform the
initialization. It is left here to show the choices that
exist for C++. */
if (TREE_CODE (func) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (func, 0)) == FUNCTION_DECL
&& DECL_CONSTRUCTOR_P (TREE_OPERAND (func, 0)))
{
type = build_pointer_type (type);
/* Don't clobber a value that might be part of a default
parameter value. */
mark_addressable (slot);
if (TREE_PERMANENT (args))
args = expr_tree_cons (0, build1 (ADDR_EXPR, type, slot),
TREE_CHAIN (args));
else
TREE_VALUE (args) = build1 (ADDR_EXPR, type, slot);
call_target = 0;
}
else
{
call_target = target;
#ifdef PCC_STATIC_STRUCT_RETURN
if (aggregate_value_p (type))
{
pcc_struct_return = 1;
call_target = 0;
}
#endif
}
call_exp = build (CALL_EXPR, type, func, args, NULL_TREE);
TREE_SIDE_EFFECTS (call_exp) = 1;
return_target = expand_call (call_exp, call_target, ignore);
if (call_target)
/* Trust that the right thing has been done; it's too hard to
verify. */
return return_target;
/* If we're suffering under the ancient PCC_STATIC_STRUCT_RETURN
calling convention, we need to copy the return value out of
the static return buffer into slot. */
if (pcc_struct_return)
{
extern int flag_access_control;
int old_ac = flag_access_control;
tree init = build_decl (VAR_DECL, NULL_TREE,
build_reference_type (type));
DECL_RTL (init) = XEXP (return_target, 0);
init = convert_from_reference (init);
flag_access_control = 0;
expand_aggr_init (slot, init, LOOKUP_ONLYCONVERTING);
flag_access_control = old_ac;
if (TYPE_NEEDS_DESTRUCTOR (type))
{
init = maybe_build_cleanup (init);
if (init != NULL_TREE)
expand_expr (init, const0_rtx, VOIDmode, 0);
}
}
return DECL_RTL (slot);
}
case PTRMEM_CST:
{
tree member;
tree offset;
/* Find the member. */
member = PTRMEM_CST_MEMBER (exp);
if (TREE_CODE (member) == FIELD_DECL)
{
/* Find the offset for the field. */
offset = convert (sizetype,
size_binop (EASY_DIV_EXPR,
DECL_FIELD_BITPOS (member),
size_int (BITS_PER_UNIT)));
/* We offset all pointer to data members by 1 so that we
can distinguish between a null pointer to data member
and the first data member of a structure. */
offset = size_binop (PLUS_EXPR, offset, size_int (1));
return expand_expr (cp_convert (type, offset), target, tmode,
modifier);
}
else
{
/* We don't yet handle pointer-to-member functions this
way. */
my_friendly_abort (0);
return 0;
}
}
case OFFSET_REF:
{
return expand_expr (default_conversion (resolve_offset_ref (exp)),
target, tmode, EXPAND_NORMAL);
}
case THUNK_DECL:
return DECL_RTL (exp);
case THROW_EXPR:
expand_throw (TREE_OPERAND (exp, 0));
return NULL;
case VEC_INIT_EXPR:
return expand_expr
(expand_vec_init
(NULL_TREE, TREE_OPERAND (exp, 0),
build_binary_op (MINUS_EXPR, TREE_OPERAND (exp, 2),
integer_one_node, 1),
TREE_OPERAND (exp, 1), 0), target, tmode, modifier);
case NEW_EXPR:
return expand_expr (build_new_1 (exp), target, tmode, modifier);
default:
break;
}
my_friendly_abort (40);
/* NOTREACHED */
return NULL;
}
void
init_cplus_expand ()
{
lang_expand_expr = cplus_expand_expr;
}
/* If DECL had its rtl moved from where callers expect it
to be, fix it up. RESULT is the nominal rtl for the RESULT_DECL,
which may be a pseudo instead of a hard register. */
void
fixup_result_decl (decl, result)
tree decl;
rtx result;
{
if (REG_P (result))
{
if (REGNO (result) >= FIRST_PSEUDO_REGISTER)
{
rtx real_decl_result;
#ifdef FUNCTION_OUTGOING_VALUE
real_decl_result
= FUNCTION_OUTGOING_VALUE (TREE_TYPE (decl), current_function_decl);
#else
real_decl_result
= FUNCTION_VALUE (TREE_TYPE (decl), current_function_decl);
#endif
REG_FUNCTION_VALUE_P (real_decl_result) = 1;
result = real_decl_result;
}
store_expr (decl, result, 0);
emit_insn (gen_rtx (USE, VOIDmode, result));
}
}
#if 0
/* Expand this initialization inline and see if it's simple enough that
it can be done at compile-time. */
static tree
extract_aggr_init (decl, init)
tree decl, init;
{
return 0;
}
static tree
extract_scalar_init (decl, init)
tree decl, init;
{
rtx value, insns, insn;
extern struct obstack temporary_obstack;
tree t = NULL_TREE;
push_obstacks (&temporary_obstack, &temporary_obstack);
start_sequence ();
value = expand_expr (init, NULL_RTX, VOIDmode, 0);
insns = get_insns ();
end_sequence ();
reg_scan (insns, max_reg_num (), 0);
jump_optimize (insns, 0, 0, 1);
pop_obstacks ();
for (insn = insns; insn; insn = NEXT_INSN (insn))
{
rtx r, to;
if (GET_CODE (insn) == NOTE)
continue;
else if (GET_CODE (insn) != INSN)
return 0;
r = PATTERN (insn);
if (GET_CODE (r) != SET)
return 0;
to = XEXP (r, 0);
if (! (to == value
|| (GET_CODE (to) == SUBREG && XEXP (to, 0) == value)))
return 0;
r = XEXP (r, 1);
switch (GET_CODE (r))
{
case CONST_INT:
t = build_int_2 (XEXP (r, 0), 0);
break;
default:
return 0;
}
}
return t;
}
#endif
int
extract_init (decl, init)
tree decl ATTRIBUTE_UNUSED, init ATTRIBUTE_UNUSED;
{
return 0;
#if 0
if (IS_AGGR_TYPE (TREE_TYPE (decl))
|| TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
init = extract_aggr_init (decl, init);
else
init = extract_scalar_init (decl, init);
if (init == NULL_TREE)
return 0;
DECL_INITIAL (decl) = init;
return 1;
#endif
}
void
do_case (start, end)
tree start, end;
{
tree value1 = NULL_TREE, value2 = NULL_TREE, label;
if (start != NULL_TREE && TREE_TYPE (start) != NULL_TREE
&& POINTER_TYPE_P (TREE_TYPE (start)))
error ("pointers are not permitted as case values");
if (end && pedantic)
pedwarn ("ANSI C++ forbids range expressions in switch statement");
if (processing_template_decl)
{
add_tree (build_min_nt (CASE_LABEL, start, end));
return;
}
if (start)
value1 = check_cp_case_value (start);
if (end)
value2 = check_cp_case_value (end);
label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
if (value1 != error_mark_node
&& value2 != error_mark_node)
{
tree duplicate;
int success;
if (end)
success = pushcase_range (value1, value2, convert_and_check,
label, &duplicate);
else if (start)
success = pushcase (value1, convert_and_check, label, &duplicate);
else
success = pushcase (NULL_TREE, 0, label, &duplicate);
if (success == 1)
{
if (end)
error ("case label not within a switch statement");
else if (start)
cp_error ("case label `%E' not within a switch statement", start);
else
error ("default label not within a switch statement");
}
else if (success == 2)
{
if (end)
{
error ("duplicate (or overlapping) case value");
cp_error_at ("this is the first entry overlapping that value",
duplicate);
}
else if (start)
{
cp_error ("duplicate case value `%E'", start);
cp_error_at ("previously used here", duplicate);
}
else
{
error ("multiple default labels in one switch");
cp_error_at ("this is the first default label", duplicate);
}
}
else if (success == 3)
warning ("case value out of range");
else if (success == 4)
warning ("empty range specified");
else if (success == 5)
{
if (end)
error ("case label within scope of cleanup or variable array");
else if (! start)
error ("`default' label within scope of cleanup or variable array");
else
cp_error ("case label `%E' within scope of cleanup or variable array", start);
}
}
define_case_label ();
}

View File

@ -1,490 +0,0 @@
/* Help friends in C++.
Copyright (C) 1997, 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. */
#include "config.h"
#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "cp-tree.h"
#include "flags.h"
#include "output.h"
#include "toplev.h"
static void add_friend PROTO((tree, tree));
static void add_friends PROTO((tree, tree, tree));
/* Friend data structures are described in cp-tree.h. */
int
is_friend (type, supplicant)
tree type, supplicant;
{
int declp;
register tree list;
tree context;
if (supplicant == NULL_TREE || type == NULL_TREE)
return 0;
declp = (TREE_CODE_CLASS (TREE_CODE (supplicant)) == 'd');
if (declp)
/* It's a function decl. */
{
tree list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type));
tree name = DECL_NAME (supplicant);
tree ctype;
if (DECL_FUNCTION_MEMBER_P (supplicant))
ctype = DECL_CLASS_CONTEXT (supplicant);
else
ctype = NULL_TREE;
for (; list ; list = TREE_CHAIN (list))
{
if (name == TREE_PURPOSE (list))
{
tree friends = TREE_VALUE (list);
for (; friends ; friends = TREE_CHAIN (friends))
{
if (same_type_p (ctype, TREE_PURPOSE (friends)))
return 1;
if (TREE_VALUE (friends) == NULL_TREE)
continue;
if (supplicant == TREE_VALUE (friends))
return 1;
/* With -fguiding-decls we are more lenient about
friendship. This is bogus in general since two
specializations of a template with non-type
template parameters may have the same type, but
be different.
Temporarily, we are also more lenient to deal
with nested friend functions, for which there can
be more than one FUNCTION_DECL, despite being the
same function. When that's fixed, the
FUNCTION_MEMBER_P bit can go. */
if ((flag_guiding_decls
|| DECL_FUNCTION_MEMBER_P (supplicant))
&& same_type_p (TREE_TYPE (supplicant),
TREE_TYPE (TREE_VALUE (friends))))
return 1;
if (TREE_CODE (TREE_VALUE (friends)) == TEMPLATE_DECL
&& is_specialization_of (supplicant,
TREE_VALUE (friends)))
return 1;
}
break;
}
}
}
else
/* It's a type. */
{
if (type == supplicant)
return 1;
list = CLASSTYPE_FRIEND_CLASSES (TREE_TYPE (TYPE_MAIN_DECL (type)));
for (; list ; list = TREE_CHAIN (list))
{
tree t = TREE_VALUE (list);
if (TREE_CODE (t) == TEMPLATE_DECL ?
is_specialization_of (TYPE_MAIN_DECL (supplicant), t) :
same_type_p (supplicant, t))
return 1;
}
}
if (declp && DECL_FUNCTION_MEMBER_P (supplicant))
context = DECL_CLASS_CONTEXT (supplicant);
else if (! declp)
/* Local classes have the same access as the enclosing function. */
context = hack_decl_function_context (TYPE_MAIN_DECL (supplicant));
else
context = NULL_TREE;
/* A namespace is not friend to anybody. */
if (context && TREE_CODE (context) == NAMESPACE_DECL)
context = NULL_TREE;
if (context)
return is_friend (type, context);
return 0;
}
/* Add a new friend to the friends of the aggregate type TYPE.
DECL is the FUNCTION_DECL of the friend being added. */
static void
add_friend (type, decl)
tree type, decl;
{
tree typedecl = TYPE_MAIN_DECL (type);
tree list = DECL_FRIENDLIST (typedecl);
tree name = DECL_NAME (decl);
while (list)
{
if (name == TREE_PURPOSE (list))
{
tree friends = TREE_VALUE (list);
for (; friends ; friends = TREE_CHAIN (friends))
{
if (decl == TREE_VALUE (friends))
{
cp_warning ("`%D' is already a friend of class `%T'",
decl, type);
cp_warning_at ("previous friend declaration of `%D'",
TREE_VALUE (friends));
return;
}
}
TREE_VALUE (list) = tree_cons (error_mark_node, decl,
TREE_VALUE (list));
return;
}
list = TREE_CHAIN (list);
}
DECL_FRIENDLIST (typedecl)
= tree_cons (DECL_NAME (decl), build_tree_list (error_mark_node, decl),
DECL_FRIENDLIST (typedecl));
if (DECL_NAME (decl) == ansi_opname[(int) MODIFY_EXPR])
{
tree parmtypes = TYPE_ARG_TYPES (TREE_TYPE (decl));
TYPE_HAS_ASSIGNMENT (TREE_TYPE (typedecl)) = 1;
if (parmtypes && TREE_CHAIN (parmtypes))
{
tree parmtype = TREE_VALUE (TREE_CHAIN (parmtypes));
if (TREE_CODE (parmtype) == REFERENCE_TYPE
&& TREE_TYPE (parmtypes) == TREE_TYPE (typedecl))
TYPE_HAS_ASSIGN_REF (TREE_TYPE (typedecl)) = 1;
}
}
}
/* Declare that every member function NAME in FRIEND_TYPE
(which may be NULL_TREE) is a friend of type TYPE. */
static void
add_friends (type, name, friend_type)
tree type, name, friend_type;
{
tree typedecl = TYPE_MAIN_DECL (type);
tree list = DECL_FRIENDLIST (typedecl);
while (list)
{
if (name == TREE_PURPOSE (list))
{
tree friends = TREE_VALUE (list);
while (friends && TREE_PURPOSE (friends) != friend_type)
friends = TREE_CHAIN (friends);
if (friends)
{
if (friend_type)
warning ("method `%s::%s' is already a friend of class",
TYPE_NAME_STRING (friend_type),
IDENTIFIER_POINTER (name));
else
warning ("function `%s' is already a friend of class `%s'",
IDENTIFIER_POINTER (name),
IDENTIFIER_POINTER (DECL_NAME (typedecl)));
}
else
TREE_VALUE (list) = tree_cons (friend_type, NULL_TREE,
TREE_VALUE (list));
return;
}
list = TREE_CHAIN (list);
}
DECL_FRIENDLIST (typedecl)
= tree_cons (name,
build_tree_list (friend_type, NULL_TREE),
DECL_FRIENDLIST (typedecl));
if (! strncmp (IDENTIFIER_POINTER (name),
IDENTIFIER_POINTER (ansi_opname[(int) MODIFY_EXPR]),
strlen (IDENTIFIER_POINTER (ansi_opname[(int) MODIFY_EXPR]))))
{
TYPE_HAS_ASSIGNMENT (TREE_TYPE (typedecl)) = 1;
sorry ("declaring \"friend operator =\" will not find \"operator = (X&)\" if it exists");
}
}
/* Make FRIEND_TYPE a friend class to TYPE. If FRIEND_TYPE has already
been defined, we make all of its member functions friends of
TYPE. If not, we make it a pending friend, which can later be added
when its definition is seen. If a type is defined, then its TYPE_DECL's
DECL_UNDEFINED_FRIENDS contains a (possibly empty) list of friend
classes that are not defined. If a type has not yet been defined,
then the DECL_WAITING_FRIENDS contains a list of types
waiting to make it their friend. Note that these two can both
be in use at the same time! */
void
make_friend_class (type, friend_type)
tree type, friend_type;
{
tree classes;
int is_template_friend;
if (IS_SIGNATURE (type))
{
error ("`friend' declaration in signature definition");
return;
}
if (IS_SIGNATURE (friend_type) || ! IS_AGGR_TYPE (friend_type))
{
cp_error ("invalid type `%T' declared `friend'", friend_type);
return;
}
if (CLASSTYPE_TEMPLATE_SPECIALIZATION (friend_type)
&& uses_template_parms (friend_type))
{
/* [temp.friend]
Friend declarations shall not declare partial
specializations. */
cp_error ("partial specialization `%T' declared `friend'",
friend_type);
return;
}
if (processing_template_decl > template_class_depth (type))
/* If the TYPE is a template then it makes sense for it to be
friends with itself; this means that each instantiation is
friends with all other instantiations. */
is_template_friend = 1;
else if (same_type_p (type, friend_type))
{
pedwarn ("class `%s' is implicitly friends with itself",
TYPE_NAME_STRING (type));
return;
}
else
is_template_friend = 0;
GNU_xref_hier (type, friend_type, 0, 0, 1);
if (is_template_friend)
friend_type = CLASSTYPE_TI_TEMPLATE (friend_type);
classes = CLASSTYPE_FRIEND_CLASSES (type);
while (classes
/* Stop if we find the same type on the list. */
&& !(TREE_CODE (TREE_VALUE (classes)) == TEMPLATE_DECL ?
friend_type == TREE_VALUE (classes) :
same_type_p (TREE_VALUE (classes), friend_type)))
classes = TREE_CHAIN (classes);
if (classes)
cp_warning ("`%T' is already a friend of `%T'",
TREE_VALUE (classes), type);
else
{
CLASSTYPE_FRIEND_CLASSES (type)
= tree_cons (NULL_TREE, friend_type, CLASSTYPE_FRIEND_CLASSES (type));
}
}
/* Main friend processor. This is large, and for modularity purposes,
has been removed from grokdeclarator. It returns `void_type_node'
to indicate that something happened, though a FIELD_DECL is
not returned.
CTYPE is the class this friend belongs to.
DECLARATOR is the name of the friend.
DECL is the FUNCTION_DECL that the friend is.
In case we are parsing a friend which is part of an inline
definition, we will need to store PARM_DECL chain that comes
with it into the DECL_ARGUMENTS slot of the FUNCTION_DECL.
FLAGS is just used for `grokclassfn'.
QUALS say what special qualifies should apply to the object
pointed to by `this'. */
tree
do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
tree ctype, declarator, decl, parmdecls;
enum overload_flags flags;
tree quals;
int funcdef_flag;
{
int is_friend_template = 0;
/* Every decl that gets here is a friend of something. */
DECL_FRIEND_P (decl) = 1;
if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR)
{
declarator = TREE_OPERAND (declarator, 0);
if (TREE_CODE (declarator) == LOOKUP_EXPR)
declarator = TREE_OPERAND (declarator, 0);
if (is_overloaded_fn (declarator))
declarator = DECL_NAME (get_first_fn (declarator));
}
if (TREE_CODE (decl) == FUNCTION_DECL)
is_friend_template = PROCESSING_REAL_TEMPLATE_DECL_P ();
if (ctype)
{
tree cname = TYPE_NAME (ctype);
if (TREE_CODE (cname) == TYPE_DECL)
cname = DECL_NAME (cname);
/* A method friend. */
if (TREE_CODE (decl) == FUNCTION_DECL)
{
if (flags == NO_SPECIAL && ctype && declarator == cname)
DECL_CONSTRUCTOR_P (decl) = 1;
/* This will set up DECL_ARGUMENTS for us. */
grokclassfn (ctype, decl, flags, quals);
if (is_friend_template)
decl = DECL_TI_TEMPLATE (push_template_decl (decl));
else if (template_class_depth (current_class_type))
decl = push_template_decl_real (decl, /*is_friend=*/1);
/* We can't do lookup in a type that involves template
parameters. Instead, we rely on tsubst_friend_function
to check the validity of the declaration later. */
if (uses_template_parms (ctype))
add_friend (current_class_type, decl);
/* A nested class may declare a member of an enclosing class
to be a friend, so we do lookup here even if CTYPE is in
the process of being defined. */
else if (TYPE_SIZE (ctype) != 0 || TYPE_BEING_DEFINED (ctype))
{
decl = check_classfn (ctype, decl);
if (decl)
add_friend (current_class_type, decl);
}
else
cp_error ("member `%D' declared as friend before type `%T' defined",
decl, ctype);
}
else
{
/* Possibly a bunch of method friends. */
/* Get the class they belong to. */
tree ctype = IDENTIFIER_TYPE_VALUE (cname);
tree fields = lookup_fnfields (TYPE_BINFO (ctype), declarator, 0);
if (fields)
add_friends (current_class_type, declarator, ctype);
else
cp_error ("method `%D' is not a member of class `%T'",
declarator, ctype);
decl = void_type_node;
}
}
/* A global friend.
@@ or possibly a friend from a base class ?!? */
else if (TREE_CODE (decl) == FUNCTION_DECL)
{
/* Friends must all go through the overload machinery,
even though they may not technically be overloaded.
Note that because classes all wind up being top-level
in their scope, their friend wind up in top-level scope as well. */
DECL_ARGUMENTS (decl) = parmdecls;
if (funcdef_flag)
DECL_CLASS_CONTEXT (decl) = current_class_type;
if (! DECL_USE_TEMPLATE (decl))
{
/* We can call pushdecl here, because the TREE_CHAIN of this
FUNCTION_DECL is not needed for other purposes. Don't do
this for a template instantiation. However, we don't
call pushdecl() for a friend function of a template
class, since in general, such a declaration depends on
template parameters. Instead, we call pushdecl when the
class is instantiated. */
if (!is_friend_template
&& template_class_depth (current_class_type) == 0)
decl = pushdecl (decl);
else
decl = push_template_decl_real (decl, /*is_friend=*/1);
if (warn_nontemplate_friend
&& ! funcdef_flag && ! flag_guiding_decls && ! is_friend_template
&& current_template_parms && uses_template_parms (decl))
{
static int explained;
cp_warning ("friend declaration `%#D'", decl);
warning (" declares a non-template function");
if (! explained)
{
warning (" (if this is not what you intended, make sure");
warning (" the function template has already been declared,");
warning (" and add <> after the function name here)");
warning (" -Wno-non-template-friend disables this warning.");
explained = 1;
}
}
}
make_decl_rtl (decl, NULL_PTR, 1);
add_friend (current_class_type,
is_friend_template ? DECL_TI_TEMPLATE (decl) : decl);
DECL_FRIEND_P (decl) = 1;
}
else
{
/* @@ Should be able to ingest later definitions of this function
before use. */
tree decl = lookup_name_nonclass (declarator);
if (decl == NULL_TREE)
{
cp_warning ("implicitly declaring `%T' as struct", declarator);
decl = xref_tag (record_type_node, declarator, 1);
decl = TYPE_MAIN_DECL (decl);
}
/* Allow abbreviated declarations of overloaded functions,
but not if those functions are really class names. */
if (TREE_CODE (decl) == TREE_LIST && TREE_TYPE (TREE_PURPOSE (decl)))
{
cp_warning ("`friend %T' archaic, use `friend class %T' instead",
declarator, declarator);
decl = TREE_TYPE (TREE_PURPOSE (decl));
}
if (TREE_CODE (decl) == TREE_LIST)
add_friends (current_class_type, TREE_PURPOSE (decl), NULL_TREE);
else
make_friend_class (current_class_type, TREE_TYPE (decl));
decl = void_type_node;
}
return decl;
}

View File

@ -1,642 +0,0 @@
.\" Copyright (c) 1991, 1992 Free Software Foundation -*-Text-*-
.\" See section COPYING for conditions for redistribution
.\" FIXME: no info here on predefines. Should there be? extra for C++...
.TH G++ 1 "30apr1993" "GNU Tools" "GNU Tools"
.de BP
.sp
.ti \-.2i
\(**
..
.SH NAME
g++ \- GNU project C++ Compiler
.SH SYNOPSIS
.RB g++ " [" \c
.IR option " | " filename " ].\|.\|.
.SH DESCRIPTION
The C and C++ compilers are integrated;
.B g++
is a script to call
.B gcc with options to recognize C++.
.B gcc
processes input files
through one or more of four stages: preprocessing, compilation,
assembly, and linking. This man page contains full descriptions for
.I only
C++ specific aspects of the compiler, though it also contains
summaries of some general-purpose options. For a fuller explanation
of the compiler, see
.BR gcc ( 1 ).
C++ source files use one of the suffixes `\|\c
.B .C\c
\&\|', `\|\c
.B .cc\c
\&\|', `\|\c
.B .cxx\c
\&\|', `\|\c
.B .cpp\c
\&\|', or `\|\c
.B .c++\c
\&\|'; preprocessed C++ files use the suffix `\|\c
.B .ii\c
\&\|'.
.SH OPTIONS
There are many command-line options, including options to control
details of optimization, warnings, and code generation, which are
common to both
.B gcc
and
.B g++\c
\&. For full information on all options, see
.BR gcc ( 1 ).
Options must be separate: `\|\c
.B \-dr\c
\&\|' is quite different from `\|\c
.B \-d \-r
\&\|'.
Most `\|\c
.B \-f\c
\&\|' and `\|\c
.B \-W\c
\&\|' options have two contrary forms:
.BI \-f name
and
.BI \-fno\- name\c
\& (or
.BI \-W name
and
.BI \-Wno\- name\c
\&). Only the non-default forms are shown here.
.TP
.B \-c
Compile or assemble the source files, but do not link. The compiler
output is an object file corresponding to each source file.
.TP
.BI \-D macro
Define macro \c
.I macro\c
\& with the string `\|\c
.B 1\c
\&\|' as its definition.
.TP
.BI \-D macro = defn
Define macro \c
.I macro\c
\& as \c
.I defn\c
\&.
.TP
.B \-E
Stop after the preprocessing stage; do not run the compiler proper. The
output is preprocessed source code, which is sent to the
standard output.
.TP
.B \-fall\-virtual
Treat all possible member functions as virtual, implicitly. All
member functions (except for constructor functions and
.B new
or
.B delete
member operators) are treated as virtual functions of the class where
they appear.
This does not mean that all calls to these member functions will be
made through the internal table of virtual functions. Under some
circumstances, the compiler can determine that a call to a given
virtual function can be made directly; in these cases the calls are
direct in any case.
.TP
.B \-fdollars\-in\-identifiers
Permit the use of `\|\c
.B $\c
\&\|' in identifiers.
Traditional C allowed the character `\|\c
.B $\c
\&\|' to form part of identifiers; by default, GNU C also
allows this. However, ANSI C forbids `\|\c
.B $\c
\&\|' in identifiers, and GNU C++ also forbids it by default on most
platforms (though on some platforms it's enabled by default for GNU
C++ as well).
.TP
.B \-felide\-constructors
Use this option to instruct the compiler to be smarter about when it can
elide constructors. Without this flag, GNU C++ and cfront both
generate effectively the same code for:
.sp
.br
A\ foo\ ();
.br
A\ x\ (foo\ ());\ \ \ //\ x\ initialized\ by\ `foo\ ()',\ no\ ctor\ called
.br
A\ y\ =\ foo\ ();\ \ \ //\ call\ to\ `foo\ ()'\ heads\ to\ temporary,
.br
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ y\ is\ initialized\ from\ the\ temporary.
.br
.sp
Note the difference! With this flag, GNU C++ initializes `\|\c
.B y\c
\&\|' directly
from the call to
.B foo ()
without going through a temporary.
.TP
.B \-fenum\-int\-equiv
Normally GNU C++ allows conversion of
.B enum
to
.B int\c
\&, but not the other way around. Use this option if you want GNU C++
to allow conversion of
.B int
to
.B enum
as well.
.TP
.B \-fexternal\-templates
Produce smaller code for template declarations, by generating only a
single copy of each template function where it is defined.
To use this option successfully, you must also mark all files that
use templates with either `\|\c
.B #pragma implementation\c
\&\|' (the definition) or
`\|\c
.B #pragma interface\c
\&\|' (declarations).
When your code is compiled with `\|\c
.B \-fexternal\-templates\c
\&\|', all
template instantiations are external. You must arrange for all
necessary instantiations to appear in the implementation file; you can
do this with a \c
.B typedef\c
\& that references each instantiation needed.
Conversely, when you compile using the default option
`\|\c
.B \-fno\-external\-templates\c
\&\|', all template instantiations are
explicitly internal.
.TP
.B \-fno\-gnu\-linker
Do not output global initializations (such as C++ constructors and
destructors) in the form used by the GNU linker (on systems where the GNU
linker is the standard method of handling them). Use this option when
you want to use a non-GNU linker, which also requires using the
.B collect2
program to make sure the system linker includes
constructors and destructors. (\c
.B collect2
is included in the GNU CC distribution.) For systems which
.I must
use
.B collect2\c
\&, the compiler driver
.B gcc
is configured to do this automatically.
.TP
.B \-fmemoize\-lookups
.TP
.B \-fsave\-memoized
These flags are used to get the compiler to compile programs faster
using heuristics. They are not on by default since they are only effective
about half the time. The other half of the time programs compile more
slowly (and take more memory).
The first time the compiler must build a call to a member function (or
reference to a data member), it must (1) determine whether the class
implements member functions of that name; (2) resolve which member
function to call (which involves figuring out what sorts of type
conversions need to be made); and (3) check the visibility of the member
function to the caller. All of this adds up to slower compilation.
Normally, the second time a call is made to that member function (or
reference to that data member), it must go through the same lengthy
process again. This means that code like this
.sp
.br
\ \ cout\ <<\ "This\ "\ <<\ p\ <<\ "\ has\ "\ <<\ n\ <<\ "\ legs.\en";
.br
.sp
makes six passes through all three steps. By using a software cache,
a ``hit'' significantly reduces this cost. Unfortunately, using the
cache introduces another layer of mechanisms which must be implemented,
and so incurs its own overhead. `\|\c
.B \-fmemoize\-lookups\c
\&\|' enables
the software cache.
Because access privileges (visibility) to members and member functions
may differ from one function context to the next,
.B g++
may need to flush the cache. With the `\|\c
.B \-fmemoize\-lookups\c
\&\|' flag, the cache is flushed after every
function that is compiled. The `\|\c
\-fsave\-memoized\c
\&\|' flag enables the same software cache, but when the compiler
determines that the context of the last function compiled would yield
the same access privileges of the next function to compile, it
preserves the cache.
This is most helpful when defining many member functions for the same
class: with the exception of member functions which are friends of
other classes, each member function has exactly the same access
privileges as every other, and the cache need not be flushed.
.TP
.B \-fno\-default\-inline
Do not make member functions inline by default merely because they are
defined inside the class scope. Otherwise, when you specify
.B \-O\c
\&, member functions defined inside class scope are compiled
inline by default; i.e., you don't need to add `\|\c
.B inline\c
\&\|' in front of
the member function name.
.TP
.B \-fno\-strict\-prototype
Consider the declaration \c
.B int foo ();\c
\&. In C++, this means that the
function \c
.B foo\c
\& takes no arguments. In ANSI C, this is declared
.B int foo(void);\c
\&. With the flag `\|\c
.B \-fno\-strict\-prototype\c
\&\|',
declaring functions with no arguments is equivalent to declaring its
argument list to be untyped, i.e., \c
.B int foo ();\c
\& is equivalent to
saying \c
.B int foo (...);\c
\&.
.TP
.B \-fnonnull\-objects
Normally, GNU C++ makes conservative assumptions about objects reached
through references. For example, the compiler must check that `\|\c
.B a\c
\&\|' is not null in code like the following:
.br
\ \ \ \ obj\ &a\ =\ g\ ();
.br
\ \ \ \ a.f\ (2);
.br
Checking that references of this sort have non-null values requires
extra code, however, and it is unnecessary for many programs. You can
use `\|\c
.B \-fnonnull\-objects\c
\&\|' to omit the checks for null, if your program doesn't require the
default checking.
.TP
.B \-fhandle\-signatures
.TP
.B \-fno\-handle\-signatures
These options control the recognition of the \c
.B signature\c
\& and \c
.B sigof\c
\& constructs for specifying abstract types. By default, these
constructs are not recognized.
.TP
.B \-fthis\-is\-variable
The incorporation of user-defined free store management into C++ has
made assignment to \c
.B this\c
\& an anachronism. Therefore, by default GNU
C++ treats the type of \c
.B this\c
\& in a member function of \c
.B class X\c
\&
to be \c
.B X *const\c
\&. In other words, it is illegal to assign to
\c
.B this\c
\& within a class member function. However, for backwards
compatibility, you can invoke the old behavior by using
\&`\|\c
.B \-fthis\-is\-variable\c
\&\|'.
.TP
.B \-g
Produce debugging information in the operating system's native format
(for DBX or SDB or DWARF). GDB also can work with this debugging
information. On most systems that use DBX format, `\|\c
.B \-g\c
\&\|' enables use
of extra debugging information that only GDB can use.
Unlike most other C compilers, GNU CC allows you to use `\|\c
.B \-g\c
\&\|' with
`\|\c
.B \-O\c
\&\|'. The shortcuts taken by optimized code may occasionally
produce surprising results: some variables you declared may not exist
at all; flow of control may briefly move where you did not expect it;
some statements may not be executed because they compute constant
results or their values were already at hand; some statements may
execute in different places because they were moved out of loops.
Nevertheless it proves possible to debug optimized output. This makes
it reasonable to use the optimizer for programs that might have bugs.
.TP
.BI "\-I" "dir"\c
\&
Append directory \c
.I dir\c
\& to the list of directories searched for include files.
.TP
.BI "\-L" "dir"\c
\&
Add directory \c
.I dir\c
\& to the list of directories to be searched
for `\|\c
.B \-l\c
\&\|'.
.TP
.BI \-l library\c
\&
Use the library named \c
.I library\c
\& when linking. (C++ programs often require `\|\c
\-lg++\c
\&\|' for successful linking.)
.TP
.B \-nostdinc
Do not search the standard system directories for header files. Only
the directories you have specified with
.B \-I
options (and the current directory, if appropriate) are searched.
.TP
.B \-nostdinc++
Do not search for header files in the standard directories specific to
C++, but do still search the other standard directories. (This option
is used when building libg++.)
.TP
.B \-O
Optimize. Optimizing compilation takes somewhat more time, and a lot
more memory for a large function.
.TP
.BI "\-o " file\c
\&
Place output in file \c
.I file\c
\&.
.TP
.B \-S
Stop after the stage of compilation proper; do not assemble. The output
is an assembler code file for each non-assembler input
file specified.
.TP
.B \-traditional
Attempt to support some aspects of traditional C compilers.
Specifically, for both C and C++ programs:
.TP
\ \ \ \(bu
In the preprocessor, comments convert to nothing at all, rather than
to a space. This allows traditional token concatenation.
.TP
\ \ \ \(bu
In the preprocessor, macro arguments are recognized within string
constants in a macro definition (and their values are stringified,
though without additional quote marks, when they appear in such a
context). The preprocessor always considers a string constant to end
at a newline.
.TP
\ \ \ \(bu
The preprocessor does not predefine the macro \c
.B __STDC__\c
\& when you use
`\|\c
.B \-traditional\c
\&\|', but still predefines\c
.B __GNUC__\c
\& (since the GNU extensions indicated by
.B __GNUC__\c
\& are not affected by
`\|\c
.B \-traditional\c
\&\|'). If you need to write header files that work
differently depending on whether `\|\c
.B \-traditional\c
\&\|' is in use, by
testing both of these predefined macros you can distinguish four
situations: GNU C, traditional GNU C, other ANSI C compilers, and
other old C compilers.
.PP
.TP
\ \ \ \(bu
String ``constants'' are not necessarily constant; they are stored in
writable space, and identical looking constants are allocated
separately.
For C++ programs only (not C), `\|\c
.B \-traditional\c
\&\|' has one additional effect: assignment to
.B this
is permitted. This is the same as the effect of `\|\c
.B \-fthis\-is\-variable\c
\&\|'.
.TP
.BI \-U macro
Undefine macro \c
.I macro\c
\&.
.TP
.B \-Wall
Issue warnings for conditions which pertain to usage that we recommend
avoiding and that we believe is easy to avoid, even in conjunction
with macros.
.TP
.B \-Wenum\-clash
Warn when converting between different enumeration types.
.TP
.B \-Woverloaded\-virtual
In a derived class, the definitions of virtual functions must match
the type signature of a virtual function declared in the base class.
Use this option to request warnings when a derived class declares a
function that may be an erroneous attempt to define a virtual
function: that is, warn when a function with the same name as a
virtual function in the base class, but with a type signature that
doesn't match any virtual functions from the base class.
.TP
.B \-Wtemplate\-debugging
When using templates in a C++ program, warn if debugging is not yet
fully available.
.TP
.B \-w
Inhibit all warning messages.
.TP
.BI +e N
Control how virtual function definitions are used, in a fashion
compatible with
.B cfront
1.x.
.PP
.SH PRAGMAS
Two `\|\c
.B #pragma\c
\&\|' directives are supported for GNU C++, to permit using the same
header file for two purposes: as a definition of interfaces to a given
object class, and as the full definition of the contents of that object class.
.TP
.B #pragma interface
Use this directive in header files that define object classes, to save
space in most of the object files that use those classes. Normally,
local copies of certain information (backup copies of inline member
functions, debugging information, and the internal tables that
implement virtual functions) must be kept in each object file that
includes class definitions. You can use this pragma to avoid such
duplication. When a header file containing `\|\c
.B #pragma interface\c
\&\|' is included in a compilation, this auxiliary information
will not be generated (unless the main input source file itself uses
`\|\c
.B #pragma implementation\c
\&\|'). Instead, the object files will contain references to be
resolved at link time.
.tr !"
.TP
.B #pragma implementation
.TP
.BI "#pragma implementation !" objects .h!
Use this pragma in a main input file, when you want full output from
included header files to be generated (and made globally visible).
The included header file, in turn, should use `\|\c
.B #pragma interface\c
\&\|'.
Backup copies of inline member functions, debugging information, and
the internal tables used to implement virtual functions are all
generated in implementation files.
If you use `\|\c
.B #pragma implementation\c
\&\|' with no argument, it applies to an include file with the same
basename as your source file; for example, in `\|\c
.B allclass.cc\c
\&\|', `\|\c
.B #pragma implementation\c
\&\|' by itself is equivalent to `\|\c
.B
#pragma implementation "allclass.h"\c
\&\|'. Use the string argument if you want a single implementation
file to include code from multiple header files.
There is no way to split up the contents of a single header file into
multiple implementation files.
.SH FILES
.ta \w'LIBDIR/g++\-include 'u
file.h C header (preprocessor) file
.br
file.i preprocessed C source file
.br
file.C C++ source file
.br
file.cc C++ source file
.br
file.cxx C++ source file
.br
file.s assembly language file
.br
file.o object file
.br
a.out link edited output
.br
\fITMPDIR\fR/cc\(** temporary files
.br
\fILIBDIR\fR/cpp preprocessor
.br
\fILIBDIR\fR/cc1plus compiler
.br
\fILIBDIR\fR/collect linker front end needed on some machines
.br
\fILIBDIR\fR/libgcc.a GCC subroutine library
.br
/lib/crt[01n].o start-up routine
.br
\fILIBDIR\fR/ccrt0 additional start-up routine for C++
.br
/lib/libc.a standard C library, see
.IR intro (3)
.br
/usr/include standard directory for
.B #include
files
.br
\fILIBDIR\fR/include standard gcc directory for
.B #include
files
.br
\fILIBDIR\fR/g++\-include additional g++ directory for
.B #include
.sp
.I LIBDIR
is usually
.B /usr/local/lib/\c
.IR machine / version .
.br
.I TMPDIR
comes from the environment variable
.B TMPDIR
(default
.B /usr/tmp
if available, else
.B /tmp\c
\&).
.SH "SEE ALSO"
gcc(1), cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
.br
.RB "`\|" gcc "\|', `\|" cpp \|',
.RB `\| as \|', `\| ld \|',
and
.RB `\| gdb \|'
entries in
.B info\c
\&.
.br
.I
Using and Porting GNU CC (for version 2.0)\c
, Richard M. Stallman;
.I
The C Preprocessor\c
, Richard M. Stallman;
.I
Debugging with GDB: the GNU Source-Level Debugger\c
, Richard M. Stallman and Roland H. Pesch;
.I
Using as: the GNU Assembler\c
, Dean Elsner, Jay Fenlason & friends;
.I
gld: the GNU linker\c
, Steve Chamberlain and Roland Pesch.
.SH BUGS
For instructions on how to report bugs, see the GCC manual.
.SH COPYING
Copyright (c) 1991, 1992, 1993 Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
.PP
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
.PP
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
.SH AUTHORS
See the GNU CC Manual for the contributors to GNU CC.

File diff suppressed because it is too large Load Diff

View File

@ -1,266 +0,0 @@
/* Specific flags and argument handling of the C++ front-end.
Copyright (C) 1996, 1997, 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. */
#include "config.h"
#include "system.h"
/* This bit is set if we saw a `-xfoo' language specification. */
#define LANGSPEC (1<<1)
/* This bit is set if they did `-lm' or `-lmath'. */
#define MATHLIB (1<<2)
/* This bit is set if they did `-lc'. */
#define WITHLIBC (1<<3)
#ifndef MATH_LIBRARY
#define MATH_LIBRARY "-lm"
#endif
#ifndef LIBSTDCXX
#define LIBSTDCXX "-lstdc++"
#endif
void
lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
void (*fn)();
int *in_argc;
char ***in_argv;
int *in_added_libraries;
{
int i, j;
/* If non-zero, the user gave us the `-v' flag. */
int saw_verbose_flag = 0;
/* This will be 0 if we encounter a situation where we should not
link in libstdc++. */
int library = 1;
/* The number of arguments being added to what's in argv, other than
libraries. We use this to track the number of times we've inserted
-xc++/-xnone. */
int added = 2;
/* Used to track options that take arguments, so we don't go wrapping
those with -xc++/-xnone. */
char *quote = NULL;
/* The new argument list will be contained in this. */
char **arglist;
/* Non-zero if we saw a `-xfoo' language specification on the
command line. Used to avoid adding our own -xc++ if the user
already gave a language for the file. */
int saw_speclang = 0;
/* "-lm" or "-lmath" if it appears on the command line. */
char *saw_math = 0;
/* "-lc" if it appears on the command line. */
char *saw_libc = 0;
/* An array used to flag each argument that needs a bit set for
LANGSPEC, MATHLIB, or WITHLIBC. */
int *args;
/* By default, we throw on the math library if we have one. */
int need_math = (MATH_LIBRARY[0] != '\0');
/* The total number of arguments with the new stuff. */
int argc;
/* The argument list. */
char **argv;
/* The number of libraries added in. */
int added_libraries;
/* The total number of arguments with the new stuff. */
int num_args = 1;
argc = *in_argc;
argv = *in_argv;
added_libraries = *in_added_libraries;
args = (int *) xmalloc (argc * sizeof (int));
bzero ((char *) args, argc * sizeof (int));
for (i = 1; i < argc; i++)
{
/* If the previous option took an argument, we swallow it here. */
if (quote)
{
quote = NULL;
continue;
}
/* We don't do this anymore, since we don't get them with minus
signs on them. */
if (argv[i][0] == '\0' || argv[i][1] == '\0')
continue;
if (argv[i][0] == '-')
{
if (library != 0 && (strcmp (argv[i], "-nostdlib") == 0
|| strcmp (argv[i], "-nodefaultlibs") == 0))
{
library = 0;
}
else if (strcmp (argv[i], "-lm") == 0
|| strcmp (argv[i], "-lmath") == 0
|| strcmp (argv[i], MATH_LIBRARY) == 0
#ifdef ALT_LIBM
|| strcmp (argv[i], ALT_LIBM) == 0
#endif
)
{
args[i] |= MATHLIB;
need_math = 0;
}
else if (strcmp (argv[i], "-lc") == 0)
args[i] |= WITHLIBC;
else if (strcmp (argv[i], "-v") == 0)
{
saw_verbose_flag = 1;
if (argc == 2)
{
/* If they only gave us `-v', don't try to link
in libg++. */
library = 0;
}
}
else if (strncmp (argv[i], "-x", 2) == 0)
saw_speclang = 1;
else if (((argv[i][2] == '\0'
&& (char *)strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL)
|| strcmp (argv[i], "-Tdata") == 0))
quote = argv[i];
else if (library != 0 && ((argv[i][2] == '\0'
&& (char *) strchr ("cSEM", argv[i][1]) != NULL)
|| strcmp (argv[i], "-MM") == 0))
{
/* Don't specify libraries if we won't link, since that would
cause a warning. */
library = 0;
added -= 2;
}
else
/* Pass other options through. */
continue;
}
else
{
int len;
if (saw_speclang)
{
saw_speclang = 0;
continue;
}
/* If the filename ends in .c or .i, put options around it.
But not if a specified -x option is currently active. */
len = strlen (argv[i]);
if (len > 2
&& (argv[i][len - 1] == 'c' || argv[i][len - 1] == 'i')
&& argv[i][len - 2] == '.')
{
args[i] |= LANGSPEC;
added += 2;
}
}
}
if (quote)
(*fn) ("argument to `%s' missing\n", quote);
/* If we know we don't have to do anything, bail now. */
if (! added && ! library)
{
free (args);
return;
}
num_args = argc + added + need_math;
arglist = (char **) xmalloc (num_args * sizeof (char *));
/* NOTE: We start at 1 now, not 0. */
for (i = 0, j = 0; i < argc; i++, j++)
{
arglist[j] = argv[i];
/* Make sure -lstdc++ is before the math library, since libstdc++
itself uses those math routines. */
if (!saw_math && (args[i] & MATHLIB) && library)
{
--j;
saw_math = argv[i];
}
if (!saw_libc && (args[i] & WITHLIBC) && library)
{
--j;
saw_libc = argv[i];
}
/* Wrap foo.c and foo.i files in a language specification to
force the gcc compiler driver to run cc1plus on them. */
if (args[i] & LANGSPEC)
{
int len = strlen (argv[i]);
if (argv[i][len - 1] == 'i')
arglist[j++] = "-xc++-cpp-output";
else
arglist[j++] = "-xc++";
arglist[j++] = argv[i];
arglist[j] = "-xnone";
}
}
/* Add `-lstdc++' if we haven't already done so. */
if (library)
{
arglist[j++] = LIBSTDCXX;
added_libraries++;
}
if (saw_math)
arglist[j++] = saw_math;
else if (library && need_math)
{
arglist[j++] = MATH_LIBRARY;
added_libraries++;
}
if (saw_libc)
arglist[j++] = saw_libc;
arglist[j] = NULL;
*in_argc = j;
*in_argv = arglist;
*in_added_libraries = added_libraries;
}
/* Called before linking. Returns 0 on success and -1 on failure. */
int lang_specific_pre_link () /* Not used for C++. */
{
return 0;
}
/* Number of extra output files that lang_specific_pre_link may generate. */
int lang_specific_extra_outfiles = 0; /* Not used for C++. */

View File

@ -1,111 +0,0 @@
%{
/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf */
%}
struct resword { char *name; short token; enum rid rid;};
%%
__alignof, ALIGNOF, NORID
__alignof__, ALIGNOF, NORID
__asm, ASM_KEYWORD, NORID
__asm__, ASM_KEYWORD, NORID
__attribute, ATTRIBUTE, NORID
__attribute__, ATTRIBUTE, NORID
__complex, TYPESPEC, RID_COMPLEX
__complex__, TYPESPEC, RID_COMPLEX
__const, CV_QUALIFIER, RID_CONST
__const__, CV_QUALIFIER, RID_CONST
__extension__, EXTENSION, NORID
__imag, IMAGPART, NORID
__imag__, IMAGPART, NORID
__inline, SCSPEC, RID_INLINE
__inline__, SCSPEC, RID_INLINE
__label__, LABEL, NORID
__null, CONSTANT, RID_NULL
__real, REALPART, NORID
__real__, REALPART, NORID
__restrict, CV_QUALIFIER, RID_RESTRICT
__restrict__, CV_QUALIFIER, RID_RESTRICT
__signature__, AGGR, RID_SIGNATURE /* Extension */,
__signed, TYPESPEC, RID_SIGNED
__signed__, TYPESPEC, RID_SIGNED
__sigof__, SIGOF, NORID /* Extension */,
__typeof, TYPEOF, NORID
__typeof__, TYPEOF, NORID
__volatile, CV_QUALIFIER, RID_VOLATILE
__volatile__, CV_QUALIFIER, RID_VOLATILE
__wchar_t, TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,
asm, ASM_KEYWORD, NORID,
and, ANDAND, NORID,
and_eq, ASSIGN, NORID,
auto, SCSPEC, RID_AUTO,
bitand, '&', NORID,
bitor, '|', NORID,
bool, TYPESPEC, RID_BOOL,
break, BREAK, NORID,
case, CASE, NORID,
catch, CATCH, NORID,
char, TYPESPEC, RID_CHAR,
class, AGGR, RID_CLASS,
compl, '~', NORID,
const, CV_QUALIFIER, RID_CONST,
const_cast, CONST_CAST, NORID,
continue, CONTINUE, NORID,
default, DEFAULT, NORID,
delete, DELETE, NORID,
do, DO, NORID,
double, TYPESPEC, RID_DOUBLE,
dynamic_cast, DYNAMIC_CAST, NORID,
else, ELSE, NORID,
enum, ENUM, NORID,
explicit, SCSPEC, RID_EXPLICIT,
export, SCSPEC, RID_EXPORT,
extern, SCSPEC, RID_EXTERN,
false, CXX_FALSE, NORID,
float, TYPESPEC, RID_FLOAT,
for, FOR, NORID,
friend, SCSPEC, RID_FRIEND,
goto, GOTO, NORID,
if, IF, NORID,
inline, SCSPEC, RID_INLINE,
int, TYPESPEC, RID_INT,
long, TYPESPEC, RID_LONG,
mutable, SCSPEC, RID_MUTABLE,
namespace, NAMESPACE, NORID,
new, NEW, NORID,
not, '!', NORID,
not_eq, EQCOMPARE, NORID,
operator, OPERATOR, NORID,
or, OROR, NORID,
or_eq, ASSIGN, NORID,
private, VISSPEC, RID_PRIVATE,
protected, VISSPEC, RID_PROTECTED,
public, VISSPEC, RID_PUBLIC,
register, SCSPEC, RID_REGISTER,
reinterpret_cast, REINTERPRET_CAST, NORID,
return, RETURN, NORID,
short, TYPESPEC, RID_SHORT,
signature, AGGR, RID_SIGNATURE /* Extension */,
signed, TYPESPEC, RID_SIGNED,
sigof, SIGOF, NORID /* Extension */,
sizeof, SIZEOF, NORID,
static, SCSPEC, RID_STATIC,
static_cast, STATIC_CAST, NORID,
struct, AGGR, RID_RECORD,
switch, SWITCH, NORID,
template, TEMPLATE, RID_TEMPLATE,
this, THIS, NORID,
throw, THROW, NORID,
true, CXX_TRUE, NORID,
try, TRY, NORID,
typedef, SCSPEC, RID_TYPEDEF,
typename, TYPENAME_KEYWORD, NORID,
typeid, TYPEID, NORID,
typeof, TYPEOF, NORID,
union, AGGR, RID_UNION,
unsigned, TYPESPEC, RID_UNSIGNED,
using, USING, NORID,
virtual, SCSPEC, RID_VIRTUAL,
void, TYPESPEC, RID_VOID,
volatile, CV_QUALIFIER, RID_VOLATILE,
while, WHILE, NORID,
xor, '^', NORID,
xor_eq, ASSIGN, NORID,

File diff suppressed because it is too large Load Diff

View File

@ -1,231 +0,0 @@
/* KR-C code produced by gperf version 2.7.1 (19981006 egcs) */
/* Command-line: gperf -L KR-C -F , 0, 0 -p -j1 -g -o -t -N is_reserved_word -k1,4,7,$ ../../../gcc/cp/gxx.gperf */
/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf */
struct resword { char *name; short token; enum rid rid;};
#define TOTAL_KEYWORDS 106
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 16
#define MIN_HASH_VALUE 4
#define MAX_HASH_VALUE 250
/* maximum key range = 247, duplicates = 0 */
static inline unsigned int
hash (str, len)
register char *str;
register unsigned int len;
{
static unsigned char asso_values[] =
{
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 0, 251, 64, 93, 3,
0, 0, 74, 35, 0, 26, 251, 2, 31, 65,
23, 76, 7, 19, 45, 37, 6, 64, 12, 38,
14, 4, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251
};
register int hval = len;
switch (hval)
{
default:
case 7:
hval += asso_values[(unsigned char)str[6]];
case 6:
case 5:
case 4:
hval += asso_values[(unsigned char)str[3]];
case 3:
case 2:
case 1:
hval += asso_values[(unsigned char)str[0]];
break;
}
return hval + asso_values[(unsigned char)str[len - 1]];
}
static inline struct resword *
is_reserved_word (str, len)
register char *str;
register unsigned int len;
{
static struct resword wordlist[] =
{
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"else", ELSE, NORID,},
{"", 0, 0},
{"delete", DELETE, NORID,},
{"case", CASE, NORID,},
{"__real__", REALPART, NORID},
{"", 0, 0},
{"true", CXX_TRUE, NORID,},
{"catch", CATCH, NORID,},
{"typeid", TYPEID, NORID,},
{"try", TRY, NORID,},
{"", 0, 0}, {"", 0, 0},
{"void", TYPESPEC, RID_VOID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"private", VISSPEC, RID_PRIVATE,},
{"template", TEMPLATE, RID_TEMPLATE,},
{"protected", VISSPEC, RID_PROTECTED,},
{"extern", SCSPEC, RID_EXTERN,},
{"", 0, 0}, {"", 0, 0},
{"not", '!', NORID,},
{"", 0, 0},
{"__signed", TYPESPEC, RID_SIGNED},
{"int", TYPESPEC, RID_INT,},
{"__signed__", TYPESPEC, RID_SIGNED},
{"__real", REALPART, NORID},
{"", 0, 0},
{"xor_eq", ASSIGN, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"__attribute", ATTRIBUTE, NORID},
{"__asm__", ASM_KEYWORD, NORID},
{"__attribute__", ATTRIBUTE, NORID},
{"compl", '~', NORID,},
{"public", VISSPEC, RID_PUBLIC,},
{"not_eq", EQCOMPARE, NORID,},
{"switch", SWITCH, NORID,},
{"__extension__", EXTENSION, NORID},
{"const", CV_QUALIFIER, RID_CONST,},
{"static", SCSPEC, RID_STATIC,},
{"", 0, 0},
{"__inline", SCSPEC, RID_INLINE},
{"", 0, 0},
{"__inline__", SCSPEC, RID_INLINE},
{"__restrict__", CV_QUALIFIER, RID_RESTRICT},
{"inline", SCSPEC, RID_INLINE,},
{"const_cast", CONST_CAST, NORID,},
{"static_cast", STATIC_CAST, NORID,},
{"__restrict", CV_QUALIFIER, RID_RESTRICT},
{"xor", '^', NORID,},
{"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,},
{"new", NEW, NORID,},
{"__alignof__", ALIGNOF, NORID},
{"signed", TYPESPEC, RID_SIGNED,},
{"and", ANDAND, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"explicit", SCSPEC, RID_EXPLICIT,},
{"", 0, 0},
{"__imag__", IMAGPART, NORID},
{"while", WHILE, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"do", DO, NORID,},
{"typename", TYPENAME_KEYWORD, NORID,},
{"friend", SCSPEC, RID_FRIEND,},
{"continue", CONTINUE, NORID,},
{"class", AGGR, RID_CLASS,},
{"default", DEFAULT, NORID,},
{"this", THIS, NORID,},
{"dynamic_cast", DYNAMIC_CAST, NORID,},
{"typeof", TYPEOF, NORID,},
{"virtual", SCSPEC, RID_VIRTUAL,},
{"export", SCSPEC, RID_EXPORT,},
{"and_eq", ASSIGN, NORID,},
{"__typeof__", TYPEOF, NORID},
{"__const__", CV_QUALIFIER, RID_CONST},
{"__volatile", CV_QUALIFIER, RID_VOLATILE},
{"short", TYPESPEC, RID_SHORT,},
{"__volatile__", CV_QUALIFIER, RID_VOLATILE},
{"__const", CV_QUALIFIER, RID_CONST},
{"namespace", NAMESPACE, NORID,},
{"char", TYPESPEC, RID_CHAR,},
{"unsigned", TYPESPEC, RID_UNSIGNED,},
{"double", TYPESPEC, RID_DOUBLE,},
{"or_eq", ASSIGN, NORID,},
{"__null", CONSTANT, RID_NULL},
{"if", IF, NORID,},
{"__signature__", AGGR, RID_SIGNATURE /* Extension */,},
{"__label__", LABEL, NORID},
{"long", TYPESPEC, RID_LONG,},
{"__imag", IMAGPART, NORID},
{"__asm", ASM_KEYWORD, NORID},
{"", 0, 0},
{"__sigof__", SIGOF, NORID /* Extension */,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"struct", AGGR, RID_RECORD,},
{"", 0, 0},
{"volatile", CV_QUALIFIER, RID_VOLATILE,},
{"false", CXX_FALSE, NORID,},
{"sizeof", SIZEOF, NORID,},
{"__complex__", TYPESPEC, RID_COMPLEX},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"for", FOR, NORID,},
{"or", OROR, NORID,},
{"register", SCSPEC, RID_REGISTER,},
{"throw", THROW, NORID,},
{"", 0, 0},
{"using", USING, NORID,},
{"", 0, 0}, {"", 0, 0},
{"__complex", TYPESPEC, RID_COMPLEX},
{"", 0, 0},
{"asm", ASM_KEYWORD, NORID,},
{"signature", AGGR, RID_SIGNATURE /* Extension */,},
{"enum", ENUM, NORID,},
{"reinterpret_cast", REINTERPRET_CAST, NORID,},
{"mutable", SCSPEC, RID_MUTABLE,},
{"__alignof", ALIGNOF, NORID},
{"return", RETURN, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0},
{"float", TYPESPEC, RID_FLOAT,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"bool", TYPESPEC, RID_BOOL,},
{"", 0, 0},
{"typedef", SCSPEC, RID_TYPEDEF,},
{"__typeof", TYPEOF, NORID},
{"bitand", '&', NORID,},
{"break", BREAK, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"union", AGGR, RID_UNION,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"goto", GOTO, NORID,},
{"sigof", SIGOF, NORID /* Extension */,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"bitor", '|', NORID,},
{"auto", SCSPEC, RID_AUTO,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0},
{"operator", OPERATOR, NORID,}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register char *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
}
}
return 0;
}

View File

@ -1,39 +0,0 @@
// Exception Handling support header for -*- C++ -*-
// Copyright (C) 1995, 96-97, 1998 Free Software Foundation
#ifndef __EXCEPTION__
#define __EXCEPTION__
#pragma interface "exception"
extern "C++" {
namespace std {
class exception {
public:
exception () { }
virtual ~exception () { }
virtual const char* what () const;
};
class bad_exception : public exception {
public:
bad_exception () { }
virtual ~bad_exception () { }
};
typedef void (*terminate_handler) ();
typedef void (*unexpected_handler) ();
terminate_handler set_terminate (terminate_handler);
void terminate () __attribute__ ((__noreturn__));
unexpected_handler set_unexpected (unexpected_handler);
void unexpected () __attribute__ ((__noreturn__));
bool uncaught_exception ();
} // namespace std
} // extern "C++"
#endif

View File

@ -1,60 +0,0 @@
/* CYGNUS LOCAL Embedded C++ whole file */
// The -*- C++ -*- dynamic memory management header.
// Copyright (C) 1994, 96-97, 1998 Free Software Foundation
#ifndef __NEW__
#define __NEW__
#pragma interface "new"
#include <stddef.h>
#ifndef __EMBEDDED_CXX__
// Exception Handling is forbidden in Embedded C++.
#include <exception>
#define __GCC_THROW(what) throw (what)
#define __GCC_nothing
#else
#define __GCC_THROW(what)
#endif
extern "C++" {
namespace std {
#ifndef __EMBEDDED_CXX__
class bad_alloc : public exception {
public:
virtual const char* what() const throw() { return "bad_alloc"; }
};
#endif
struct nothrow_t {};
extern const nothrow_t nothrow;
typedef void (*new_handler)();
new_handler set_new_handler (new_handler);
} // namespace std
// replaceable signatures
void *operator new (size_t) __GCC_THROW (std::bad_alloc);
void *operator new[] (size_t) __GCC_THROW (std::bad_alloc);
void operator delete (void *) __GCC_THROW(__GCC_nothing);
void operator delete[] (void *) __GCC_THROW(__GCC_nothing);
void *operator new (size_t, const nothrow_t&) __GCC_THROW(__GCC_nothing);
void *operator new[] (size_t, const nothrow_t&) __GCC_THROW(__GCC_nothing);
void operator delete (void *, const nothrow_t&) __GCC_THROW(__GCC_nothing);
void operator delete[] (void *, const nothrow_t&) __GCC_THROW(__GCC_nothing);
// default placement versions of operator new
inline void *operator new(size_t, void *place) __GCC_THROW(__GCC_nothing) {
return place;
}
inline void *operator new[](size_t, void *place) __GCC_THROW(__GCC_nothing) {
return place;
}
} // extern "C++"
#endif
/* END CYGNUS LOCAL */

View File

@ -1,11 +0,0 @@
// -*- C++ -*- forwarding header.
#ifndef __NEW_H__
#define __NEW_H__
#include <new>
using std::new_handler;
using std::set_new_handler;
#endif // __NEW_H__

View File

@ -1,58 +0,0 @@
// RTTI support for -*- C++ -*-
// Copyright (C) 1994, 95-97, 1998 Free Software Foundation
#ifndef __TYPEINFO__
#define __TYPEINFO__
#pragma interface "typeinfo"
#include <exception>
extern "C++" {
namespace std {
class type_info {
private:
// assigning type_info is not supported. made private.
type_info& operator= (const type_info&);
type_info (const type_info&);
protected:
explicit type_info (const char *n): _name (n) { }
const char *_name;
public:
// destructor
virtual ~type_info ();
bool before (const type_info& arg) const;
const char* name () const
{ return _name; }
bool operator== (const type_info& arg) const;
bool operator!= (const type_info& arg) const;
};
inline bool type_info::
operator!= (const type_info& arg) const
{
return !operator== (arg);
}
class bad_cast : public exception {
public:
bad_cast() { }
virtual ~bad_cast() { }
};
class bad_typeid : public exception {
public:
bad_typeid () { }
virtual ~bad_typeid () { }
};
} // namespace std
} // extern "C++"
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,213 +0,0 @@
/* Input handling for G++.
Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc.
Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing.
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. */
/* G++ needs to do enough saving and re-parsing of text that it is
necessary to abandon the simple FILE* model and use a mechanism where
we can pre-empt one input stream with another derived from saved text;
we may need to do this arbitrarily often, and cannot depend on having
the GNU library available, so FILE objects just don't cut it.
This file is written as a separate module, but can be included by
lex.c for very minor efficiency gains (primarily in function
inlining). */
#include "system.h"
extern FILE *finput;
struct input_source {
/* saved string */
char *str;
int length;
/* current position, when reading as input */
int offset;
/* linked list maintenance */
struct input_source *next;
/* values to restore after reading all of current string */
char *filename;
int lineno;
struct pending_input *input;
int putback_char;
};
static struct input_source *input, *free_inputs;
extern char *input_filename;
extern int lineno;
#ifdef __GNUC__
#define inline __inline__
#else
#define inline
#endif
#if USE_CPPLIB
extern unsigned char *yy_cur, *yy_lim;
extern int yy_get_token ();
#define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
#else
#define GETC() getc (finput)
#endif
extern void feed_input PROTO((char *, int));
extern void put_input PROTO((int));
extern void put_back PROTO((int));
extern int getch PROTO((void));
extern int input_redirected PROTO((void));
static inline struct input_source * allocate_input PROTO((void));
static inline void free_input PROTO((struct input_source *));
static inline void end_input PROTO((void));
static inline int sub_getch PROTO((void));
static inline struct input_source *
allocate_input ()
{
struct input_source *inp;
if (free_inputs)
{
inp = free_inputs;
free_inputs = inp->next;
inp->next = 0;
return inp;
}
inp = (struct input_source *) xmalloc (sizeof (struct input_source));
inp->next = 0;
return inp;
}
static inline void
free_input (inp)
struct input_source *inp;
{
inp->str = 0;
inp->length = 0;
inp->next = free_inputs;
free_inputs = inp;
}
static int putback_char = -1;
/* Some of these external functions are declared inline in case this file
is included in lex.c. */
inline
void
feed_input (str, len)
char *str;
int len;
{
struct input_source *inp = allocate_input ();
/* This shouldn't be necessary. */
while (len && !str[len-1])
len--;
inp->str = str;
inp->length = len;
inp->offset = 0;
inp->next = input;
inp->filename = input_filename;
inp->lineno = lineno;
inp->input = save_pending_input ();
inp->putback_char = putback_char;
putback_char = -1;
input = inp;
}
struct pending_input *to_be_restored; /* XXX */
extern int end_of_file;
static inline void
end_input ()
{
struct input_source *inp = input;
end_of_file = 0;
input = inp->next;
input_filename = inp->filename;
lineno = inp->lineno;
/* Get interface/implementation back in sync. */
extract_interface_info ();
putback_char = inp->putback_char;
restore_pending_input (inp->input);
free_input (inp);
}
static inline int
sub_getch ()
{
if (putback_char != -1)
{
int ch = putback_char;
putback_char = -1;
return ch;
}
if (input)
{
if (input->offset >= input->length)
{
my_friendly_assert (putback_char == -1, 223);
++(input->offset);
if (input->offset - input->length < 64)
return EOF;
/* We must be stuck in an error-handling rule; give up. */
end_input ();
return getch ();
}
return (unsigned char)input->str[input->offset++];
}
return GETC ();
}
inline
void
put_back (ch)
int ch;
{
if (ch != EOF)
{
my_friendly_assert (putback_char == -1, 224);
putback_char = ch;
}
}
extern int linemode;
int
getch ()
{
int ch = sub_getch ();
if (linemode && ch == '\n')
{
put_back (ch);
ch = EOF;
}
return ch;
}
inline
int
input_redirected ()
{
return input != 0;
}

View File

@ -1,137 +0,0 @@
/* Definitions for switches for C++.
Copyright (C) 1995, 96-97, 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. */
DEFINE_LANG_NAME ("C++")
/* This is the contribution to the `lang_options' array in gcc.c for
g++. */
{ "-faccess-control", "" },
{ "-fno-access-control", "Do not obey access control semantics" },
{ "-fall-virtual", "Make all member functions virtual" },
{ "-fno-all-virtual", "" },
{ "-falt-external-templates", "Change when template instances are emitted" },
{ "-fno-alt-external-templates", "" },
{ "-fansi-overloading", "" },
{ "-fno-ansi-overloading", "" },
{ "-fcheck-new", "Check the return value of new" },
{ "-fno-check-new", "" },
{ "-fconserve-space", "Reduce size of object files" },
{ "-fno-conserve-space", "" },
{ "-fconst-strings", "" },
{ "-fno-const-strings", "Make string literals `char[]' instead of `const char[]'" },
{ "-fdefault-inline", "" },
{ "-fno-default-inline", "Do not inline member functions by default"},
{ "-frtti", "" },
{ "-fno-rtti", "Do not generate run time type descriptor information" },
{ "-felide-constructors", "" },
{ "-fno-elide-constructors", "" },
/* CYGNUS LOCAL Embedded C++ */
{ "-fembedded-cxx", "Implement Embedded C++ specification" },
{ "-fno-embedded-cxx", "" },
/* END CYGNUS LOCAL Embedded C++ */
{ "-fenum-int-equiv", "" },
{ "-fno-enum-int-equiv", "" },
{ "-fexternal-templates", "" },
{ "-fno-external-templates", "" },
{ "-ffor-scope", "" },
{ "-fno-for-scope", "Scope of for-init-statement vars extends outside" },
{ "-fguiding-decls", "Implement guiding declarations" },
{ "-fno-guiding-decls", "" },
{ "-fgnu-keywords", "" },
{ "-fno-gnu-keywords", "Do not recognise GNU defined keywords" },
{ "-fhandle-exceptions", "" },
{ "-fno-handle-exceptions", "" },
{ "-fhandle-signatures", "Handle signature language constructs" },
{ "-fno-handle-signatures", "" },
{ "-fhonor-std", "Treat the namespace `std' as a normal namespace" },
{ "-fno-honor-std", "" },
{ "-fhuge-objects", "Enable support for huge objects" },
{ "-fno-huge-objects", "" },
{ "-fimplement-inlines", "" },
{ "-fno-implement-inlines", "Export functions even if they can be inlined" },
{ "-fimplicit-templates", "" },
{ "-fno-implicit-templates", "Only emit explicit template instatiations" },
{ "-fimplicit-inline-templates", "" },
{ "-fno-implicit-inline-templates", "Only emit explicit instatiations of inline templates" },
{ "-finit-priority", "Handle the init_priority attribute" },
{ "-fno-init-priority", "" },
{ "-flabels-ok", "Labels can be used as first class objects" },
{ "-fno-labels-ok", "" },
{ "-fmemoize-lookups", "" },
{ "-fno-memoize-lookups", "" },
{ "-fname-mangling-version-", "" },
{ "-fnew-abi", "Enable experimental ABI changes" },
{ "-fno-new-abi", "" },
{ "-fnonnull-objects", "" },
{ "-fno-nonnull-objects", "Do not assume that a reference is always valid" },
{ "-foperator-names", "Recognise and/bitand/bitor/compl/not/or/xor" },
{ "-fno-operator-names", "" },
{ "-foptional-diags", "" },
{ "-fno-optional-diags", "Disable optional diagnostics" },
{ "-fpermissive", "Downgrade conformance errors to warnings" },
{ "-fno-permissive", "" },
{ "-frepo", "Enable automatic template instantiation" },
{ "-fno-repo", "" },
{ "-fsave-memoized", "" },
{ "-fno-save-memoized", "" },
{ "-fsquangle", "Enable squashed name mangling" },
{ "-fno-squangle", "" },
{ "-fstats", "Display statistics accumulated during compilation" },
{ "-fno-stats", "" },
{ "-fstrict-prototype", "" },
{ "-fno-strict-prototype", "Do not assume that empty prototype means no args" },
{ "-ftemplate-depth-", "Specify maximum template instantiation depth"},
{ "-fthis-is-variable", "Make 'this' not be type '* const'" },
{ "-fno-this-is-variable", "" },
{ "-fvtable-gc", "Discard unused virtual functions" },
{ "-fno-vtable-gc", "" },
{ "-fvtable-thunks", "Implement vtables using thunks" },
{ "-fno-vtable-thunks", "" },
{ "-fweak", "Emit common-like symbols as weak symbols" },
{ "-fno-weak", "" },
{ "-fxref", "Emit cross referencing information" },
{ "-fno-xref", "" },
{ "-Wreturn-type", "Warn about inconsistent return types" },
{ "-Wno-return-type", "" },
{ "-Woverloaded-virtual", "Warn about overloaded virtual function names" },
{ "-Wno-overloaded-virtual", "" },
{ "-Wctor-dtor-privacy", "" },
{ "-Wno-ctor-dtor-privacy", "Don't warn when all ctors/dtors are private" },
{ "-Wnon-virtual-dtor", "Warn about non virtual destructors" },
{ "-Wno-non-virtual-dtor", "" },
{ "-Wextern-inline", "Warn when a function is declared extern, then inline" },
{ "-Wno-extern-inline", "" },
{ "-Wreorder", "Warn when the compiler reorders code" },
{ "-Wno-reorder", "" },
{ "-Wsynth", "Warn when synthesis behaviour differs from Cfront" },
{ "-Wno-synth", "" },
{ "-Wpmf-conversions", "" },
{ "-Wno-pmf-conversions", "Don't warn when type converting pointers to member functions" },
{ "-Weffc++", "Warn about violations of Effective C++ style rules" },
{ "-Wno-effc++", "" },
{ "-Wsign-promo", "Warn when overload promotes from unsigned to signed" },
{ "-Wno-sign-promo", "" },
{ "-Wold-style-cast", "Warn if a C style cast is used in a program" },
{ "-Wno-old-style-cast", "" },
{ "-Wnon-template-friend", "" },
{ "-Wno-non-template-friend", "Don't warn when non-templatized friend functions are declared within a template" },

View File

@ -1,99 +0,0 @@
/* Definitions for specs for C++.
Copyright (C) 1995, 96-97, 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 `default_compilers' array in gcc.c for
g++. */
{".cc", {"@c++"}},
{".cp", {"@c++"}},
{".cxx", {"@c++"}},
{".cpp", {"@c++"}},
{".c++", {"@c++"}},
{".C", {"@c++"}},
{"@c++",
#if USE_CPPLIB
/* CYGNUS LOCAL Embedded C++ */
{
"%{E|M|MM:cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C++ does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
-undef -D__GNUC__=%v1 -D__GNUG__=%v1 -D__cplusplus -D__GNUC_MINOR__=%v2\
%{ansi:-trigraphs -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
%{!fno-exceptions:-D__EXCEPTIONS}\
%{fembedded-cxx:-D__EMBEDDED_CXX__} \
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{trigraphs}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n}\
%{!E:%{!M:%{!MM:cc1plus %i %1 %2\
-lang-c++ %{nostdinc*} %{C} %{A*} %{I*} %{P} %I\
%{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
-undef -D__GNUC__=%v1 -D__GNUG__=%v1 -D__cplusplus\
-D__GNUC_MINOR__=%v2\
%{ansi:-trigraphs -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
%{!fno-exceptions:-D__EXCEPTIONS}\
%{fembedded-cxx:-D__EMBEDDED_CXX__} \
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{trigraphs}\
%{!Q:-quiet} -dumpbase %b.cc %{d*} %{m*} %{a}\
%{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi}\
%{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%{v:-version} %{pg:-p} %{p}\
%{f*} %{+e*} %{aux-info*}\
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}}|\n\
%{!S:as %a %Y\
%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
%{!pipe:%g.s} %A\n }}}}"}},
/* END CYGNUS LOCAL Embedded C++ */
#else /* ! USE_CPPLIB */
/* CYGNUS LOCAL Embedded C++ */
{"cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C++ does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
-undef -D__GNUC__=%v1 -D__GNUG__=%v1 -D__cplusplus -D__GNUC_MINOR__=%v2\
%{ansi:-trigraphs -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
%{!fno-exceptions:-D__EXCEPTIONS}\
%{fembedded-cxx:-D__EMBEDDED_CXX__} \
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{trigraphs}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{!M:%{!MM:%{!E:%{!pipe:%g.ii}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
/* END CYGNUS LOCAL Embedded C++ */
"%{!M:%{!MM:%{!E:cc1plus %{!pipe:%g.ii} %1 %2\
%{!Q:-quiet} -dumpbase %b.cc %{d*} %{m*} %{a}\
%{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi}\
%{v:-version} %{pg:-p} %{p}\
%{f*} %{+e*} %{aux-info*}\
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}}|\n\
%{!S:as %a %Y\
%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
%{!pipe:%g.s} %A\n }}}}"}},
#endif /* ! USE_CPPLIB */
{".ii", {"@c++-cpp-output"}},
{"@c++-cpp-output",
{"%{!M:%{!MM:%{!E:cc1plus %i %1 %2 %{!Q:-quiet} %{d*} %{m*} %{a}\
%{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi}\
%{v:-version} %{pg:-p} %{p}\
%{f*} %{+e*} %{aux-info*}\
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
%{!S:as %a %Y\
%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
%{!pipe:%g.s} %A\n }}}}"}},

File diff suppressed because it is too large Load Diff

View File

@ -1,137 +0,0 @@
/* Define constants and variables for communication with parse.y.
Copyright (C) 1987, 92-97, 1998 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
and by Brendan Kehoe (brendan@cygnus.com).
This file is part of GNU CC.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the GNU CC General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
GNU CC, but only under the conditions described in the
GNU CC General Public License. A copy of this license is
supposed to have been given to you along with GNU CC so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
enum rid
{
RID_UNUSED,
RID_INT,
RID_BOOL,
RID_CHAR,
RID_WCHAR,
RID_FLOAT,
RID_DOUBLE,
RID_VOID,
/* C++ extension */
RID_CLASS,
RID_RECORD,
RID_UNION,
RID_ENUM,
RID_LONGLONG,
/* This is where grokdeclarator starts its search when setting the specbits.
The first seven are in the order of most frequently used, as found
building libg++. */
RID_EXTERN,
RID_CONST,
RID_LONG,
RID_TYPEDEF,
RID_UNSIGNED,
RID_SHORT,
RID_INLINE,
RID_STATIC,
RID_REGISTER,
RID_VOLATILE,
RID_FRIEND,
RID_VIRTUAL,
RID_EXPLICIT,
RID_EXPORT,
RID_SIGNED,
RID_AUTO,
RID_MUTABLE,
RID_COMPLEX,
RID_RESTRICT,
/* This is where grokdeclarator ends its search when setting the
specbits. */
RID_PUBLIC,
RID_PRIVATE,
RID_PROTECTED,
RID_EXCEPTION,
RID_TEMPLATE,
RID_SIGNATURE,
RID_NULL,
/* Before adding enough to get up to 64, the RIDBIT_* macros
will have to be changed a little. */
RID_MAX
};
#define NORID RID_UNUSED
#define RID_FIRST_MODIFIER RID_EXTERN
#define RID_LAST_MODIFIER RID_COMPLEX
/* The type that can represent all values of RIDBIT. */
/* We assume that we can stick in at least 32 bits into this. */
typedef struct { unsigned long idata[2]; }
RID_BIT_TYPE;
/* Be careful, all these modify N twice. */
#define RIDBIT_SETP(N, V) (((unsigned long)1 << (int) ((N)%32)) \
& (V).idata[(N)/32])
#define RIDBIT_NOTSETP(NN, VV) (! RIDBIT_SETP (NN, VV))
#define RIDBIT_SET(N, V) do { \
(V).idata[(N)/32] \
|= ((unsigned long)1 << (int) ((N)%32)); \
} while (0)
#define RIDBIT_RESET(N, V) do { \
(V).idata[(N)/32] \
&= ~((unsigned long)1 << (int) ((N)%32)); \
} while (0)
#define RIDBIT_RESET_ALL(V) do { \
(V).idata[0] = 0; \
(V).idata[1] = 0; \
} while (0)
#define RIDBIT_ANY_SET(V) ((V).idata[0] || (V).idata[1])
/* 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];
/* the declaration found for the last IDENTIFIER token read in.
yylex must look this up to detect typedefs, which get token type TYPENAME,
so it is left around in case the identifier is not a typedef but is
used in a context which makes it a reference to a variable. */
extern tree lastiddecl;
extern char *token_buffer; /* Pointer to token buffer. */
/* Back-door communication channel to the lexer. */
extern int looking_for_typename;
extern int looking_for_template;
/* Tell the lexer where to look for names. */
extern tree got_scope;
extern tree got_object;
/* Pending language change.
Positive is push count, negative is pop count. */
extern int pending_lang_change;
extern int yylex PROTO((void));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +0,0 @@
// Implementation file for the -*- C++ -*- dynamic memory management header.
// Copyright (C) 1996, 1997, 1998 Free Software Foundation
// 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.
// As a special exception, if you link this library with other files,
// some of which are compiled with GCC, to produce an executable,
// this library does not by itself cause the resulting executable
// to be covered by the GNU General Public License.
// This exception does not however invalidate any other reasons why
// the executable file might be covered by the GNU General Public License.
#pragma implementation "new"
#include "new"
/* CYGNUS LOCAL embedded c++ */
#ifndef __EMBEDDED_CXX__
const std::nothrow_t std::nothrow = { };
#endif
/* END CYGNUS LOCAL */
using std::new_handler;
new_handler __new_handler;
new_handler
set_new_handler (new_handler handler)
{
new_handler prev_handler = __new_handler;
__new_handler = handler;
return prev_handler;
}

View File

@ -1,99 +0,0 @@
// Support routines for the -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999 Free Software Foundation
// 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.
// As a special exception, if you link this library with other files,
// some of which are compiled with GCC, to produce an executable,
// this library does not by itself cause the resulting executable
// to be covered by the GNU General Public License.
// This exception does not however invalidate any other reasons why
// the executable file might be covered by the GNU General Public License.
#include "new"
using std::new_handler;
using std::bad_alloc;
extern "C" void *malloc (size_t);
extern new_handler __new_handler;
#define WEAK(x) \
x __attribute__ ((weak)); \
x
#ifdef L_op_newnt
WEAK (void * operator new (size_t sz, const std::nothrow_t&) __GCC_THROW(__GCC_nothing))
{
void *p;
/* malloc (0) is unpredictable; avoid it. */
if (sz == 0)
sz = 1;
p = (void *) malloc (sz);
while (p == 0)
{
new_handler handler = __new_handler;
if (! handler)
return 0;
/* CYGNUS LOCAL embedded C++ */
#ifdef __EMBEDDED_CXX__
handler ();
#else
try
{
handler ();
}
catch (bad_alloc &)
{
return 0;
}
#endif
/* END CYGNUS LOCAL */
p = (void *) malloc (sz);
}
return p;
}
#endif
#ifdef L_op_new
WEAK (void * operator new (size_t sz) __GCC_THROW (std::bad_alloc))
{
void *p;
/* malloc (0) is unpredictable; avoid it. */
if (sz == 0)
sz = 1;
p = (void *) malloc (sz);
while (p == 0)
{
new_handler handler = __new_handler;
/* CYGNUS LOCAL embedded C++ */
#ifndef __EMBEDDED_CXX__
if (! handler)
throw bad_alloc ();
#endif
/* END CYGNUS LOCAL */
handler ();
p = (void *) malloc (sz);
}
return p;
}
#endif

View File

@ -1,80 +0,0 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999 Free Software Foundation
// 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.
// As a special exception, if you link this library with other files,
// some of which are compiled with GCC, to produce an executable,
// this library does not by itself cause the resulting executable
// to be covered by the GNU General Public License.
// This exception does not however invalidate any other reasons why
// the executable file might be covered by the GNU General Public License.
#include "new"
extern "C" void free (void *);
#define WEAK(x) \
x __attribute__ ((weak)); \
x
#ifdef L_op_vnew
WEAK(void * operator new[] (size_t sz) __GCC_THROW (std::bad_alloc))
{
return ::operator new(sz);
}
#endif
#ifdef L_op_vnewnt
WEAK(void *operator new[] (size_t sz, const std::nothrow_t& nothrow) __GCC_THROW(__GCC_nothing))
{
return ::operator new(sz, nothrow);
}
#endif
#ifdef L_op_delete
WEAK (void operator delete (void *ptr) __GCC_THROW (__GCC_nothing))
{
if (ptr)
free (ptr);
}
#endif
#ifdef L_op_vdel
WEAK (void operator delete[] (void *ptr) __GCC_THROW (__GCC_nothing))
{
if (ptr)
free (ptr);
}
#endif
#ifdef L_op_delnt
WEAK (void operator delete (void *ptr, const std::nothrow_t&) __GCC_THROW (__GCC_nothing))
{
if (ptr)
free (ptr);
}
#endif
#ifdef L_op_vdelnt
WEAK (void operator delete[] (void *ptr, const std::nothrow_t&) __GCC_THROW (__GCC_nothing))
{
if (ptr)
free (ptr);
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,140 +0,0 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program 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.
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, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#define IDENTIFIER 258
#define TYPENAME 259
#define SELFNAME 260
#define PFUNCNAME 261
#define SCSPEC 262
#define TYPESPEC 263
#define CV_QUALIFIER 264
#define CONSTANT 265
#define STRING 266
#define ELLIPSIS 267
#define SIZEOF 268
#define ENUM 269
#define IF 270
#define ELSE 271
#define WHILE 272
#define DO 273
#define FOR 274
#define SWITCH 275
#define CASE 276
#define DEFAULT 277
#define BREAK 278
#define CONTINUE 279
#define RETURN 280
#define GOTO 281
#define ASM_KEYWORD 282
#define TYPEOF 283
#define ALIGNOF 284
#define SIGOF 285
#define ATTRIBUTE 286
#define EXTENSION 287
#define LABEL 288
#define REALPART 289
#define IMAGPART 290
#define AGGR 291
#define VISSPEC 292
#define DELETE 293
#define NEW 294
#define THIS 295
#define OPERATOR 296
#define CXX_TRUE 297
#define CXX_FALSE 298
#define NAMESPACE 299
#define TYPENAME_KEYWORD 300
#define USING 301
#define LEFT_RIGHT 302
#define TEMPLATE 303
#define TYPEID 304
#define DYNAMIC_CAST 305
#define STATIC_CAST 306
#define REINTERPRET_CAST 307
#define CONST_CAST 308
#define SCOPE 309
#define EMPTY 310
#define NSNAME 311
#define PTYPENAME 312
#define THROW 313
#define ASSIGN 314
#define OROR 315
#define ANDAND 316
#define MIN_MAX 317
#define EQCOMPARE 318
#define ARITHCOMPARE 319
#define RSHIFT 320
#define LSHIFT 321
#define DOT_STAR 322
#define POINTSAT_STAR 323
#define MINUSMINUS 324
#define PLUSPLUS 325
#define UNARY 326
#define HYPERUNARY 327
#define PAREN_STAR_PAREN 328
#define POINTSAT 329
#define CATCH 330
#define TRY 331
#define PRE_PARSED_FUNCTION_DECL 332
#define EXTERN_LANG_STRING 333
#define ALL 334
#define PRE_PARSED_CLASS_DECL 335
#define DEFARG 336
#define DEFARG_MARKER 337
#define TYPENAME_DEFN 338
#define IDENTIFIER_DEFN 339
#define PTYPENAME_DEFN 340
#define END_OF_LINE 341
#define END_OF_SAVED_INPUT 342
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 92 "../../../gbagnu/gcc/cp/parse.y"
{long itype; tree ttype; char *strtype; enum tree_code code; flagged_type_tree ftype; }
/* Line 1489 of yacc.c. */
#line 225 "parse.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE yylval;
#define YYEMPTY (-2)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,192 +0,0 @@
/* Prints out trees in human readable form.
Copyright (C) 1992, 93-96, 1998 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
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 "cp-tree.h"
void
print_lang_decl (file, node, indent)
FILE *file;
tree node;
int indent;
{
if (!DECL_LANG_SPECIFIC (node))
return;
/* A FIELD_DECL only has the flags structure, which we aren't displaying
anyways. */
if (DECL_MUTABLE_P (node))
{
indent_to (file, indent + 3);
fprintf (file, " mutable ");
}
if (TREE_CODE (node) == FIELD_DECL)
return;
indent_to (file, indent + 3);
if (DECL_MAIN_VARIANT (node))
{
fprintf (file, " decl-main-variant ");
fprintf (file, HOST_PTR_PRINTF, DECL_MAIN_VARIANT (node));
}
if (DECL_PENDING_INLINE_INFO (node))
{
fprintf (file, " pending-inline-info ");
fprintf (file, HOST_PTR_PRINTF, DECL_PENDING_INLINE_INFO (node));
}
if (DECL_TEMPLATE_INFO (node))
{
fprintf (file, " template-info ");
fprintf (file, HOST_PTR_PRINTF, DECL_TEMPLATE_INFO (node));
}
}
void
print_lang_type (file, node, indent)
FILE *file;
register tree node;
int indent;
{
if (TREE_CODE (node) == TEMPLATE_TYPE_PARM
|| TREE_CODE (node) == TEMPLATE_TEMPLATE_PARM)
{
indent_to (file, indent + 3);
fputs ("index ", file);
fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_IDX (node));
fputs (" level ", file);
fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_LEVEL (node));
fputs (" orig_level ", file);
fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_ORIG_LEVEL (node));
return;
}
if (! (TREE_CODE (node) == RECORD_TYPE
|| TREE_CODE (node) == UNION_TYPE))
return;
if (!TYPE_LANG_SPECIFIC (node))
return;
indent_to (file, indent + 3);
if (TYPE_NEEDS_CONSTRUCTING (node))
fputs ( "needs-constructor", file);
if (TYPE_NEEDS_DESTRUCTOR (node))
fputs (" needs-destructor", file);
if (TYPE_HAS_DESTRUCTOR (node))
fputs (" ~X()", file);
if (TYPE_HAS_DEFAULT_CONSTRUCTOR (node))
fputs (" X()", file);
if (TYPE_HAS_CONVERSION (node))
fputs (" has-type-conversion", file);
if (TYPE_HAS_INIT_REF (node))
{
if (TYPE_HAS_CONST_INIT_REF (node))
fputs (" X(constX&)", file);
else
fputs (" X(X&)", file);
}
if (TYPE_GETS_NEW (node) & 1)
fputs (" new", file);
if (TYPE_GETS_NEW (node) & 2)
fputs (" new[]", file);
if (TYPE_GETS_DELETE (node) & 1)
fputs (" delete", file);
if (TYPE_GETS_DELETE (node) & 2)
fputs (" delete[]", file);
if (TYPE_HAS_ASSIGNMENT (node))
fputs (" has=", file);
if (TYPE_HAS_ASSIGN_REF (node))
fputs (" this=(X&)", file);
if (TYPE_OVERLOADS_CALL_EXPR (node))
fputs (" op()", file);
if (TYPE_OVERLOADS_ARRAY_REF (node))
fputs (" op[]", file);
if (TYPE_OVERLOADS_ARROW (node))
fputs (" op->", file);
if (TYPE_USES_MULTIPLE_INHERITANCE (node))
fputs (" uses-multiple-inheritance", file);
if (TREE_CODE (node) == RECORD_TYPE)
{
fprintf (file, " n_parents %d n_ancestors %d",
CLASSTYPE_N_BASECLASSES (node),
CLASSTYPE_N_SUPERCLASSES (node));
fprintf (file, " use_template=%d", CLASSTYPE_USE_TEMPLATE (node));
if (CLASSTYPE_INTERFACE_ONLY (node))
fprintf (file, " interface-only");
if (CLASSTYPE_INTERFACE_UNKNOWN (node))
fprintf (file, " interface-unknown");
print_node (file, "member-functions", CLASSTYPE_METHOD_VEC (node),
indent + 4);
print_node (file, "baselinks",
TYPE_BINFO_BASETYPES (node) ? CLASSTYPE_BASELINK_VEC (node) : NULL_TREE,
indent + 4);
}
}
void
print_lang_identifier (file, node, indent)
FILE *file;
tree node;
int indent;
{
print_node (file, "bindings", IDENTIFIER_NAMESPACE_BINDINGS (node), indent + 4);
print_node (file, "class", IDENTIFIER_CLASS_VALUE (node), indent + 4);
print_node (file, "local bindings", IDENTIFIER_BINDING (node), indent + 4);
print_node (file, "label", IDENTIFIER_LABEL_VALUE (node), indent + 4);
print_node (file, "template", IDENTIFIER_TEMPLATE (node), indent + 4);
print_node (file, "implicit", IDENTIFIER_IMPLICIT_DECL (node), indent + 4);
print_node (file, "error locus", IDENTIFIER_ERROR_LOCUS (node), indent + 4);
}
void
lang_print_xnode (file, node, indent)
FILE *file;
tree node;
int indent;
{
switch (TREE_CODE (node))
{
case CPLUS_BINDING:
fprintf (file, " scope ");
fprintf (file, HOST_PTR_PRINTF, BINDING_SCOPE (node));
print_node (file, "value", BINDING_VALUE (node), indent+4);
print_node (file, "chain", TREE_CHAIN (node), indent+4);
break;
case OVERLOAD:
print_node (file, "function", OVL_FUNCTION (node), indent+4);
print_node (file, "chain", TREE_CHAIN (node), indent+4);
break;
case TEMPLATE_PARM_INDEX:
indent_to (file, indent + 3);
fputs ("index ", file);
fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_PARM_IDX (node));
fputs (" level ", file);
fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_PARM_LEVEL (node));
fputs (" orig_level ", file);
fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_PARM_ORIG_LEVEL (node));
break;
default:
break;
}
}

View File

@ -1,447 +0,0 @@
/* Code to maintain a C++ template repository.
Copyright (C) 1995, 96-97, 1998 Free Software Foundation, Inc.
Contributed by Jason Merrill (jason@cygnus.com)
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. */
/* My strategy here is as follows:
Everything should be emitted in a translation unit where it is used.
The results of the automatic process should be easily reproducible with
explicit code. */
#include "config.h"
#include "system.h"
#include "tree.h"
#include "cp-tree.h"
#include "input.h"
#include "obstack.h"
#include "toplev.h"
extern char *getpwd PROTO((void));
static tree repo_get_id PROTO((tree));
static char *extract_string PROTO((char **));
static char *get_base_filename PROTO((char *));
static void open_repo_file PROTO((char *));
static char *afgets PROTO((FILE *));
static void reopen_repo_file_for_write PROTO((void));
static tree pending_repo;
static tree original_repo;
static char *repo_name;
static FILE *repo_file;
static char *old_args, *old_dir, *old_main;
extern int flag_use_repository;
extern int errorcount, sorrycount;
extern struct obstack temporary_obstack;
extern struct obstack permanent_obstack;
#define IDENTIFIER_REPO_USED(NODE) (TREE_LANG_FLAG_3 (NODE))
#define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_4 (NODE))
#if 0
/* Record the flags used to compile this translation unit. */
void
repo_compile_flags (argc, argv)
int argc;
char **argv;
{
}
/* If this template has not been seen before, add a note to the repository
saying where the declaration was. This may be used to find the
definition at link time. */
void
repo_template_declared (t)
tree t;
{}
/* Note where the definition of a template lives so that instantiations can
be generated later. */
void
repo_template_defined (t)
tree t;
{}
/* Note where the definition of a class lives to that template
instantiations can use it. */
void
repo_class_defined (t)
tree t;
{}
#endif
static tree
repo_get_id (t)
tree t;
{
if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
{
/* If we're not done setting up the class, we may not have set up
the vtable, so going ahead would give the wrong answer.
See g++.pt/instantiate4.C. */
if (TYPE_SIZE (t) == NULL_TREE || TYPE_BEING_DEFINED (t))
my_friendly_abort (981113);
t = TYPE_BINFO_VTABLE (t);
if (t == NULL_TREE)
return t;
}
return DECL_ASSEMBLER_NAME (t);
}
/* Note that a template has been used. If we can see the definition, offer
to emit it. */
void
repo_template_used (t)
tree t;
{
tree id;
if (! flag_use_repository)
return;
id = repo_get_id (t);
if (id == NULL_TREE)
return;
if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
{
if (IDENTIFIER_REPO_CHOSEN (id))
mark_class_instantiated (t, 0);
}
else if (TREE_CODE_CLASS (TREE_CODE (t)) == 'd')
{
if (IDENTIFIER_REPO_CHOSEN (id))
mark_decl_instantiated (t, 0);
}
else
my_friendly_abort (1);
if (! IDENTIFIER_REPO_USED (id))
{
IDENTIFIER_REPO_USED (id) = 1;
pending_repo = perm_tree_cons (NULL_TREE, id, pending_repo);
}
}
#if 0
/* Note that the vtable for a class has been used, and offer to emit it. */
static void
repo_vtable_used (t)
tree t;
{
if (! flag_use_repository)
return;
pending_repo = perm_tree_cons (NULL_TREE, t, pending_repo);
}
/* Note that an inline with external linkage has been used, and offer to
emit it. */
void
repo_inline_used (fn)
tree fn;
{
if (! flag_use_repository)
return;
/* Member functions of polymorphic classes go with their vtables. */
if (DECL_FUNCTION_MEMBER_P (fn) && TYPE_VIRTUAL_P (DECL_CLASS_CONTEXT (fn)))
{
repo_vtable_used (DECL_CLASS_CONTEXT (fn));
return;
}
pending_repo = perm_tree_cons (NULL_TREE, fn, pending_repo);
}
/* Note that a particular typeinfo node has been used, and offer to
emit it. */
void
repo_tinfo_used (ti)
tree ti;
{
}
#endif
void
repo_template_instantiated (t, extern_p)
tree t;
int extern_p;
{
if (! extern_p)
{
tree id = repo_get_id (t);
if (id)
IDENTIFIER_REPO_CHOSEN (id) = 1;
}
}
/* Parse a reasonable subset of shell quoting syntax. */
static char *
extract_string (pp)
char **pp;
{
char *p = *pp;
int backquote = 0;
int inside = 0;
for (;;)
{
char c = *p;
if (c == '\0')
break;
++p;
if (backquote)
obstack_1grow (&temporary_obstack, c);
else if (! inside && c == ' ')
break;
else if (! inside && c == '\\')
backquote = 1;
else if (c == '\'')
inside = !inside;
else
obstack_1grow (&temporary_obstack, c);
}
obstack_1grow (&temporary_obstack, '\0');
*pp = p;
return obstack_finish (&temporary_obstack);
}
static char *
get_base_filename (filename)
char *filename;
{
char *p = getenv ("COLLECT_GCC_OPTIONS");
char *output = NULL;
int compiling = 0;
while (p && *p)
{
char *q = extract_string (&p);
if (strcmp (q, "-o") == 0)
output = extract_string (&p);
else if (strcmp (q, "-c") == 0)
compiling = 1;
}
if (compiling && output)
return output;
if (p && ! compiling)
{
warning ("-frepo must be used with -c");
flag_use_repository = 0;
return NULL;
}
return file_name_nondirectory (filename);
}
static void
open_repo_file (filename)
char *filename;
{
register char *p;
char *s = get_base_filename (filename);
if (s == NULL)
return;
p = file_name_nondirectory (s);
p = rindex (p, '.');
if (! p)
p = s + strlen (s);
obstack_grow (&permanent_obstack, s, p - s);
repo_name = obstack_copy0 (&permanent_obstack, ".rpo", 4);
repo_file = fopen (repo_name, "r");
}
static char *
afgets (stream)
FILE *stream;
{
int c;
while ((c = getc (stream)) != EOF && c != '\n')
obstack_1grow (&temporary_obstack, c);
if (obstack_object_size (&temporary_obstack) == 0)
return NULL;
obstack_1grow (&temporary_obstack, '\0');
return obstack_finish (&temporary_obstack);
}
void
init_repo (filename)
char *filename;
{
char *buf;
if (! flag_use_repository)
return;
open_repo_file (filename);
if (repo_file == 0)
return;
while ((buf = afgets (repo_file)))
{
switch (buf[0])
{
case 'A':
old_args = obstack_copy0 (&permanent_obstack, buf + 2,
strlen (buf + 2));
break;
case 'D':
old_dir = obstack_copy0 (&permanent_obstack, buf + 2,
strlen (buf + 2));
break;
case 'M':
old_main = obstack_copy0 (&permanent_obstack, buf + 2,
strlen (buf + 2));
break;
case 'C':
case 'O':
{
tree id = get_identifier (buf + 2);
tree orig;
if (buf[0] == 'C')
{
IDENTIFIER_REPO_CHOSEN (id) = 1;
orig = integer_one_node;
}
else
orig = NULL_TREE;
original_repo = perm_tree_cons (orig, id, original_repo);
}
break;
default:
error ("mysterious repository information in %s", repo_name);
}
obstack_free (&temporary_obstack, buf);
}
}
static void
reopen_repo_file_for_write ()
{
if (repo_file)
fclose (repo_file);
repo_file = fopen (repo_name, "w");
if (repo_file == 0)
{
error ("can't create repository information file `%s'", repo_name);
flag_use_repository = 0;
}
}
/* Emit any pending repos. */
void
finish_repo ()
{
tree t;
int repo_changed = 0;
char *dir, *args;
if (! flag_use_repository)
return;
/* Do we have to write out a new info file? */
/* Are there any old templates that aren't used any longer or that are
newly chosen? */
for (t = original_repo; t; t = TREE_CHAIN (t))
{
if (! IDENTIFIER_REPO_USED (TREE_VALUE (t))
|| (! TREE_PURPOSE (t) && IDENTIFIER_REPO_CHOSEN (TREE_VALUE (t))))
{
repo_changed = 1;
break;
}
IDENTIFIER_REPO_USED (TREE_VALUE (t)) = 0;
}
/* Are there any templates that are newly used? */
if (! repo_changed)
for (t = pending_repo; t; t = TREE_CHAIN (t))
{
if (IDENTIFIER_REPO_USED (TREE_VALUE (t)))
{
repo_changed = 1;
break;
}
}
dir = getpwd ();
args = getenv ("COLLECT_GCC_OPTIONS");
if (! repo_changed && pending_repo)
if (strcmp (old_main, main_input_filename) != 0
|| strcmp (old_dir, dir) != 0
|| (args == NULL) != (old_args == NULL)
|| (args && strcmp (old_args, args) != 0))
repo_changed = 1;
if (! repo_changed || errorcount || sorrycount)
goto out;
reopen_repo_file_for_write ();
if (repo_file == 0)
goto out;
fprintf (repo_file, "M %s\n", main_input_filename);
fprintf (repo_file, "D %s\n", dir);
if (args)
fprintf (repo_file, "A %s\n", args);
for (t = pending_repo; t; t = TREE_CHAIN (t))
{
tree val = TREE_VALUE (t);
char type = IDENTIFIER_REPO_CHOSEN (val) ? 'C' : 'O';
fprintf (repo_file, "%c %s\n", type, IDENTIFIER_POINTER (val));
}
out:
if (repo_file)
fclose (repo_file);
}

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

File diff suppressed because it is too large Load Diff

View File

@ -1,489 +0,0 @@
/* Type Analyzer for GNU C++.
Copyright (C) 1987, 89, 92-97, 1998 Free Software Foundation, Inc.
Hacked... nay, bludgeoned... by Mark Eichin (eichin@cygnus.com)
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 is the type analyzer for GNU C++. To debug it, define SPEW_DEBUG
when compiling parse.c and spew.c. */
#include "config.h"
#include "system.h"
#include "input.h"
#include "tree.h"
#include "lex.h"
#include "cp-tree.h"
#include "parse.h"
#include "flags.h"
#include "obstack.h"
#include "toplev.h"
/* This takes a token stream that hasn't decided much about types and
tries to figure out as much as it can, with excessive lookahead and
backtracking. */
/* fifo of tokens recognized and available to parser. */
struct token {
/* The values for YYCHAR will fit in a short. */
short yychar;
short end_of_file;
YYSTYPE yylval;
};
static int do_aggr PROTO((void));
static int probe_obstack PROTO((struct obstack *, tree, unsigned int));
static void scan_tokens PROTO((unsigned int));
#ifdef SPEW_DEBUG
static int num_tokens PROTO((void));
static struct token *nth_token PROTO((int));
static void add_token PROTO((struct token *));
static void consume_token PROTO((void));
static int debug_yychar PROTO((int));
#endif
/* From lex.c: */
/* the declaration found for the last IDENTIFIER token read in.
yylex must look this up to detect typedefs, which get token type TYPENAME,
so it is left around in case the identifier is not a typedef but is
used in a context which makes it a reference to a variable. */
extern tree lastiddecl; /* let our brains leak out here too */
extern int yychar; /* the lookahead symbol */
extern YYSTYPE yylval; /* the semantic value of the */
/* lookahead symbol */
extern int end_of_file;
struct obstack token_obstack;
int first_token;
#ifdef SPEW_DEBUG
int spew_debug = 0;
static unsigned int yylex_ctr = 0;
static int debug_yychar ();
#endif
/* Initialize token_obstack. Called once, from init_parse. */
void
init_spew ()
{
gcc_obstack_init (&token_obstack);
}
#ifdef SPEW_DEBUG
/* Use functions for debugging... */
/* Return the number of tokens available on the fifo. */
static int
num_tokens ()
{
return (obstack_object_size (&token_obstack) / sizeof (struct token))
- first_token;
}
/* Fetch the token N down the line from the head of the fifo. */
static struct token*
nth_token (n)
int n;
{
/* could just have this do slurp_ implicitly, but this way is easier
to debug... */
my_friendly_assert (n < num_tokens (), 298);
return ((struct token*)obstack_base (&token_obstack)) + n + first_token;
}
/* Add a token to the token fifo. */
static void
add_token (t)
struct token* t;
{
obstack_grow (&token_obstack, t, sizeof (struct token));
}
/* Consume the next token out of the fifo. */
static void
consume_token ()
{
if (num_tokens () == 1)
{
obstack_free (&token_obstack, obstack_base (&token_obstack));
first_token = 0;
}
else
first_token++;
}
#else
/* ...otherwise use macros. */
#define num_tokens() \
((obstack_object_size (&token_obstack) / sizeof (struct token)) - first_token)
#define nth_token(N) \
(((struct token*)obstack_base (&token_obstack))+(N)+first_token)
#define add_token(T) obstack_grow (&token_obstack, (T), sizeof (struct token))
#define consume_token() \
(num_tokens () == 1 \
? (obstack_free (&token_obstack, obstack_base (&token_obstack)), \
(first_token = 0)) \
: first_token++)
#endif
/* Pull in enough tokens from real_yylex that the queue is N long beyond
the current token. */
static void
scan_tokens (n)
unsigned int n;
{
unsigned int i;
struct token *tmp;
/* We cannot read past certain tokens, so make sure we don't. */
i = num_tokens ();
if (i > n)
return;
while (i-- > 0)
{
tmp = nth_token (i);
/* Never read past these characters: they might separate
the current input stream from one we save away later. */
if (tmp->yychar == '{' || tmp->yychar == ':' || tmp->yychar == ';')
goto pad_tokens;
}
while (num_tokens () <= n)
{
obstack_blank (&token_obstack, sizeof (struct token));
tmp = ((struct token *)obstack_next_free (&token_obstack))-1;
tmp->yychar = real_yylex ();
tmp->end_of_file = end_of_file;
tmp->yylval = yylval;
end_of_file = 0;
if (tmp->yychar == '{'
|| tmp->yychar == ':'
|| tmp->yychar == ';')
{
pad_tokens:
while (num_tokens () <= n)
{
obstack_blank (&token_obstack, sizeof (struct token));
tmp = ((struct token *)obstack_next_free (&token_obstack))-1;
tmp->yychar = EMPTY;
tmp->end_of_file = 0;
}
}
}
}
/* Like _obstack_allocated_p, but stop after checking NLEVELS chunks. */
static int
probe_obstack (h, obj, nlevels)
struct obstack *h;
tree obj;
unsigned int nlevels;
{
register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk* plp; /* point to previous chunk if any */
lp = (h)->chunk;
/* We use >= rather than > since the object cannot be exactly at
the beginning of the chunk but might be an empty object exactly
at the end of an adjacent chunk. */
for (; nlevels != 0 && lp != 0 && ((tree)lp >= obj || (tree)lp->limit < obj);
nlevels -= 1)
{
plp = lp->prev;
lp = plp;
}
return nlevels != 0 && lp != 0;
}
/* from lex.c: */
/* Value is 1 (or 2) if we should try to make the next identifier look like
a typename (when it may be a local variable or a class variable).
Value is 0 if we treat this name in a default fashion. */
extern int looking_for_typename;
int looking_for_template;
extern int do_snarf_defarg;
extern struct obstack *current_obstack, *saveable_obstack;
tree got_scope;
tree got_object;
int
peekyylex ()
{
scan_tokens (0);
return nth_token (0)->yychar;
}
int
yylex ()
{
struct token tmp_token;
tree trrr = NULL_TREE;
int old_looking_for_typename = 0;
retry:
#ifdef SPEW_DEBUG
if (spew_debug)
{
yylex_ctr ++;
fprintf (stderr, "\t\t## %d ##", yylex_ctr);
}
#endif
if (do_snarf_defarg)
{
my_friendly_assert (num_tokens () == 0, 2837);
tmp_token.yychar = DEFARG;
tmp_token.yylval.ttype = snarf_defarg ();
tmp_token.end_of_file = 0;
do_snarf_defarg = 0;
add_token (&tmp_token);
}
/* if we've got tokens, send them */
else if (num_tokens ())
{
tmp_token= *nth_token (0);
/* TMP_TOKEN.YYLVAL.TTYPE may have been allocated on the wrong obstack.
If we don't find it in CURRENT_OBSTACK's current or immediately
previous chunk, assume it was and copy it to the current obstack. */
if ((tmp_token.yychar == CONSTANT
|| tmp_token.yychar == STRING)
&& ! TREE_PERMANENT (tmp_token.yylval.ttype)
&& ! probe_obstack (current_obstack, tmp_token.yylval.ttype, 2)
&& ! probe_obstack (saveable_obstack, tmp_token.yylval.ttype, 2))
tmp_token.yylval.ttype = copy_node (tmp_token.yylval.ttype);
}
else
{
/* if not, grab the next one and think about it */
tmp_token.yychar = real_yylex ();
tmp_token.yylval = yylval;
tmp_token.end_of_file = end_of_file;
add_token (&tmp_token);
}
/* many tokens just need to be returned. At first glance, all we
have to do is send them back up, but some of them are needed to
figure out local context. */
switch (tmp_token.yychar)
{
case EMPTY:
/* This is a lexical no-op. */
consume_token ();
#ifdef SPEW_DEBUG
if (spew_debug)
debug_yychar (tmp_token.yychar);
#endif
goto retry;
case IDENTIFIER:
scan_tokens (1);
if (nth_token (1)->yychar == SCOPE)
{
/* Don't interfere with the setting from an 'aggr' prefix. */
old_looking_for_typename = looking_for_typename;
looking_for_typename = 1;
}
else if (nth_token (1)->yychar == '<')
looking_for_template = 1;
trrr = lookup_name (tmp_token.yylval.ttype, -2);
if (trrr)
{
tmp_token.yychar = identifier_type (trrr);
switch (tmp_token.yychar)
{
case TYPENAME:
case SELFNAME:
case NSNAME:
case PTYPENAME:
lastiddecl = trrr;
/* If this got special lookup, remember it. In these cases,
we don't have to worry about being a declarator-id. */
if (got_scope || got_object)
tmp_token.yylval.ttype = trrr;
break;
case PFUNCNAME:
case IDENTIFIER:
lastiddecl = trrr;
break;
default:
my_friendly_abort (101);
}
}
else
lastiddecl = NULL_TREE;
got_scope = NULL_TREE;
/* and fall through to... */
case IDENTIFIER_DEFN:
case TYPENAME:
case TYPENAME_DEFN:
case PTYPENAME:
case PTYPENAME_DEFN:
consume_token ();
/* If we see a SCOPE next, restore the old value.
Otherwise, we got what we want. */
looking_for_typename = old_looking_for_typename;
looking_for_template = 0;
break;
case SCSPEC:
/* If export, warn that it's unimplemented and go on. */
if (tmp_token.yylval.ttype == get_identifier("export"))
{
warning ("keyword 'export' not implemented and will be ignored");
consume_token ();
goto retry;
}
else
{
++first_token;
break;
}
case NEW:
/* do_aggr needs to check if the previous token was RID_NEW,
so just increment first_token instead of calling consume_token. */
++first_token;
break;
case TYPESPEC:
consume_token ();
break;
case AGGR:
*nth_token (0) = tmp_token;
do_aggr ();
/* fall through to output... */
case ENUM:
/* Set this again, in case we are rescanning. */
looking_for_typename = 2;
/* fall through... */
default:
consume_token ();
}
/* class member lookup only applies to the first token after the object
expression, except for explicit destructor calls. */
if (tmp_token.yychar != '~')
got_object = NULL_TREE;
/* Clear looking_for_typename if we got 'enum { ... };'. */
if (tmp_token.yychar == '{' || tmp_token.yychar == ':'
|| tmp_token.yychar == ';')
looking_for_typename = 0;
yylval = tmp_token.yylval;
yychar = tmp_token.yychar;
end_of_file = tmp_token.end_of_file;
#ifdef SPEW_DEBUG
if (spew_debug)
debug_yychar (yychar);
#endif
return yychar;
}
/* token[0] == AGGR (struct/union/enum)
Thus, token[1] is either a TYPENAME or a TYPENAME_DEFN.
If token[2] == '{' or ':' then it's TYPENAME_DEFN.
It's also a definition if it's a forward declaration (as in 'struct Foo;')
which we can tell if token[2] == ';' *and* token[-1] != FRIEND or NEW. */
static int
do_aggr ()
{
int yc1, yc2;
scan_tokens (2);
yc1 = nth_token (1)->yychar;
if (yc1 != TYPENAME && yc1 != IDENTIFIER && yc1 != PTYPENAME)
return 0;
yc2 = nth_token (2)->yychar;
if (yc2 == ';')
{
/* It's a forward declaration iff we were not preceded by
'friend' or `new'. */
if (first_token > 0)
{
if (nth_token (-1)->yychar == SCSPEC
&& nth_token (-1)->yylval.ttype == ridpointers[(int) RID_FRIEND])
return 0;
if (nth_token (-1)->yychar == NEW)
return 0;
}
}
else if (yc2 != '{' && yc2 != ':')
return 0;
switch (yc1)
{
case TYPENAME:
nth_token (1)->yychar = TYPENAME_DEFN;
break;
case PTYPENAME:
nth_token (1)->yychar = PTYPENAME_DEFN;
break;
case IDENTIFIER:
nth_token (1)->yychar = IDENTIFIER_DEFN;
break;
default:
my_friendly_abort (102);
}
return 0;
}
#ifdef SPEW_DEBUG
/* debug_yychar takes a yychar (token number) value and prints its name. */
static int
debug_yychar (yy)
int yy;
{
/* In parse.y: */
extern char *debug_yytranslate ();
int i;
if (yy<256) {
fprintf (stderr, "<%d: %c >\n", yy, yy);
return 0;
}
fprintf (stderr, "<%d:%s>\n", yy, debug_yytranslate (yy));
return 1;
}
#endif

View File

@ -1,134 +0,0 @@
// Methods for type_info for -*- C++ -*- Run Time Type Identification.
// Copyright (C) 1994, 1996, 1998 Free Software Foundation
// 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.
// As a special exception, if you link this library with other files,
// some of which are compiled with GCC, to produce an executable,
// this library does not by itself cause the resulting executable
// to be covered by the GNU General Public License.
// This exception does not however invalidate any other reasons why
// the executable file might be covered by the GNU General Public License.
#pragma implementation "typeinfo"
#include <stddef.h>
#include "tinfo.h"
#include "new" // for placement new
// This file contains the minimal working set necessary to link with code
// that uses virtual functions and -frtti but does not actually use RTTI
// functionality.
std::type_info::
~type_info ()
{ }
// We can't rely on common symbols being shared between shared objects.
bool type_info::
operator== (const type_info& arg) const
{
return (&arg == this) || (strcmp (name (), arg.name ()) == 0);
}
extern "C" void
__rtti_class (void *addr, const char *name,
const __class_type_info::base_info *bl, size_t bn)
{ new (addr) __class_type_info (name, bl, bn); }
extern "C" void
__rtti_si (void *addr, const char *n, const std::type_info *ti)
{
new (addr) __si_type_info
(n, static_cast <const __user_type_info &> (*ti));
}
extern "C" void
__rtti_user (void *addr, const char *name)
{ new (addr) __user_type_info (name); }
// dynamic_cast helper methods.
// Returns a pointer to the desired sub-object or 0.
void * __user_type_info::
dcast (const type_info& to, int, void *addr, const type_info *, void *) const
{ return (*this == to) ? addr : 0; }
void * __si_type_info::
dcast (const type_info& to, int require_public, void *addr,
const type_info *sub, void *subptr) const
{
if (*this == to)
return addr;
return base.dcast (to, require_public, addr, sub, subptr);
}
void* __class_type_info::
dcast (const type_info& desired, int is_public, void *objptr,
const type_info *sub, void *subptr) const
{
if (*this == desired)
return objptr;
void *match_found = 0;
for (size_t i = 0; i < n_bases; i++)
{
if (is_public && base_list[i].access != PUBLIC)
continue;
void *p = (char *)objptr + base_list[i].offset;
if (base_list[i].is_virtual)
p = *(void **)p;
p = base_list[i].base->dcast (desired, is_public, p, sub, subptr);
if (p)
{
if (match_found == 0)
match_found = p;
else if (match_found != p)
{
if (sub)
{
// Perhaps we're downcasting from *sub to desired; see if
// subptr is a subobject of exactly one of {match_found,p}.
const __user_type_info &d =
static_cast <const __user_type_info &> (desired);
void *os = d.dcast (*sub, 1, match_found);
void *ns = d.dcast (*sub, 1, p);
if (os == ns)
/* ambiguous -- subptr is a virtual base */;
else if (os == subptr)
continue;
else if (ns == subptr)
{
match_found = p;
continue;
}
}
// base found at two different pointers,
// conversion is not unique
return 0;
}
}
}
return match_found;
}

View File

@ -1,55 +0,0 @@
// RTTI support internals for -*- C++ -*-
// Copyright (C) 1994, 1995, 1996, 1998 Free Software Foundation
#include "typeinfo"
// Class declarations shared between the typeinfo implementation files.
// type_info for a class with no base classes (or an enum).
struct __user_type_info : public std::type_info {
__user_type_info (const char *n) : type_info (n) {}
// If our type can be converted to the desired type,
// return the pointer, adjusted accordingly; else return 0.
virtual void* dcast (const type_info &, int, void *,
const type_info * = 0, void * = 0) const;
};
// type_info for a class with one public, nonvirtual base class.
class __si_type_info : public __user_type_info {
const __user_type_info &base;
public:
__si_type_info (const char *n, const __user_type_info &b)
: __user_type_info (n), base (b) { }
virtual void *dcast (const type_info &, int, void *,
const type_info * = 0, void * = 0) const;
};
// type_info for a general class.
typedef unsigned int USItype __attribute__ ((mode (SI)));
struct __class_type_info : public __user_type_info {
enum access { PUBLIC = 1, PROTECTED = 2, PRIVATE = 3 };
struct base_info {
const __user_type_info *base;
USItype offset: 29;
bool is_virtual: 1;
access access: 2;
};
const base_info *base_list;
size_t n_bases;
__class_type_info (const char *name, const base_info *bl, size_t bn)
: __user_type_info (name), base_list (bl), n_bases (bn) {}
// This is a little complex.
virtual void* dcast (const type_info &, int, void *,
const type_info * = 0, void * = 0) const;
};

View File

@ -1,306 +0,0 @@
// Methods for type_info for -*- C++ -*- Run Time Type Identification.
// Copyright (C) 1994, 96-97, 1998 Free Software Foundation
// 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.
// As a special exception, if you link this library with other files,
// some of which are compiled with GCC, to produce an executable,
// this library does not by itself cause the resulting executable
// to be covered by the GNU General Public License.
// This exception does not however invalidate any other reasons why
// the executable file might be covered by the GNU General Public License.
/* CYGNUS LOCAL embedded c++ */
#ifndef __EMBEDDED_CXX__
/* END CYGNUS LOCAL */
#include <stddef.h>
#include "tinfo.h"
#include "new" // for placement new
using std::type_info;
bool
type_info::before (const type_info &arg) const
{
return strcmp (name (), arg.name ()) < 0;
}
// type info for pointer type.
struct __pointer_type_info : public type_info {
const type_info& type;
__pointer_type_info (const char *n, const type_info& ti)
: type_info (n), type (ti) {}
};
// type info for attributes
struct __attr_type_info : public type_info {
enum cv { NONE = 0, CONST = 1, VOLATILE = 2, CONSTVOL = 1 | 2 };
const type_info& type;
cv attr;
__attr_type_info (const char *n, cv a, const type_info& t)
: type_info (n), type (t), attr (a) {}
};
// type_info for builtin type
struct __builtin_type_info : public type_info {
__builtin_type_info (const char *n): type_info (n) {}
};
// type info for function.
struct __func_type_info : public type_info {
__func_type_info (const char *n) : type_info (n) {}
};
// type info for pointer to member function.
struct __ptmf_type_info : public type_info {
__ptmf_type_info (const char *n) : type_info (n) {}
};
// type info for pointer to data member.
struct __ptmd_type_info : public type_info {
__ptmd_type_info (const char *n): type_info (n) {}
};
// type info for array.
struct __array_type_info : public type_info {
__array_type_info (const char *n): type_info (n) {}
};
// Entry points for the compiler.
/* Low level match routine used by compiler to match types of catch
variables and thrown objects. */
extern "C" void*
__throw_type_match_rtti (const void *catch_type_r, const void *throw_type_r,
void *objptr)
{
const type_info &catch_type = *(const type_info *)catch_type_r;
const type_info &throw_type = *(const type_info *)throw_type_r;
if (catch_type == throw_type)
return objptr;
#if 0
printf ("We want to match a %s against a %s!\n",
throw_type.name (), catch_type.name ());
#endif
void *new_objptr = 0;
if (const __user_type_info *p
= dynamic_cast <const __user_type_info *> (&throw_type))
{
/* The 1 skips conversions to private bases. */
new_objptr = p->dcast (catch_type, 1, objptr);
}
else if (const __pointer_type_info *fr =
dynamic_cast <const __pointer_type_info *> (&throw_type))
{
const __pointer_type_info *to =
dynamic_cast <const __pointer_type_info *> (&catch_type);
if (! to)
goto fail;
const type_info *subfr = &fr->type, *subto = &to->type;
__attr_type_info::cv cvfrom, cvto;
if (const __attr_type_info *at
= dynamic_cast <const __attr_type_info *> (subfr))
{
cvfrom = at->attr;
subfr = &at->type;
}
else
cvfrom = __attr_type_info::NONE;
if (const __attr_type_info *at
= dynamic_cast <const __attr_type_info *> (subto))
{
cvto = at->attr;
subto = &at->type;
}
else
cvto = __attr_type_info::NONE;
if (((cvfrom & __attr_type_info::CONST)
> (cvto & __attr_type_info::CONST))
|| ((cvfrom & __attr_type_info::VOLATILE)
> (cvto & __attr_type_info::VOLATILE)))
goto fail;
if (*subto == *subfr)
new_objptr = objptr;
else if (*subto == typeid (void)
&& dynamic_cast <const __func_type_info *> (subfr) == 0)
new_objptr = objptr;
else if (const __user_type_info *p
= dynamic_cast <const __user_type_info *> (subfr))
{
/* The 1 skips conversions to private bases. */
new_objptr = p->dcast (*subto, 1, objptr);
}
else if (const __pointer_type_info *pfr
= dynamic_cast <const __pointer_type_info *> (subfr))
{
// Multi-level pointer conversion.
const __pointer_type_info *pto
= dynamic_cast <const __pointer_type_info *> (subto);
if (! pto)
goto fail;
bool constp = (cvto & __attr_type_info::CONST);
for (subto = &pto->type, subfr = &pfr->type; ;
subto = &pto->type, subfr = &pfr->type)
{
if (const __attr_type_info *at
= dynamic_cast <const __attr_type_info *> (subfr))
{
cvfrom = at->attr;
subfr = &at->type;
}
else
cvfrom = __attr_type_info::NONE;
if (const __attr_type_info *at
= dynamic_cast <const __attr_type_info *> (subto))
{
cvto = at->attr;
subto = &at->type;
}
else
cvto = __attr_type_info::NONE;
if (((cvfrom & __attr_type_info::CONST)
> (cvto & __attr_type_info::CONST))
|| ((cvfrom & __attr_type_info::VOLATILE)
> (cvto & __attr_type_info::VOLATILE)))
goto fail;
if (! constp
&& (((cvfrom & __attr_type_info::CONST)
< (cvto & __attr_type_info::CONST))
|| ((cvfrom & __attr_type_info::VOLATILE)
< (cvto & __attr_type_info::VOLATILE))))
goto fail;
if (*subto == *subfr)
{
new_objptr = objptr;
break;
}
pto = dynamic_cast <const __pointer_type_info *> (subto);
pfr = dynamic_cast <const __pointer_type_info *> (subfr);
if (! pto || ! pfr)
goto fail;
if (! (cvto & __attr_type_info::CONST))
constp = false;
}
}
}
fail:
#if 0
if (new_objptr)
printf ("It converts, delta is %d\n", new_objptr-objptr);
#endif
return new_objptr;
}
/* Called from __cp_pop_exception. Is P the type_info node for a pointer
of some kind? */
bool
__is_pointer (void *p)
{
const type_info *t = reinterpret_cast <const type_info *>(p);
const __pointer_type_info *pt =
dynamic_cast <const __pointer_type_info *> (t);
return pt != 0;
}
extern "C" void
__rtti_ptr (void *addr, const char *n, const type_info *ti)
{ new (addr) __pointer_type_info (n, *ti); }
extern "C" void
__rtti_attr (void *addr, const char *n, int attrval, const type_info *ti)
{
new (addr) __attr_type_info
(n, static_cast <__attr_type_info::cv> (attrval), *ti);
}
extern "C" void
__rtti_func (void *addr, const char *name)
{ new (addr) __func_type_info (name); }
extern "C" void
__rtti_ptmf (void *addr, const char *name)
{ new (addr) __ptmf_type_info (name); }
extern "C" void
__rtti_ptmd (void *addr, const char *name)
{ new (addr) __ptmd_type_info (name); }
extern "C" void
__rtti_array (void *addr, const char *name)
{ new (addr) __array_type_info (name); }
extern "C" void *
__dynamic_cast (const type_info& (*from)(void), const type_info& (*to)(void),
int require_public, void *address,
const type_info & (*sub)(void), void *subptr)
{
return static_cast <const __user_type_info &> (from ()).dcast
(to (), require_public, address, &(sub ()), subptr);
}
// type_info nodes and functions for the builtin types. The mangling here
// must match the mangling in gcc/cp/rtti.c.
#define BUILTIN(mangled) \
unsigned char __ti##mangled [sizeof (__builtin_type_info)] \
__attribute__ ((aligned (__alignof__ (void *)))); \
extern "C" const type_info &__tf##mangled (void) { \
if ((*(void **) __ti##mangled) == 0) \
new (__ti##mangled) __builtin_type_info (#mangled); \
return *(type_info *)__ti##mangled; \
}
BUILTIN (v); BUILTIN (x); BUILTIN (l); BUILTIN (i); BUILTIN (s); BUILTIN (b);
BUILTIN (c); BUILTIN (w); BUILTIN (r); BUILTIN (d); BUILTIN (f);
BUILTIN (Ui); BUILTIN (Ul); BUILTIN (Ux); BUILTIN (Us); BUILTIN (Uc);
BUILTIN (Sc);
/* CYGNUS LOCAL embedded C++ */
#endif
/* END CYGNUS LOCAL */

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,838 +0,0 @@
/* Code for handling XREF output from GNU C++.
Copyright (C) 1992, 93-97, 1998 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
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 "cp-tree.h"
#include "input.h"
#include "toplev.h"
extern char *getpwd PROTO((void));
/* The character(s) used to join a directory specification (obtained with
getwd or equivalent) with a non-absolute file name. */
#ifndef FILE_NAME_JOINER
#define FILE_NAME_JOINER "/"
#endif
/* Nonzero if NAME as a file name is absolute. */
#ifndef FILE_NAME_ABSOLUTE_P
#define FILE_NAME_ABSOLUTE_P(NAME) (NAME[0] == '/')
#endif
/* For cross referencing. */
int flag_gnu_xref;
/************************************************************************/
/* */
/* Common definitions */
/* */
/************************************************************************/
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define PALLOC(typ) ((typ *) calloc(1,sizeof(typ)))
/* Return a malloc'd copy of STR. */
#define SALLOC(str) \
((char *) ((str) == NULL ? NULL \
: (char *) strcpy ((char *) malloc (strlen ((str)) + 1), (str))))
#define SFREE(str) (str != NULL && (free(str),0))
#define STREQL(s1,s2) (strcmp((s1),(s2)) == 0)
#define STRNEQ(s1,s2) (strcmp((s1),(s2)) != 0)
#define STRLSS(s1,s2) (strcmp((s1),(s2)) < 0)
#define STRLEQ(s1,s2) (strcmp((s1),(s2)) <= 0)
#define STRGTR(s1,s2) (strcmp((s1),(s2)) > 0)
#define STRGEQ(s1,s2) (strcmp((s1),(s2)) >= 0)
/************************************************************************/
/* */
/* Type definitions */
/* */
/************************************************************************/
typedef struct _XREF_FILE * XREF_FILE;
typedef struct _XREF_SCOPE * XREF_SCOPE;
typedef struct _XREF_FILE
{
char *name;
char *outname;
XREF_FILE next;
} XREF_FILE_INFO;
typedef struct _XREF_SCOPE
{
int gid;
int lid;
XREF_FILE file;
int start;
XREF_SCOPE outer;
} XREF_SCOPE_INFO;
/************************************************************************/
/* */
/* Local storage */
/* */
/************************************************************************/
static char doing_xref = 0;
static FILE * xref_file = NULL;
static char xref_name[1024];
static XREF_FILE all_files = NULL;
static char * wd_name = NULL;
static XREF_SCOPE cur_scope = NULL;
static int scope_ctr = 0;
static XREF_FILE last_file = NULL;
static tree last_fndecl = NULL;
/************************************************************************/
/* */
/* Forward definitions */
/* */
/************************************************************************/
static void gen_assign PROTO((XREF_FILE, tree));
static XREF_FILE find_file PROTO((char *));
static char * filename PROTO((XREF_FILE));
static char * fctname PROTO((tree));
static char * declname PROTO((tree));
static void simplify_type PROTO((char *));
static char * fixname PROTO((char *, char *));
static void open_xref_file PROTO((char *));
/* Start cross referencing. FILE is the name of the file we xref. */
void
GNU_xref_begin (file)
char *file;
{
doing_xref = 1;
if (file != NULL && STRNEQ (file,"-"))
{
open_xref_file(file);
GNU_xref_file(file);
}
}
/* Finish cross-referencing. ERRCNT is the number of errors
we encountered. */
void
GNU_xref_end (ect)
int ect;
{
XREF_FILE xf;
if (!doing_xref) return;
xf = find_file (input_filename);
if (xf == NULL) return;
while (cur_scope != NULL)
GNU_xref_end_scope(cur_scope->gid,0,0,0);
doing_xref = 0;
if (xref_file == NULL) return;
fclose (xref_file);
xref_file = NULL;
all_files = NULL;
if (ect > 0) unlink (xref_name);
}
/* Write out xref for file named NAME. */
void
GNU_xref_file (name)
char *name;
{
XREF_FILE xf;
if (!doing_xref || name == NULL) return;
if (xref_file == NULL)
{
open_xref_file (name);
if (!doing_xref) return;
}
if (all_files == NULL)
fprintf(xref_file,"SCP * 0 0 0 0 RESET\n");
xf = find_file (name);
if (xf != NULL) return;
xf = PALLOC (XREF_FILE_INFO);
xf->name = SALLOC (name);
xf->next = all_files;
all_files = xf;
if (wd_name == NULL)
wd_name = getpwd ();
if (FILE_NAME_ABSOLUTE_P (name) || ! wd_name)
xf->outname = xf->name;
else
{
char *nmbuf
= (char *) malloc (strlen (wd_name) + strlen (FILE_NAME_JOINER)
+ strlen (name) + 1);
sprintf (nmbuf, "%s%s%s", wd_name, FILE_NAME_JOINER, name);
name = nmbuf;
xf->outname = nmbuf;
}
fprintf (xref_file, "FIL %s %s 0\n", name, wd_name);
filename (xf);
fctname (NULL);
}
/* Start a scope identified at level ID. */
void
GNU_xref_start_scope (id)
HOST_WIDE_INT id;
{
XREF_SCOPE xs;
XREF_FILE xf;
if (!doing_xref) return;
xf = find_file (input_filename);
xs = PALLOC (XREF_SCOPE_INFO);
xs->file = xf;
xs->start = lineno;
if (xs->start <= 0) xs->start = 1;
xs->gid = id;
xs->lid = ++scope_ctr;
xs->outer = cur_scope;
cur_scope = xs;
}
/* Finish a scope at level ID.
INID is ???
PRM is ???
KEEP is nonzero iff this scope is retained (nonzero if it's
a compiler-generated invisible scope).
TRNS is ??? */
void
GNU_xref_end_scope (id,inid,prm,keep)
HOST_WIDE_INT id;
HOST_WIDE_INT inid;
int prm,keep;
{
XREF_FILE xf;
XREF_SCOPE xs,lxs,oxs;
char *stype;
if (!doing_xref) return;
xf = find_file (input_filename);
if (xf == NULL) return;
lxs = NULL;
for (xs = cur_scope; xs != NULL; xs = xs->outer)
{
if (xs->gid == id) break;
lxs = xs;
}
if (xs == NULL) return;
if (inid != 0) {
for (oxs = cur_scope; oxs != NULL; oxs = oxs->outer) {
if (oxs->gid == inid) break;
}
if (oxs == NULL) return;
inid = oxs->lid;
}
if (prm == 2) stype = "SUE";
else if (prm != 0) stype = "ARGS";
else if (keep == 2 || inid != 0) stype = "INTERN";
else stype = "EXTERN";
fprintf (xref_file, "SCP %s %d %d %d ",
filename (xf), xs->start, lineno,xs->lid);
fprintf (xref_file, HOST_WIDE_INT_PRINT_DEC, inid);
fprintf (xref_file, " %s\n", stype);
if (lxs == NULL) cur_scope = xs->outer;
else lxs->outer = xs->outer;
free (xs);
}
/* Output a reference to NAME in FNDECL. */
void
GNU_xref_ref (fndecl,name)
tree fndecl;
char *name;
{
XREF_FILE xf;
if (!doing_xref) return;
xf = find_file (input_filename);
if (xf == NULL) return;
fprintf (xref_file, "REF %s %d %s %s\n",
filename (xf), lineno, fctname (fndecl), name);
}
/* Output a reference to DECL in FNDECL. */
void
GNU_xref_decl (fndecl,decl)
tree fndecl;
tree decl;
{
XREF_FILE xf,xf1;
char *cls = 0;
char *name;
char buf[10240];
int uselin;
if (!doing_xref) return;
xf = find_file (input_filename);
if (xf == NULL) return;
uselin = FALSE;
if (TREE_CODE (decl) == TYPE_DECL) cls = "TYPEDEF";
else if (TREE_CODE (decl) == FIELD_DECL) cls = "FIELD";
else if (TREE_CODE (decl) == VAR_DECL)
{
if (fndecl == NULL && TREE_STATIC(decl)
&& TREE_READONLY(decl) && DECL_INITIAL(decl) != 0
&& !TREE_PUBLIC(decl) && !DECL_EXTERNAL(decl)
&& DECL_MODE(decl) != BLKmode) cls = "CONST";
else if (DECL_EXTERNAL(decl)) cls = "EXTERN";
else if (TREE_PUBLIC(decl)) cls = "EXTDEF";
else if (TREE_STATIC(decl)) cls = "STATIC";
else if (DECL_REGISTER(decl)) cls = "REGISTER";
else cls = "AUTO";
}
else if (TREE_CODE (decl) == PARM_DECL) cls = "PARAM";
else if (TREE_CODE (decl) == FIELD_DECL) cls = "FIELD";
else if (TREE_CODE (decl) == CONST_DECL) cls = "CONST";
else if (TREE_CODE (decl) == FUNCTION_DECL)
{
if (DECL_EXTERNAL (decl)) cls = "EXTERN";
else if (TREE_PUBLIC (decl)) cls = "EFUNCTION";
else cls = "SFUNCTION";
}
else if (TREE_CODE (decl) == LABEL_DECL) cls = "LABEL";
else if (TREE_CODE (decl) == UNION_TYPE)
{
cls = "UNIONID";
decl = TYPE_NAME (decl);
uselin = TRUE;
}
else if (TREE_CODE (decl) == RECORD_TYPE)
{
if (CLASSTYPE_DECLARED_CLASS (decl)) cls = "CLASSID";
else if (IS_SIGNATURE (decl)) cls = "SIGNATUREID";
else cls = "STRUCTID";
decl = TYPE_NAME (decl);
uselin = TRUE;
}
else if (TREE_CODE (decl) == ENUMERAL_TYPE)
{
cls = "ENUMID";
decl = TYPE_NAME (decl);
uselin = TRUE;
}
else if (TREE_CODE (decl) == TEMPLATE_DECL)
{
if (TREE_CODE (DECL_RESULT (decl)) == TYPE_DECL)
cls = "CLASSTEMP";
else if (TREE_CODE (DECL_RESULT (decl)) == FUNCTION_DECL)
cls = "FUNCTEMP";
else if (TREE_CODE (DECL_RESULT (decl)) == VAR_DECL)
cls = "VARTEMP";
else
my_friendly_abort (358);
uselin = TRUE;
}
else cls = "UNKNOWN";
if (decl == NULL || DECL_NAME (decl) == NULL) return;
if (uselin && decl->decl.linenum > 0 && decl->decl.filename != NULL)
{
xf1 = find_file (decl->decl.filename);
if (xf1 != NULL)
{
lineno = decl->decl.linenum;
xf = xf1;
}
}
if (DECL_ASSEMBLER_NAME (decl))
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
else
name = IDENTIFIER_POINTER (DECL_NAME (decl));
strcpy (buf, type_as_string (TREE_TYPE (decl), 0));
simplify_type (buf);
fprintf (xref_file, "DCL %s %d %s %d %s %s %s\n",
filename(xf), lineno, name,
(cur_scope != NULL ? cur_scope->lid : 0),
cls, fctname(fndecl), buf);
if (STREQL (cls, "STRUCTID") || STREQL (cls, "UNIONID")
|| STREQL (cls, "SIGNATUREID"))
{
cls = "CLASSID";
fprintf (xref_file, "DCL %s %d %s %d %s %s %s\n",
filename(xf), lineno,name,
(cur_scope != NULL ? cur_scope->lid : 0),
cls, fctname(fndecl), buf);
}
}
/* Output a reference to a call to NAME in FNDECL. */
void
GNU_xref_call (fndecl, name)
tree fndecl;
char *name;
{
XREF_FILE xf;
char buf[1024];
char *s;
if (!doing_xref) return;
xf = find_file (input_filename);
if (xf == NULL) return;
name = fixname (name, buf);
for (s = name; *s != 0; ++s)
if (*s == '_' && s[1] == '_') break;
if (*s != 0) GNU_xref_ref (fndecl, name);
fprintf (xref_file, "CAL %s %d %s %s\n",
filename (xf), lineno, name, fctname (fndecl));
}
/* Output cross-reference info about FNDECL. If non-NULL,
ARGS are the arguments for the function (i.e., before the FUNCTION_DECL
has been fully built). */
void
GNU_xref_function (fndecl, args)
tree fndecl;
tree args;
{
XREF_FILE xf;
int ct;
char buf[1024];
if (!doing_xref) return;
xf = find_file (input_filename);
if (xf == NULL) return;
ct = 0;
buf[0] = 0;
if (args == NULL) args = DECL_ARGUMENTS (fndecl);
GNU_xref_decl (NULL, fndecl);
for ( ; args != NULL; args = TREE_CHAIN (args))
{
GNU_xref_decl (fndecl,args);
if (ct != 0) strcat (buf,",");
strcat (buf, declname (args));
++ct;
}
fprintf (xref_file, "PRC %s %d %s %d %d %s\n",
filename(xf), lineno, declname(fndecl),
(cur_scope != NULL ? cur_scope->lid : 0),
ct, buf);
}
/* Output cross-reference info about an assignment to NAME. */
void
GNU_xref_assign(name)
tree name;
{
XREF_FILE xf;
if (!doing_xref) return;
xf = find_file(input_filename);
if (xf == NULL) return;
gen_assign(xf, name);
}
static void
gen_assign(xf, name)
XREF_FILE xf;
tree name;
{
char *s;
s = NULL;
switch (TREE_CODE (name))
{
case IDENTIFIER_NODE :
s = IDENTIFIER_POINTER(name);
break;
case VAR_DECL :
s = declname(name);
break;
case COMPONENT_REF :
gen_assign(xf, TREE_OPERAND(name, 0));
gen_assign(xf, TREE_OPERAND(name, 1));
break;
case INDIRECT_REF :
case OFFSET_REF :
case ARRAY_REF :
case BUFFER_REF :
gen_assign(xf, TREE_OPERAND(name, 0));
break;
case COMPOUND_EXPR :
gen_assign(xf, TREE_OPERAND(name, 1));
break;
default :
break;
}
if (s != NULL)
fprintf(xref_file, "ASG %s %d %s\n", filename(xf), lineno, s);
}
static char*
classname (cls)
tree cls;
{
if (cls && TREE_CODE_CLASS (TREE_CODE (cls)) == 't')
cls = TYPE_NAME (cls);
if (cls && TREE_CODE_CLASS (TREE_CODE (cls)) == 'd')
cls = DECL_NAME (cls);
if (cls && TREE_CODE (cls) == IDENTIFIER_NODE)
return IDENTIFIER_POINTER (cls);
return "?";
}
/* Output cross-reference info about a class hierarchy.
CLS is the class type of interest. BASE is a baseclass
for CLS. PUB and VIRT give the access info about
the class derivation. FRND is nonzero iff BASE is a friend
of CLS.
??? Needs to handle nested classes. */
void
GNU_xref_hier(cls, base, pub, virt, frnd)
tree cls;
tree base;
int pub;
int virt;
int frnd;
{
XREF_FILE xf;
if (!doing_xref) return;
xf = find_file(input_filename);
if (xf == NULL) return;
fprintf(xref_file, "HIE %s %d %s %s %d %d %d\n",
filename(xf), lineno, classname (cls), classname (base),
pub, virt, frnd);
}
/* Output cross-reference info about class members. CLS
is the containing type; FLD is the class member. */
void
GNU_xref_member(cls, fld)
tree cls;
tree fld;
{
XREF_FILE xf;
char *prot;
int confg, pure;
char *d;
#ifdef XREF_SHORT_MEMBER_NAMES
int i;
#endif
char buf[1024], bufa[1024];
if (!doing_xref) return;
xf = find_file(fld->decl.filename);
if (xf == NULL) return;
if (TREE_PRIVATE (fld)) prot = "PRIVATE";
else if (TREE_PROTECTED(fld)) prot = "PROTECTED";
else prot = "PUBLIC";
confg = 0;
if (TREE_CODE (fld) == FUNCTION_DECL && DECL_CONST_MEMFUNC_P(fld))
confg = 1;
else if (TREE_CODE (fld) == CONST_DECL)
confg = 1;
pure = 0;
if (TREE_CODE (fld) == FUNCTION_DECL && DECL_ABSTRACT_VIRTUAL_P(fld))
pure = 1;
d = IDENTIFIER_POINTER(cls);
sprintf(buf, "%d%s", (int) strlen(d), d);
#ifdef XREF_SHORT_MEMBER_NAMES
i = strlen(buf);
#endif
strcpy(bufa, declname(fld));
#ifdef XREF_SHORT_MEMBER_NAMES
for (p = &bufa[1]; *p != 0; ++p)
{
if (p[0] == '_' && p[1] == '_' && p[2] >= '0' && p[2] <= '9') {
if (strncmp(&p[2], buf, i) == 0) *p = 0;
break;
}
else if (p[0] == '_' && p[1] == '_' && p[2] == 'C' && p[3] >= '0' && p[3] <= '9') {
if (strncmp(&p[3], buf, i) == 0) *p = 0;
break;
}
}
#endif
fprintf(xref_file, "MEM %s %d %s %s %s %d %d %d %d %d %d %d\n",
filename(xf), fld->decl.linenum, d, bufa, prot,
(TREE_CODE (fld) == FUNCTION_DECL ? 0 : 1),
(DECL_INLINE (fld) ? 1 : 0),
(DECL_LANG_SPECIFIC(fld) && DECL_FRIEND_P(fld) ? 1 : 0),
(DECL_VINDEX(fld) ? 1 : 0),
(TREE_STATIC(fld) ? 1 : 0),
pure, confg);
}
/* Find file entry given name. */
static XREF_FILE
find_file(name)
char *name;
{
XREF_FILE xf;
for (xf = all_files; xf != NULL; xf = xf->next) {
if (STREQL(name, xf->name)) break;
}
return xf;
}
/* Return filename for output purposes. */
static char *
filename(xf)
XREF_FILE xf;
{
if (xf == NULL) {
last_file = NULL;
return "*";
}
if (last_file == xf) return "*";
last_file = xf;
return xf->outname;
}
/* Return function name for output purposes. */
static char *
fctname(fndecl)
tree fndecl;
{
static char fctbuf[1024];
char *s;
if (fndecl == NULL && last_fndecl == NULL) return "*";
if (fndecl == NULL)
{
last_fndecl = NULL;
return "*TOP*";
}
if (fndecl == last_fndecl) return "*";
last_fndecl = fndecl;
s = declname(fndecl);
s = fixname(s, fctbuf);
return s;
}
/* Return decl name for output purposes. */
static char *
declname(dcl)
tree dcl;
{
if (DECL_NAME (dcl) == NULL) return "?";
if (DECL_ASSEMBLER_NAME (dcl))
return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (dcl));
else
return IDENTIFIER_POINTER (DECL_NAME (dcl));
}
/* Simplify a type string by removing unneeded parenthesis. */
static void
simplify_type(typ)
char *typ;
{
char *s;
int lvl, i;
i = strlen(typ);
while (i > 0 && ISSPACE((unsigned char) typ[i-1])) typ[--i] = 0;
if (i > 7 && STREQL(&typ[i-5], "const"))
{
typ[i-5] = 0;
i -= 5;
}
if (typ[i-1] != ')') return;
s = &typ[i-2];
lvl = 1;
while (*s != 0) {
if (*s == ')') ++lvl;
else if (*s == '(')
{
--lvl;
if (lvl == 0)
{
s[1] = ')';
s[2] = 0;
break;
}
}
--s;
}
if (*s != 0 && s[-1] == ')')
{
--s;
--s;
if (*s == '(') s[2] = 0;
else if (*s == ':') {
while (*s != '(') --s;
s[1] = ')';
s[2] = 0;
}
}
}
/* Fixup a function name (take care of embedded spaces). */
static char *
fixname(nam, buf)
char *nam;
char *buf;
{
char *s, *t;
int fg;
s = nam;
t = buf;
fg = 0;
while (*s != 0)
{
if (*s == ' ')
{
*t++ = '\36';
++fg;
}
else *t++ = *s;
++s;
}
*t = 0;
if (fg == 0) return nam;
return buf;
}
/* Open file for xreffing. */
static void
open_xref_file(file)
char *file;
{
char *s, *t;
#ifdef XREF_FILE_NAME
XREF_FILE_NAME (xref_name, file);
#else
s = rindex (file, '/');
if (s == NULL)
sprintf (xref_name, ".%s.gxref", file);
else
{
++s;
strcpy (xref_name, file);
t = rindex (xref_name, '/');
++t;
*t++ = '.';
strcpy (t, s);
strcat (t, ".gxref");
}
#endif /* no XREF_FILE_NAME */
xref_file = fopen(xref_name, "w");
if (xref_file == NULL)
{
error("Can't create cross-reference file `%s'", xref_name);
doing_xref = 0;
}
}

View File

@ -1,530 +0,0 @@
/* Specialized bits of code needed to support construction and
destruction of file-scope objects in C++ code.
Copyright (C) 1991, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com).
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. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
/* This file is a bit like libgcc1.c/libgcc2.c in that it is compiled
multiple times and yields multiple .o files.
This file is useful on target machines where the object file format
supports multiple "user-defined" sections (e.g. COFF, ELF, ROSE). On
such systems, this file allows us to avoid running collect (or any
other such slow and painful kludge). Additionally, if the target
system supports a .init section, this file allows us to support the
linking of C++ code with a non-C++ main program.
Note that if INIT_SECTION_ASM_OP is defined in the tm.h file, then
this file *will* make use of the .init section. If that symbol is
not defined however, then the .init section will not be used.
Currently, only ELF and COFF are supported. It is likely however that
ROSE could also be supported, if someone was willing to do the work to
make whatever (small?) adaptations are needed. (Some work may be
needed on the ROSE assembler and linker also.)
This file must be compiled with gcc. */
/* It is incorrect to include config.h here, because this file is being
compiled for the target, and hence definitions concerning only the host
do not apply. */
#include "tm.h"
#include "defaults.h"
#include <stddef.h>
#include "frame.h"
#ifndef OBJECT_FORMAT_MACHO
/* Provide default definitions for the pseudo-ops used to switch to the
.ctors and .dtors sections.
Note that we want to give these sections the SHF_WRITE attribute
because these sections will actually contain data (i.e. tables of
addresses of functions in the current root executable or shared library
file) and, in the case of a shared library, the relocatable addresses
will have to be properly resolved/relocated (and then written into) by
the dynamic linker when it actually attaches the given shared library
to the executing process. (Note that on SVR4, you may wish to use the
`-z text' option to the ELF linker, when building a shared library, as
an additional check that you are doing everything right. But if you do
use the `-z text' option when building a shared library, you will get
errors unless the .ctors and .dtors sections are marked as writable
via the SHF_WRITE attribute.) */
#ifndef CTORS_SECTION_ASM_OP
#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
#endif
#ifndef DTORS_SECTION_ASM_OP
#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
#endif
#if !defined (EH_FRAME_SECTION_ASM_OP) && defined (DWARF2_UNWIND_INFO) && defined(ASM_OUTPUT_SECTION_NAME)
#define EH_FRAME_SECTION_ASM_OP ".section\t.eh_frame,\"aw\""
#endif
#ifdef OBJECT_FORMAT_ELF
/* Declare a pointer to void function type. */
typedef void (*func_ptr) (void);
#define STATIC static
#else /* OBJECT_FORMAT_ELF */
#include "gbl-ctors.h"
#ifndef ON_EXIT
#define ON_EXIT(a, b)
#endif
#define STATIC
#endif /* OBJECT_FORMAT_ELF */
#ifdef CRT_BEGIN
#ifdef INIT_SECTION_ASM_OP
#ifdef OBJECT_FORMAT_ELF
/* Run all the global destructors on exit from the program. */
/* Some systems place the number of pointers in the first word of the
table. On SVR4 however, that word is -1. In all cases, the table is
null-terminated. On SVR4, we start from the beginning of the list and
invoke each per-compilation-unit destructor routine in order
until we find that null.
Note that this function MUST be static. There will be one of these
functions in each root executable and one in each shared library, but
although they all have the same code, each one is unique in that it
refers to one particular associated `__DTOR_LIST__' which belongs to the
same particular root executable or shared library file.
On some systems, this routine is run more than once from the .fini,
when exit is called recursively, so we arrange to remember where in
the list we left off processing, and we resume at that point,
should we be re-invoked. */
static char __EH_FRAME_BEGIN__[];
static func_ptr __DTOR_LIST__[];
static void
__do_global_dtors_aux ()
{
static func_ptr *p = __DTOR_LIST__ + 1;
static int completed = 0;
if (completed)
return;
while (*p)
{
p++;
(*(p-1)) ();
}
#ifdef EH_FRAME_SECTION_ASM_OP
__deregister_frame_info (__EH_FRAME_BEGIN__);
#endif
completed = 1;
}
/* Stick a call to __do_global_dtors_aux into the .fini section. */
static void __attribute__ ((__unused__))
fini_dummy ()
{
asm (FINI_SECTION_ASM_OP);
__do_global_dtors_aux ();
#ifdef FORCE_FINI_SECTION_ALIGN
FORCE_FINI_SECTION_ALIGN;
#endif
asm (TEXT_SECTION_ASM_OP);
}
#ifdef EH_FRAME_SECTION_ASM_OP
/* Stick a call to __register_frame_info into the .init section. For some
reason calls with no arguments work more reliably in .init, so stick the
call in another function. */
static void
frame_dummy ()
{
static struct object object;
__register_frame_info (__EH_FRAME_BEGIN__, &object);
}
static void __attribute__ ((__unused__))
init_dummy ()
{
asm (INIT_SECTION_ASM_OP);
frame_dummy ();
#ifdef FORCE_INIT_SECTION_ALIGN
FORCE_INIT_SECTION_ALIGN;
#endif
asm (TEXT_SECTION_ASM_OP);
}
#endif /* EH_FRAME_SECTION_ASM_OP */
#else /* OBJECT_FORMAT_ELF */
/* The function __do_global_ctors_aux is compiled twice (once in crtbegin.o
and once in crtend.o). It must be declared static to avoid a link
error. Here, we define __do_global_ctors as an externally callable
function. It is externally callable so that __main can invoke it when
INVOKE__main is defined. This has the additional effect of forcing cc1
to switch to the .text section. */
static void __do_global_ctors_aux ();
void __do_global_ctors ()
{
#ifdef INVOKE__main /* If __main won't actually call __do_global_ctors
then it doesn't matter what's inside the function.
The inside of __do_global_ctors_aux is called
automatically in that case.
And the Alliant fx2800 linker crashes
on this reference. So prevent the crash. */
__do_global_ctors_aux ();
#endif
}
asm (INIT_SECTION_ASM_OP); /* cc1 doesn't know that we are switching! */
/* On some svr4 systems, the initial .init section preamble code provided in
crti.o may do something, such as bump the stack, which we have to
undo before we reach the function prologue code for __do_global_ctors
(directly below). For such systems, define the macro INIT_SECTION_PREAMBLE
to expand into the code needed to undo the actions of the crti.o file. */
#ifdef INIT_SECTION_PREAMBLE
INIT_SECTION_PREAMBLE;
#endif
/* A routine to invoke all of the global constructors upon entry to the
program. We put this into the .init section (for systems that have
such a thing) so that we can properly perform the construction of
file-scope static-storage C++ objects within shared libraries. */
static void
__do_global_ctors_aux () /* prologue goes in .init section */
{
#ifdef FORCE_INIT_SECTION_ALIGN
FORCE_INIT_SECTION_ALIGN; /* Explicit align before switch to .text */
#endif
asm (TEXT_SECTION_ASM_OP); /* don't put epilogue and body in .init */
DO_GLOBAL_CTORS_BODY;
ON_EXIT (__do_global_dtors, 0);
}
#endif /* OBJECT_FORMAT_ELF */
#else /* defined(INIT_SECTION_ASM_OP) */
#ifdef HAS_INIT_SECTION
/* This case is used by the Irix 6 port, which supports named sections but
not an SVR4-style .fini section. __do_global_dtors can be non-static
in this case because we protect it with -hidden_symbol. */
static char __EH_FRAME_BEGIN__[];
static func_ptr __DTOR_LIST__[];
void
__do_global_dtors ()
{
func_ptr *p;
for (p = __DTOR_LIST__ + 1; *p; p++)
(*p) ();
#ifdef EH_FRAME_SECTION_ASM_OP
__deregister_frame_info (__EH_FRAME_BEGIN__);
#endif
}
#ifdef EH_FRAME_SECTION_ASM_OP
/* Define a function here to call __register_frame. crtend.o is linked in
after libgcc.a, and hence can't call libgcc.a functions directly. That
can lead to unresolved function references. */
void
__frame_dummy ()
{
static struct object object;
__register_frame_info (__EH_FRAME_BEGIN__, &object);
}
#endif
#endif
#endif /* defined(INIT_SECTION_ASM_OP) */
/* Force cc1 to switch to .data section. */
static func_ptr force_to_data[0] __attribute__ ((__unused__)) = { };
/* NOTE: In order to be able to support SVR4 shared libraries, we arrange
to have one set of symbols { __CTOR_LIST__, __DTOR_LIST__, __CTOR_END__,
__DTOR_END__ } per root executable and also one set of these symbols
per shared library. So in any given whole process image, we may have
multiple definitions of each of these symbols. In order to prevent
these definitions from conflicting with one another, and in order to
ensure that the proper lists are used for the initialization/finalization
of each individual shared library (respectively), we give these symbols
only internal (i.e. `static') linkage, and we also make it a point to
refer to only the __CTOR_END__ symbol in crtend.o and the __DTOR_LIST__
symbol in crtbegin.o, where they are defined. */
/* The -1 is a flag to __do_global_[cd]tors
indicating that this table does not start with a count of elements. */
#ifdef CTOR_LIST_BEGIN
CTOR_LIST_BEGIN;
#else
asm (CTORS_SECTION_ASM_OP); /* cc1 doesn't know that we are switching! */
STATIC func_ptr __CTOR_LIST__[1] __attribute__ ((__unused__))
= { (func_ptr) (-1) };
#endif
#ifdef DTOR_LIST_BEGIN
DTOR_LIST_BEGIN;
#else
asm (DTORS_SECTION_ASM_OP); /* cc1 doesn't know that we are switching! */
STATIC func_ptr __DTOR_LIST__[1] = { (func_ptr) (-1) };
#endif
#ifdef EH_FRAME_SECTION_ASM_OP
/* Stick a label at the beginning of the frame unwind info so we can register
and deregister it with the exception handling library code. */
asm (EH_FRAME_SECTION_ASM_OP);
#ifdef INIT_SECTION_ASM_OP
STATIC
#endif
char __EH_FRAME_BEGIN__[] = { };
#endif /* EH_FRAME_SECTION_ASM_OP */
#endif /* defined(CRT_BEGIN) */
#ifdef CRT_END
#ifdef INIT_SECTION_ASM_OP
#ifdef OBJECT_FORMAT_ELF
static func_ptr __CTOR_END__[];
static void
__do_global_ctors_aux ()
{
func_ptr *p;
for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
(*p) ();
}
/* Stick a call to __do_global_ctors_aux into the .init section. */
static void __attribute__ ((__unused__))
init_dummy ()
{
asm (INIT_SECTION_ASM_OP);
__do_global_ctors_aux ();
#ifdef FORCE_INIT_SECTION_ALIGN
FORCE_INIT_SECTION_ALIGN;
#endif
asm (TEXT_SECTION_ASM_OP);
/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr,
__environ and atexit (). We have to make sure they are in the .dynsym
section. We accomplish it by making a dummy call here. This
code is never reached. */
#if defined(__linux__) && defined(__PIC__) && defined(__i386__)
{
extern void *___brk_addr;
extern char **__environ;
___brk_addr = __environ;
atexit ();
}
#endif
}
#else /* OBJECT_FORMAT_ELF */
/* Stick the real initialization code, followed by a normal sort of
function epilogue at the very end of the .init section for this
entire root executable file or for this entire shared library file.
Note that we use some tricks here to get *just* the body and just
a function epilogue (but no function prologue) into the .init
section of the crtend.o file. Specifically, we switch to the .text
section, start to define a function, and then we switch to the .init
section just before the body code.
Earlier on, we put the corresponding function prologue into the .init
section of the crtbegin.o file (which will be linked in first).
Note that we want to invoke all constructors for C++ file-scope static-
storage objects AFTER any other possible initialization actions which
may be performed by the code in the .init section contributions made by
other libraries, etc. That's because those other initializations may
include setup operations for very primitive things (e.g. initializing
the state of the floating-point coprocessor, etc.) which should be done
before we start to execute any of the user's code. */
static void
__do_global_ctors_aux () /* prologue goes in .text section */
{
asm (INIT_SECTION_ASM_OP);
DO_GLOBAL_CTORS_BODY;
ON_EXIT (__do_global_dtors, 0);
} /* epilogue and body go in .init section */
#ifdef FORCE_INIT_SECTION_ALIGN
FORCE_INIT_SECTION_ALIGN;
#endif
asm (TEXT_SECTION_ASM_OP);
#endif /* OBJECT_FORMAT_ELF */
#else /* defined(INIT_SECTION_ASM_OP) */
#ifdef HAS_INIT_SECTION
/* This case is used by the Irix 6 port, which supports named sections but
not an SVR4-style .init section. __do_global_ctors can be non-static
in this case because we protect it with -hidden_symbol. */
static func_ptr __CTOR_END__[];
#ifdef EH_FRAME_SECTION_ASM_OP
extern void __frame_dummy (void);
#endif
void
__do_global_ctors ()
{
func_ptr *p;
#ifdef EH_FRAME_SECTION_ASM_OP
__frame_dummy ();
#endif
for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
(*p) ();
}
#endif
#endif /* defined(INIT_SECTION_ASM_OP) */
/* Force cc1 to switch to .data section. */
static func_ptr force_to_data[0] __attribute__ ((__unused__)) = { };
/* Put a word containing zero at the end of each of our two lists of function
addresses. Note that the words defined here go into the .ctors and .dtors
sections of the crtend.o file, and since that file is always linked in
last, these words naturally end up at the very ends of the two lists
contained in these two sections. */
#ifdef CTOR_LIST_END
CTOR_LIST_END;
#else
asm (CTORS_SECTION_ASM_OP); /* cc1 doesn't know that we are switching! */
STATIC func_ptr __CTOR_END__[1] = { (func_ptr) 0 };
#endif
#ifdef DTOR_LIST_END
DTOR_LIST_END;
#else
asm (DTORS_SECTION_ASM_OP); /* cc1 doesn't know that we are switching! */
STATIC func_ptr __DTOR_END__[1] __attribute__ ((__unused__))
= { (func_ptr) 0 };
#endif
#ifdef EH_FRAME_SECTION_ASM_OP
/* Terminate the frame unwind info section with a 4byte 0 as a sentinel;
this would be the 'length' field in a real FDE. */
typedef unsigned int ui32 __attribute__ ((mode (SI)));
asm (EH_FRAME_SECTION_ASM_OP);
STATIC ui32 __FRAME_END__[] __attribute__ ((__unused__)) = { 0 };
#endif /* EH_FRAME_SECTION */
#endif /* defined(CRT_END) */
#else /* OBJECT_FORMAT_MACHO */
/* For Mach-O format executables, we assume that the system's runtime is
smart enough to handle constructors and destructors, but doesn't have
an init section (if it can't even handle constructors/destructors
you should be using INVOKE__main, not crtstuff). All we need to do
is install/deinstall the frame information for exceptions. We do this
by putting a constructor in crtbegin.o and a destructor in crtend.o.
crtend.o also puts in the terminating zero in the frame information
segment. */
/* The crtstuff for other object formats use the symbol __EH_FRAME_BEGIN__
to figure out the start of the exception frame, but here we use
getsectbynamefromheader to find this value. Either method would work,
but this method avoids creating any global symbols, which seems
cleaner. */
#include <mach-o/ldsyms.h>
extern const struct section *
getsectbynamefromheader (const struct mach_header *,
const char *, const char *);
#ifdef CRT_BEGIN
static void __reg_frame_ctor () __attribute__ ((constructor));
static void
__reg_frame_ctor ()
{
static struct object object;
const struct section *eh_frame;
eh_frame = getsectbynamefromheader (&_mh_execute_header,
"__TEXT", "__eh_frame");
__register_frame_info ((void *) eh_frame->addr, &object);
}
#endif /* CRT_BEGIN */
#ifdef CRT_END
static void __dereg_frame_dtor () __attribute__ ((destructor));
static
void __dereg_frame_dtor ()
{
const struct section *eh_frame;
eh_frame = getsectbynamefromheader (&_mh_execute_header,
"__TEXT", "__eh_frame");
__deregister_frame_info ((void *) eh_frame->addr);
}
/* Terminate the frame section with a final zero. */
/* Force cc1 to switch to .data section. */
static void * force_to_data[0] __attribute__ ((__unused__)) = { };
typedef unsigned int ui32 __attribute__ ((mode (SI)));
asm (EH_FRAME_SECTION_ASM_OP);
static ui32 __FRAME_END__[] __attribute__ ((__unused__)) = { 0 };
#endif /* CRT_END */
#endif /* OBJECT_FORMAT_MACHO */

View File

@ -1,221 +0,0 @@
This file lists known bugs in the GNU Fortran compiler. Copyright (C)
1995, 1996 Free Software Foundation, Inc. You may copy, distribute,
and modify it freely as long as you preserve this copyright notice and
permission notice.
Bugs in GNU Fortran
*******************
This section identifies bugs that `g77' *users* might run into.
This includes bugs that are actually in the `gcc' back end (GBE) or in
`libf2c', because those sets of code are at least somewhat under the
control of (and necessarily intertwined with) `g77', so it isn't worth
separating them out.
For information on bugs that might afflict people who configure,
port, build, and install `g77', *Note Problems Installing::.
* `g77' sometimes crashes when compiling code containing the
construct `CMPLX(0.)' or similar. This is a `gcc' back-end bug.
It can be worked around using `-fno-emulate-complex', though that
might trigger other, older bugs. Compiling without optimization
is another work-around.
Fixed in `egcs' 1.1.
* Automatic arrays aren't working on HP-UX systems, at least in
HP-UX version 10.20. Writing into them apparently causes
over-writing of statically declared data in the main program.
This probably means the arrays themselves are being
under-allocated, or pointers to them being improperly handled,
e.g. not passed to other procedures as they should be.
* Some Fortran code has been found to be miscompiled by `g77' built
on `gcc' version 2.8.1 on m68k-next-nextstep3 configurations when
using the `-O2' option. Even a C function is known to miscompile
on that configuration when using the `-O2 -funroll-loops' options.
Fixed in `egcs'.
* A code-generation bug afflicts Intel x86 targets when `-O2' is
specified compiling, for example, an old version of the `DNRM2'
routine. The x87 coprocessor stack is being mismanaged in cases
where assigned `GOTO' and `ASSIGN' are involved.
Fixed in `egcs' version 1.1.
* `g77' fails to warn about use of a "live" iterative-DO variable as
an implied-DO variable in a `WRITE' or `PRINT' statement (although
it does warn about this in a `READ' statement).
* A compiler crash, or apparently infinite run time, can result when
compiling complicated expressions involving `COMPLEX' arithmetic
(especially multiplication).
Fixed in `egcs' version 1.1.
* Something about `g77''s straightforward handling of label
references and definitions sometimes prevents the GBE from
unrolling loops. Until this is solved, try inserting or removing
`CONTINUE' statements as the terminal statement, using the `END DO'
form instead, and so on.
* Some confusion in diagnostics concerning failing `INCLUDE'
statements from within `INCLUDE''d or `#include''d files.
* `g77' assumes that `INTEGER(KIND=1)' constants range from `-2**31'
to `2**31-1' (the range for two's-complement 32-bit values),
instead of determining their range from the actual range of the
type for the configuration (and, someday, for the constant).
Further, it generally doesn't implement the handling of constants
very well in that it makes assumptions about the configuration
that it no longer makes regarding variables (types).
Included with this item is the fact that `g77' doesn't recognize
that, on IEEE-754/854-compliant systems, `0./0.' should produce a
NaN and no warning instead of the value `0.' and a warning. This
is to be fixed in version 0.6, when `g77' will use the `gcc' back
end's constant-handling mechanisms to replace its own.
* `g77' uses way too much memory and CPU time to process large
aggregate areas having any initialized elements.
For example, `REAL A(1000000)' followed by `DATA A(1)/1/' takes up
way too much time and space, including the size of the generated
assembler file. This is to be mitigated somewhat in version 0.6.
Version 0.5.18 improves cases like this--specifically, cases of
*sparse* initialization that leave large, contiguous areas
uninitialized--significantly. However, even with the
improvements, these cases still require too much memory and CPU
time.
(Version 0.5.18 also improves cases where the initial values are
zero to a much greater degree, so if the above example ends with
`DATA A(1)/0/', the compile-time performance will be about as good
as it will ever get, aside from unrelated improvements to the
compiler.)
Note that `g77' does display a warning message to notify the user
before the compiler appears to hang. *Note Initialization of
Large Aggregate Areas: Large Initialization, for information on
how to change the point at which `g77' decides to issue this
warning.
* `g77' doesn't emit variable and array members of common blocks for
use with a debugger (the `-g' command-line option). The code is
present to do this, but doesn't work with at least one debug
format--perhaps it works with others. And it turns out there's a
similar bug for local equivalence areas, so that has been disabled
as well.
As of Version 0.5.19, a temporary kludge solution is provided
whereby some rudimentary information on a member is written as a
string that is the member's value as a character string.
*Note Options for Code Generation Conventions: Code Gen Options,
for information on the `-fdebug-kludge' option.
* When debugging, after starting up the debugger but before being
able to see the source code for the main program unit, the user
must currently set a breakpoint at `MAIN__' (or `MAIN___' or
`MAIN_' if `MAIN__' doesn't exist) and run the program until it
hits the breakpoint. At that point, the main program unit is
activated and about to execute its first executable statement, but
that's the state in which the debugger should start up, as is the
case for languages like C.
* Debugging `g77'-compiled code using debuggers other than `gdb' is
likely not to work.
Getting `g77' and `gdb' to work together is a known
problem--getting `g77' to work properly with other debuggers, for
which source code often is unavailable to `g77' developers, seems
like a much larger, unknown problem, and is a lower priority than
making `g77' and `gdb' work together properly.
On the other hand, information about problems other debuggers have
with `g77' output might make it easier to properly fix `g77', and
perhaps even improve `gdb', so it is definitely welcome. Such
information might even lead to all relevant products working
together properly sooner.
* `g77' doesn't work perfectly on 64-bit configurations such as the
Digital Semiconductor ("DEC") Alpha.
This problem is largely resolved as of version 0.5.23. Version
0.6 should solve most or all remaining problems (such as
cross-compiling involving 64-bit machines).
* Maintainers of `gcc' report that the back end definitely has
"broken" support for `COMPLEX' types. Based on their input, it
seems many of the problems affect only the more-general facilities
for gcc's `__complex__' type, such as `__complex__ int' (where the
real and imaginary parts are integers) that GNU Fortran does not
use.
Version 0.5.20 of `g77' works around this problem by not using the
back end's support for `COMPLEX'. The new option
`-fno-emulate-complex' avoids the work-around, reverting to using
the same "broken" mechanism as that used by versions of `g77'
prior to 0.5.20.
* `g77' sometimes produces invalid assembler code when using the
`-fPIC' option (such as compiling for ELF targets) on the Intel
x86 architecture target. The symptom is that the assembler
complains about invalid opcodes. This bug is in the `gcc' back
end.
Fixed in `egcs' version 1.0.2.
* `g77' currently inserts needless padding for things like `COMMON
A,IPAD' where `A' is `CHARACTER*1' and `IPAD' is `INTEGER(KIND=1)'
on machines like x86, because the back end insists that `IPAD' be
aligned to a 4-byte boundary, but the processor has no such
requirement (though it is usually good for performance).
The `gcc' back end needs to provide a wider array of
specifications of alignment requirements and preferences for
targets, and front ends like `g77' should take advantage of this
when it becomes available.
* The x86 target's `-malign-double' option no longer reliably aligns
double-precision variables and arrays when they are placed in the
stack frame.
This can significantly reduce the performance of some applications,
even on a run-to-run basis (that is, performance measurements can
vary fairly widely depending on whether frequently used variables
are properly aligned, and that can change from one program run to
the next, even from one procedure call to the next).
Versions 0.5.22 and earlier of `g77' included a patch to `gcc'
that enabled this, but that patch has been deemed an improper
(probably buggy) one for version 2.8 of `gcc' and for `egcs'.
Note that version 1.1 of `egcs' aligns double-precision variables
and arrays when they are in static storage even if
`-malign-double' is not specified.
There is ongoing investigation into how to make `-malign-double'
work properly, also into how to make it unnecessary to get all
double-precision variables and arrays aligned when such alignment
would not violate the relevant specifications for processor and
inter-procedural interfaces.
For a suite of programs to test double-precision alignment, see
`ftp://alpha.gnu.org/gnu/g77/align/'.
* The `libf2c' routines that perform some run-time arithmetic on
`COMPLEX' operands were modified circa version 0.5.20 of `g77' to
work properly even in the presence of aliased operands.
While the `g77' and `netlib' versions of `libf2c' differ on how
this is accomplished, the main differences are that we believe the
`g77' version works properly even in the presence of *partially*
aliased operands.
However, these modifications have reduced performance on targets
such as x86, due to the extra copies of operands involved.

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

@ -1,472 +0,0 @@
# Top level makefile fragment for GNU Fortran. -*-makefile-*-
# Copyright (C) 1995-1998 Free Software Foundation, Inc.
#This file is part of GNU Fortran.
#GNU Fortran 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 Fortran 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 Fortran; 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.distdir,
# 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.
#
# $(srcdir) must be set to the gcc/ source directory (not gcc/f/).
#
# Actual name to use when installing a native compiler.
G77_INSTALL_NAME = `t='$(program_transform_name)'; echo g77 | sed $$t`
# Actual name to use when installing a cross-compiler.
G77_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g77 | sed $$t`
#
# Define the names for selecting f77 in LANGUAGES.
# Note that it would be nice to move the dependency on g77
# into the F77 rule, but that needs a little bit of work
# to do the right thing within all.cross.
F77 f77: f771$(exeext)
# Tell GNU make to ignore these if they exist.
.PHONY: F77 f77 f77.all.build f77.all.cross \
f77.start.encap f77.rest.encap f77.info f77.dvi \
f77.install-normal \
f77.install-common f77.install-info f77.install-man \
f77.uninstall f77.mostlyclean f77.clean f77.distclean \
f77.extraclean f77.maintainer-clean f77.distdir f77.rebuilt \
f77.stage1 f77.stage2 f77.stage3 f77.stage4
g77.c: $(srcdir)/gcc.c
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
if [ -f lang-f77 ]; then \
rm -f g77.c; \
$(LN_S) $(srcdir)/gcc.c g77.c; \
else true; fi
g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
if [ -f lang-f77 ]; then \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/f/g77spec.c; \
else true; fi
g77version.o: $(srcdir)/f/version.c
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
if [ -f lang-f77 ]; then \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -o g77version.o \
$(srcdir)/f/version.c; \
else true; fi
# N.B.: This is a copy of the gcc.o rule, with -DLANG_SPECIFIC_DRIVER added.
# It'd be nice if we could find an easier way to do this---rather than have
# to track changes to the toplevel gcc Makefile as well.
# We depend on g77.c last, to make it obvious where it came from.
g77.o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) g77.c prefix.h
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
if [ -f lang-f77 ]; then \
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(DRIVER_DEFINES) \
-DLANG_SPECIFIC_DRIVER -c g77.c; \
else true; fi
# Create the compiler driver for g77.
g77$(exeext): g77.o g77spec.o g77version.o version.o choose-temp.o pexecute.o prefix.o mkstemp.o \
$(LIBDEPS) $(EXTRA_GCC_OBJS)
if [ -f lang-f77 ]; then \
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ g77.o g77spec.o g77version.o \
version.o choose-temp.o pexecute.o prefix.o mkstemp.o $(EXTRA_GCC_OBJS) $(LIBS); \
else true; fi
# Create a version of the g77 driver which calls the cross-compiler.
g77-cross$(exeext): g77$(exeext)
if [ -f lang-f77 ]; then \
rm -f g77-cross$(exeext); \
cp g77$(exeext) g77-cross$(exeext); \
else true; fi
F77_SRCS = \
$(srcdir)/f/assert.j \
$(srcdir)/f/bad.c \
$(srcdir)/f/bad.def \
$(srcdir)/f/bad.h \
$(srcdir)/f/bit.c \
$(srcdir)/f/bit.h \
$(srcdir)/f/bld-op.def \
$(srcdir)/f/bld.c \
$(srcdir)/f/bld.h \
$(srcdir)/f/com-rt.def \
$(srcdir)/f/com.c \
$(srcdir)/f/com.h \
$(srcdir)/f/config.j \
$(srcdir)/f/convert.j \
$(srcdir)/f/data.c \
$(srcdir)/f/data.h \
$(srcdir)/f/equiv.c \
$(srcdir)/f/equiv.h \
$(srcdir)/f/expr.c \
$(srcdir)/f/expr.h \
$(srcdir)/f/fini.c \
$(srcdir)/f/flags.j \
$(srcdir)/f/glimits.j \
$(srcdir)/f/global.c \
$(srcdir)/f/global.h \
$(srcdir)/f/hconfig.j \
$(srcdir)/f/implic.c \
$(srcdir)/f/implic.h \
$(srcdir)/f/input.j \
$(srcdir)/f/info-b.def \
$(srcdir)/f/info-k.def \
$(srcdir)/f/info-w.def \
$(srcdir)/f/info.c \
$(srcdir)/f/info.h \
$(srcdir)/f/intrin.c \
$(srcdir)/f/intrin.def \
$(srcdir)/f/intrin.h \
$(srcdir)/f/lab.c \
$(srcdir)/f/lab.h \
$(srcdir)/f/lex.c \
$(srcdir)/f/lex.h \
$(srcdir)/f/malloc.c \
$(srcdir)/f/malloc.h \
$(srcdir)/f/name.c \
$(srcdir)/f/name.h \
$(srcdir)/f/output.j \
$(srcdir)/f/parse.c \
$(srcdir)/f/proj.c \
$(srcdir)/f/proj.h \
$(srcdir)/f/rtl.j \
$(srcdir)/f/src.c \
$(srcdir)/f/src.h \
$(srcdir)/f/st.c \
$(srcdir)/f/st.h \
$(srcdir)/f/sta.c \
$(srcdir)/f/sta.h \
$(srcdir)/f/stb.c \
$(srcdir)/f/stb.h \
$(srcdir)/f/stc.c \
$(srcdir)/f/stc.h \
$(srcdir)/f/std.c \
$(srcdir)/f/std.h \
$(srcdir)/f/ste.c \
$(srcdir)/f/ste.h \
$(srcdir)/f/storag.c \
$(srcdir)/f/storag.h \
$(srcdir)/f/stp.c \
$(srcdir)/f/stp.h \
$(srcdir)/f/str-1t.fin \
$(srcdir)/f/str-2t.fin \
$(srcdir)/f/str-fo.fin \
$(srcdir)/f/str-io.fin \
$(srcdir)/f/str-nq.fin \
$(srcdir)/f/str-op.fin \
$(srcdir)/f/str-ot.fin \
$(srcdir)/f/str.c \
$(srcdir)/f/str.h \
$(srcdir)/f/sts.c \
$(srcdir)/f/sts.h \
$(srcdir)/f/stt.c \
$(srcdir)/f/stt.h \
$(srcdir)/f/stu.c \
$(srcdir)/f/stu.h \
$(srcdir)/f/stv.c \
$(srcdir)/f/stv.h \
$(srcdir)/f/stw.c \
$(srcdir)/f/stw.h \
$(srcdir)/f/symbol.c \
$(srcdir)/f/symbol.def \
$(srcdir)/f/symbol.h \
$(srcdir)/f/system.j \
$(srcdir)/f/target.c \
$(srcdir)/f/target.h \
$(srcdir)/f/tconfig.j \
$(srcdir)/f/tm.j \
$(srcdir)/f/top.c \
$(srcdir)/f/top.h \
$(srcdir)/f/toplev.j \
$(srcdir)/f/tree.j \
$(srcdir)/f/type.c \
$(srcdir)/f/type.h \
$(srcdir)/f/version.c \
$(srcdir)/f/version.h \
$(srcdir)/f/where.c \
$(srcdir)/f/where.h
f771$(exeext): $(P) $(F77_SRCS) $(LIBDEPS) stamp-objlist
touch lang-f77
cd f; $(MAKE) $(FLAGS_TO_PASS) \
HOST_CC="$(HOST_CC)" HOST_CFLAGS="$(HOST_CFLAGS)" HOST_CPPFLAGS="$(HOST_CPPFLAGS)" \
../f771$(exeext)
#
# Build hooks:
f77.all.build: g77$(exeext)
f77.all.cross: g77-cross$(exeext)
f77.start.encap: g77$(exeext)
f77.rest.encap:
f77.info: f/g77.info
f77.dvi: f/g77.dvi
# g77 documentation.
f/g77.info: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
$(srcdir)/f/g77install.texi $(srcdir)/f/news.texi \
$(srcdir)/f/intdoc.texi
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
if [ -f lang-f77 ]; then \
rm -f $(srcdir)/f/g77.info-*; \
$(MAKEINFO) -I$(srcdir)/f -o f/g77.info $(srcdir)/f/g77.texi; \
else true; fi
f/g77.dvi: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
$(srcdir)/f/g77install.texi $(srcdir)/f/news.texi \
$(srcdir)/f/intdoc.texi
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
# `tex2dvi' was used below, but the Texinfo 3.12 one won't work properly
# with the include files from $(srcdir). This use of TEXINPUTS may not
# be universally valid. `$(TEX)' should be used if it gets defined in
# gcc/Makefile.in.
if [ -f lang-f77 ]; then \
TEXINPUTS=$(srcdir)/f:$$TEXINPUTS tex $(srcdir)/f/g77.texi; \
texindex g77.??; \
TEXINPUTS=$(srcdir)/f:$$TEXINPUTS tex $(srcdir)/f/g77.texi; \
mv g77.dvi f; \
else true; fi
# This dance is all about producing accurate documentation for g77's
# intrinsics with minimum fuss. f/ansify appends "\n\" to C strings
# so ANSI C compilers can compile f/intdoc.h -- gcc can compile f/intdoc.in
# directly, if f/intdoc.c #include'd that, but we don't want to force
# people to install gcc just to build the documentation. We use the
# C format for f/intdoc.in in the first place to allow a fairly "free",
# but widely known format for documentation -- basically anyone who knows
# how to write texinfo source and enclose it in C constants can handle
# it, and f/ansify allows them to not even end lines with "\n\". So,
# essentially, the C preprocessor and compiler are used to enter the
# document snippets into a data base via name lookup, rather than duplicating
# that kind of code here. And we use f/intdoc.c instead of straight
# texinfo in the first place so that as much information as possible
# contained in f/intrin.def can be inserted directly and reliably into
# the documentation. That's better than replicating it, because it
# reduces the likelihood of discrepancies between the docs and the compiler
# itself, which uses f/intrin.def; in fact, many bugs in f/intrin.def have
# been found only upon reading the documentation that was automatically
# produced from it.
$(srcdir)/f/intdoc.texi: f/intdoc.c f/intdoc.in f/ansify.c f/intrin.def f/intrin.h
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
if [ -f lang-f77 ]; then \
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) $(INCLUDES) \
`echo $(srcdir)/f/ansify.c | sed 's,^\./,,'` -o f/ansify; \
f/ansify < $(srcdir)/f/intdoc.in > f/intdoc.h0 $(srcdir)/f/intdoc.in; \
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) $(INCLUDES) -I./f \
`echo $(srcdir)/f/intdoc.c | sed 's,^\./,,'` -o f/intdoc; \
f/intdoc > $(srcdir)/f/intdoc.texi; \
rm f/intdoc f/ansify f/intdoc.h0; \
else true; fi
$(srcdir)/f/BUGS: f/bugs0.texi f/bugs.texi
cd $(srcdir)/f; $(MAKEINFO) -D BUGSONLY --no-header --no-split \
--no-validate -o BUGS bugs0.texi
$(srcdir)/f/INSTALL: f/install0.texi f/g77install.texi
cd $(srcdir)/f; $(MAKEINFO) -D INSTALLONLY --no-header --no-split \
--no-validate -o INSTALL install0.texi
$(srcdir)/f/NEWS: f/news0.texi f/news.texi
cd $(srcdir)/f; $(MAKEINFO) -D NEWSONLY --no-header --no-split \
--no-validate -o NEWS news0.texi
f77.rebuilt: f/g77.info $(srcdir)/f/BUGS $(srcdir)/f/INSTALL \
$(srcdir)/f/NEWS
#
# Install hooks:
# f771 is installed elsewhere as part of $(COMPILERS).
f77.install-normal:
# Install the driver program as $(target)-g77
# and also as either g77 (if native) or $(tooldir)/bin/g77.
f77.install-common:
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
-if [ -f lang-f77 -a -f f771$(exeext) ] ; then \
if [ -f g77-cross$(exeext) ] ; then \
rm -f $(bindir)/$(G77_CROSS_NAME)$(exeext); \
$(INSTALL_PROGRAM) g77-cross$(exeext) $(bindir)/$(G77_CROSS_NAME)$(exeext); \
chmod a+x $(bindir)/$(G77_CROSS_NAME)$(exeext); \
else \
rm -f $(bindir)/$(G77_INSTALL_NAME)$(exeext); \
$(INSTALL_PROGRAM) g77$(exeext) $(bindir)/$(G77_INSTALL_NAME)$(exeext); \
chmod a+x $(bindir)/$(G77_INSTALL_NAME)$(exeext); \
fi ; \
else true; fi
@if [ -f f77-install-ok -o -f $(srcdir)/f77-install-ok ]; then \
echo ''; \
echo 'Warning: egcs no longer installs an f77 command.'; \
echo ' You must do so yourself. For more information,'; \
echo ' read "Distributing Binaries" in the egcs g77 docs.'; \
echo ' (To turn off this warning, delete the file'; \
echo ' f77-install-ok in the source or build directory.)'; \
echo ''; \
else true; fi
# $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
# to do the install. The sed rule was copied from stmp-int-hdrs.
f77.install-info: f77.info
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
if [ -f lang-f77 -a -f f/g77.info ] ; then \
rm -f $(infodir)/g77.info*; \
for f in f/g77.info*; do \
realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
$(INSTALL_DATA) $$f $(infodir)/$$realfile; \
done; \
chmod a-x $(infodir)/g77.info*; \
else true; fi
@if [ -f lang-f77 -a -f $(srcdir)/f/g77.info ] ; then \
if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
echo " install-info --info-dir=$(infodir) $(infodir)/g77.info"; \
install-info --info-dir=$(infodir) $(infodir)/g77.info || : ; \
else : ; fi; \
else : ; fi
f77.install-man: $(srcdir)/f/g77.1
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
-if [ -f lang-f77 -a -f f771$(exeext) ] ; then \
if [ -f g77-cross$(exeext) ] ; then \
rm -f $(man1dir)/$(G77_CROSS_NAME)$(manext); \
$(INSTALL_DATA) $(srcdir)/f/g77.1 $(man1dir)/$(G77_CROSS_NAME)$(manext); \
chmod a-x $(man1dir)/$(G77_CROSS_NAME)$(manext); \
else \
rm -f $(man1dir)/$(G77_INSTALL_NAME)$(manext); \
$(INSTALL_DATA) $(srcdir)/f/g77.1 $(man1dir)/$(G77_INSTALL_NAME)$(manext); \
chmod a-x $(man1dir)/$(G77_INSTALL_NAME)$(manext); \
fi; \
else true; fi
f77.uninstall:
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
@if [ -f lang-f77 ] ; then \
if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
echo " install-info --delete --info-dir=$(infodir) $(infodir)/g77.info"; \
install-info --delete --info-dir=$(infodir) $(infodir)/g77.info || : ; \
else : ; fi; \
else : ; fi
-if [ -f lang-f77 ]; then \
rm -rf $(bindir)/$(G77_INSTALL_NAME)$(exeext); \
rm -rf $(bindir)/$(G77_CROSS_NAME)$(exeext); \
rm -rf $(man1dir)/$(G77_INSTALL_NAME)$(manext); \
rm -rf $(man1dir)/$(G77_CROSS_NAME)$(manext); \
rm -rf $(infodir)/g77.info*; \
fi
#
# Clean hooks:
# A lot of the ancillary files are deleted by the main makefile.
# We just have to delete files specific to us.
f77.mostlyclean:
-rm -f f/*$(objext)
-rm -f f/fini f/stamp-str f/str-*.h f/str-*.j
-rm -f f/intdoc f/ansify f/intdoc.h0
-rm -f g77.aux g77.cps g77.ky g77.toc g77.vr g77.fn g77.kys \
g77.pg g77.tp g77.vrs g77.cp g77.fns g77.log g77.pgs g77.tps
f77.clean:
-rm -f g77.c g77.o g77spec.o g77version.o
f77.distclean:
-rm -f lang-f77 f/Makefile
f77.extraclean:
f77.maintainer-clean:
-rm -f f/g77.info* f/g77.*aux f/TAGS f/BUGS f/INSTALL f/NEWS f/intdoc.texi
#
# Stage hooks:
# The main makefile has already created stage?/f.
G77STAGESTUFF = f/*$(objext) f/fini f/stamp-str f/str-*.h f/str-*.j \
lang-f77 g77.c g77.o g77spec.o g77version.o
f77.stage1: stage1-start
-if [ -f lang-f77 ]; then \
mv -f $(G77STAGESTUFF) stage1/f; \
fi
f77.stage2: stage2-start
-if [ -f lang-f77 ]; then \
mv -f $(G77STAGESTUFF) stage2/f; \
fi
f77.stage3: stage3-start
-if [ -f lang-f77 ]; then \
mv -f $(G77STAGESTUFF) stage3/f; \
fi
f77.stage4: stage4-start
-if [ -f lang-f77 ]; then \
mv -f $(G77STAGESTUFF) stage4/f; \
fi
#
# Maintenance hooks:
# This target creates the files that can be rebuilt, but go in the
# distribution anyway. It then copies the files to the distdir directory.
f77.distdir: f77.rebuilt
case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \
esac
-if [ -f lang-f77 ]; then \
mkdir tmp/f; \
cd f; \
for file in *[0-9a-zA-Z+]; do \
$(LN_S) $$file ../tmp/f; \
done; \
fi

View File

@ -1,529 +0,0 @@
# Makefile for GNU F77 compiler.
# Copyright (C) 1995-1998 Free Software Foundation, Inc.
#This file is part of GNU Fortran.
#GNU Fortran 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 Fortran 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 Fortran; 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.
# Its purpose is to provide support for:
#
# 1) recursion where necessary, and only then (building .o's), and
# 2) building and debugging f771 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.
ALLOCA =
# 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@
BISON = bison
BISONFLAGS =
LEX = flex
LEXFLAGS =
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 in the definition of SUBDIR_USE_ALLOCA.
# ??? Perhaps it would be better if it just looked for *gcc*.
OLDCC = cc
# 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.
target=@target@
xmake_file=@dep_host_xmake_file@
tmake_file=@dep_tmake_file@
# Directory where sources are, from where we are.
srcdir = @srcdir@
VPATH = @srcdir@
# Additional system libraries to link with.
CLIB=
# Change this to a null string if obstacks are installed in the
# system library.
OBSTACK=obstack.o
# Choose the real default target.
ALL=all
# 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@
####cross overrides
@cross_defines@
@cross_overrides@
####build overrides
@build_overrides@
#
# Now figure out from those variables how to compile and link.
all.indirect: Makefile ../f771$(exeext)
# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
# This is the variable actually used when we compile.
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) -W -Wall
# Likewise.
ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
# We should be compiling with the built compiler, for which
# BOOT_LDFLAGS is appropriate. (Formerly we had a separate
# F771_LDFLAGS, but the ld flags can be taken care of by the target
# configuration files in egcs.)
LDFLAGS=$(BOOT_LDFLAGS)
# Even if ALLOCA is set, don't use it if compiling with GCC.
SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
# 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
# Always use -I$(srcdir)/config when compiling.
.c.o:
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
#
# Lists of files for various purposes.
# Language-specific object files for g77
F77_OBJS = \
bad.o \
bit.o \
bld.o \
com.o \
data.o \
equiv.o \
expr.o \
global.o \
implic.o \
info.o \
intrin.o \
lab.o \
lex.o \
malloc.o \
name.o \
parse.o \
proj.o \
src.o \
st.o \
sta.o \
stb.o \
stc.o \
std.o \
ste.o \
storag.o \
stp.o \
str.o \
sts.o \
stt.o \
stu.o \
stv.o \
stw.o \
symbol.o \
target.o \
top.o \
type.o \
version.o \
where.o
# Language-independent object files.
OBJS = `cat ../stamp-objlist`
OBJDEPS = ../stamp-objlist
compiler: ../f771$(exeext)
../f771$(exeext): $(P) $(F77_OBJS) $(OBJDEPS) $(LIBDEPS)
rm -f f771$(exeext)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(F77_OBJS) $(OBJS) $(LIBS)
Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
cd ..; $(SHELL) config.status
native: config.status ../f771$(exeext)
#
# Compiling object files from source files.
# Note that dependencies on obstack.h are not written
# because that file is not part of GCC.
# F77 language-specific files.
# These macros expand to the corresponding g77-source .j files plus
# the gcc-source files involved (each file itself, plus whatever
# files on which it depends, but without including stuff resulting
# from configuration, since we can't guess at that). The files
# that live in a distclean'd gcc source directory have "$(srcdir)/"
# prefixes, while the others don't because they'll be created
# only in the build directory.
ASSERT_H = $(srcdir)/assert.j $(srcdir)/../assert.h
CONFIG_H = $(srcdir)/config.j ../config.h
CONVERT_H = $(srcdir)/convert.j $(srcdir)/../convert.h
FLAGS_H = $(srcdir)/flags.j $(srcdir)/../flags.h
GLIMITS_H = $(srcdir)/glimits.j $(srcdir)/../glimits.h
HCONFIG_H = $(srcdir)/hconfig.j ../hconfig.h
INPUT_H = $(srcdir)/input.j $(srcdir)/../input.h
OUTPUT_H = $(srcdir)/output.j $(srcdir)/../output.h
RTL_H = $(srcdir)/rtl.j $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
SYSTEM_H = $(srcdir)/system.j $(srcdir)/../system.h
TCONFIG_H = $(srcdir)/tconfig.j ../tconfig.h
TM_H = $(srcdir)/tm.j ../tm.h
TOPLEV_H = $(srcdir)/toplev.j $(srcdir)/../toplev.h
TREE_H = $(srcdir)/tree.j $(srcdir)/../tree.h $(srcdir)/../real.h \
$(srcdir)/../tree.def $(srcdir)/../machmode.h $(srcdir)/../machmode.def
#Build the first part of this list with the command line:
# cd gcc/; make deps-kinda -f f/Makefile.in
#Note that this command uses the host C compiler;
# use HOST_CC="./xgcc -B./" to use GCC in the build directory, for example.
#Also note that this particular build file seems to want to use
# substitions: $(CONFIG_H) for config.h; $(TREE_H) for tree.h;
# $(RTL_H) for rtl.h; etc.. deps-kinda uses a sed script to do those
# substitutions, plus others for elegance.
ansify.o: ansify.c $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H)
bad.o: bad.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bad.h bad.def where.h \
$(GLIMITS_H) top.h malloc.h $(FLAGS_H) com.h com-rt.def $(TREE_H) bld.h \
bld-op.def bit.h info.h info-b.def info-k.def info-w.def target.h \
lex.h type.h intrin.h intrin.def lab.h symbol.h symbol.def equiv.h \
storag.h global.h name.h $(TOPLEV_H)
bit.o: bit.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H) bit.h \
malloc.h
bld.o: bld.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bld.h bld-op.def bit.h \
malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
intrin.h intrin.def
com.o: com.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(FLAGS_H) $(RTL_H) $(TOPLEV_H) \
$(TREE_H) $(OUTPUT_H) $(CONVERT_H) com.h com-rt.def bld.h bld-op.def bit.h \
malloc.h info.h info-b.def info-k.def info-w.def target.h bad.h \
bad.def where.h $(GLIMITS_H) top.h lex.h type.h intrin.h intrin.def \
lab.h symbol.h symbol.def equiv.h storag.h global.h name.h expr.h \
implic.h src.h st.h
data.o: data.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) data.h bld.h \
bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
name.h intrin.h intrin.def expr.h st.h
equiv.o: equiv.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) equiv.h bld.h \
bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
lex.h type.h lab.h storag.h symbol.h symbol.def global.h name.h \
intrin.h intrin.def data.h
expr.o: expr.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) expr.h bld.h \
bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
name.h intrin.h intrin.def implic.h src.h st.h stamp-str
fini.o: fini.c proj.h $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H) malloc.h
global.o: global.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) global.h info.h \
info-b.def info-k.def info-w.def target.h $(TREE_H) bad.h bad.def \
where.h $(GLIMITS_H) top.h malloc.h lex.h type.h name.h symbol.h \
symbol.def bld.h bld-op.def bit.h com.h com-rt.def lab.h storag.h \
intrin.h intrin.def equiv.h
implic.o: implic.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) implic.h info.h \
info-b.def info-k.def info-w.def target.h $(TREE_H) bad.h bad.def \
where.h $(GLIMITS_H) top.h malloc.h lex.h type.h symbol.h symbol.def \
bld.h bld-op.def bit.h com.h com-rt.def lab.h storag.h intrin.h \
intrin.def equiv.h global.h name.h src.h
info.o: info.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) info.h info-b.def \
info-k.def info-w.def target.h $(TREE_H) bad.h bad.def where.h $(GLIMITS_H) \
top.h malloc.h lex.h type.h
intdoc.o: intdoc.c $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H) intrin.h intrin.def \
intdoc.h0 intdoc.h0
intrin.o: intrin.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) intrin.h \
intrin.def bld.h bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) \
info.h info-b.def info-k.def info-w.def target.h bad.h bad.def \
where.h $(GLIMITS_H) top.h lex.h type.h lab.h storag.h symbol.h \
symbol.def equiv.h global.h name.h expr.h src.h
lab.o: lab.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) lab.h com.h com-rt.def \
$(TREE_H) bld.h bld-op.def bit.h malloc.h info.h info-b.def info-k.def \
info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
type.h intrin.h intrin.def symbol.h symbol.def equiv.h storag.h \
global.h name.h
lex.o: lex.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) top.h malloc.h where.h \
$(GLIMITS_H) bad.h bad.def com.h com-rt.def $(TREE_H) bld.h bld-op.def \
bit.h info.h info-b.def info-k.def info-w.def target.h lex.h type.h \
intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \
global.h name.h src.h $(FLAGS_H) $(INPUT_H) $(TOPLEV_H) $(OUTPUT_H)
malloc.o: malloc.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) malloc.h
name.o: name.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bad.h bad.def where.h \
$(GLIMITS_H) top.h malloc.h name.h global.h info.h info-b.def info-k.def \
info-w.def target.h $(TREE_H) lex.h type.h symbol.h symbol.def bld.h \
bld-op.def bit.h com.h com-rt.def lab.h storag.h intrin.h intrin.def \
equiv.h src.h
parse.o: parse.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) top.h malloc.h \
where.h $(GLIMITS_H) com.h com-rt.def $(TREE_H) bld.h bld-op.def bit.h \
info.h info-b.def info-k.def info-w.def target.h bad.h bad.def lex.h \
type.h intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \
global.h name.h version.h $(FLAGS_H)
proj.o: proj.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H)
src.o: src.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) src.h bad.h bad.def \
where.h $(GLIMITS_H) top.h malloc.h
st.o: st.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) st.h bad.h bad.def \
where.h $(GLIMITS_H) top.h malloc.h lex.h symbol.h symbol.def bld.h \
bld-op.def bit.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
info-w.def target.h type.h lab.h storag.h intrin.h intrin.def equiv.h \
global.h name.h sta.h stamp-str stb.h expr.h stp.h stt.h stc.h std.h \
stv.h stw.h ste.h sts.h stu.h
sta.o: sta.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) sta.h bad.h bad.def \
where.h $(GLIMITS_H) top.h malloc.h lex.h stamp-str symbol.h symbol.def \
bld.h bld-op.def bit.h com.h com-rt.def $(TREE_H) info.h info-b.def \
info-k.def info-w.def target.h type.h lab.h storag.h intrin.h \
intrin.def equiv.h global.h name.h implic.h stb.h expr.h stp.h stt.h \
stc.h std.h stv.h stw.h
stb.o: stb.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stb.h bad.h bad.def \
where.h $(GLIMITS_H) top.h malloc.h expr.h bld.h bld-op.def bit.h com.h \
com-rt.def $(TREE_H) info.h info-b.def info-k.def info-w.def target.h \
lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
name.h intrin.h intrin.def stp.h stt.h stamp-str src.h sta.h stc.h
stc.o: stc.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stc.h bad.h bad.def \
where.h $(GLIMITS_H) top.h malloc.h bld.h bld-op.def bit.h com.h \
com-rt.def $(TREE_H) info.h info-b.def info-k.def info-w.def target.h \
lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
name.h intrin.h intrin.def expr.h stp.h stt.h stamp-str data.h implic.h \
src.h sta.h std.h stv.h stw.h
std.o: std.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) std.h bld.h bld-op.def \
bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
intrin.h intrin.def stp.h stt.h stamp-str stv.h stw.h sta.h ste.h sts.h
ste.o: ste.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(RTL_H) $(TOPLEV_H) ste.h \
bld.h bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h \
info-b.def info-k.def info-w.def target.h bad.h bad.def where.h \
$(GLIMITS_H) top.h lex.h type.h lab.h storag.h symbol.h symbol.def \
equiv.h global.h name.h intrin.h intrin.def stp.h stt.h stamp-str sts.h \
stv.h stw.h expr.h sta.h
storag.o: storag.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) storag.h bld.h \
bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
lex.h type.h lab.h symbol.h symbol.def equiv.h global.h name.h \
intrin.h intrin.def data.h
stp.o: stp.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stp.h bld.h bld-op.def \
bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
intrin.h intrin.def stt.h
str.o: str.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) src.h bad.h bad.def \
where.h $(GLIMITS_H) top.h malloc.h stamp-str lex.h
sts.o: sts.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) sts.h malloc.h com.h \
com-rt.def $(TREE_H) bld.h bld-op.def bit.h info.h info-b.def info-k.def \
info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
type.h intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \
global.h name.h
stt.o: stt.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stt.h top.h malloc.h \
where.h $(GLIMITS_H) bld.h bld-op.def bit.h com.h com-rt.def $(TREE_H) \
info.h info-b.def info-k.def info-w.def target.h bad.h bad.def lex.h \
type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
intrin.h intrin.def stp.h expr.h sta.h stamp-str
stu.o: stu.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bld.h bld-op.def bit.h \
malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
intrin.h intrin.def implic.h stu.h sta.h stamp-str
stv.o: stv.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stv.h lab.h com.h \
com-rt.def $(TREE_H) bld.h bld-op.def bit.h malloc.h info.h info-b.def \
info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
lex.h type.h intrin.h intrin.def symbol.h symbol.def equiv.h storag.h \
global.h name.h
stw.o: stw.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stw.h bld.h bld-op.def \
bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
intrin.h intrin.def stv.h sta.h stamp-str
symbol.o: symbol.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) symbol.h \
symbol.def bld.h bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) \
info.h info-b.def info-k.def info-w.def target.h bad.h bad.def \
where.h $(GLIMITS_H) top.h lex.h type.h lab.h storag.h intrin.h \
intrin.def equiv.h global.h name.h src.h st.h
target.o: target.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H) \
target.h $(TREE_H) bad.h bad.def where.h top.h malloc.h info.h \
info-b.def info-k.def info-w.def type.h lex.h
top.o: top.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) top.h malloc.h where.h \
$(GLIMITS_H) bad.h bad.def bit.h bld.h bld-op.def com.h com-rt.def \
$(TREE_H) info.h info-b.def info-k.def info-w.def target.h lex.h type.h \
lab.h storag.h symbol.h symbol.def equiv.h global.h name.h intrin.h \
intrin.def data.h expr.h implic.h src.h st.h $(FLAGS_H) $(TOPLEV_H)
type.o: type.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) type.h malloc.h
version.o: version.c
where.o: where.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) where.h $(GLIMITS_H) \
top.h malloc.h lex.h
# The rest of this list (Fortran 77 language-specific files) is hand-generated.
stamp-str: str-1t.h str-1t.j str-2t.h str-2t.j \
str-fo.h str-fo.j str-io.h str-io.j str-nq.h str-nq.j \
str-op.h str-op.j str-ot.h str-ot.j
touch stamp-str
str-1t.h str-1t.j: fini str-1t.fin
./fini `echo $(srcdir)/str-1t.fin | sed 's,^\./,,'` str-1t.j str-1t.h
str-2t.h str-2t.j: fini str-2t.fin
./fini `echo $(srcdir)/str-2t.fin | sed 's,^\./,,'` str-2t.j str-2t.h
str-fo.h str-fo.j: fini str-fo.fin
./fini `echo $(srcdir)/str-fo.fin | sed 's,^\./,,'` str-fo.j str-fo.h
str-io.h str-io.j: fini str-io.fin
./fini `echo $(srcdir)/str-io.fin | sed 's,^\./,,'` str-io.j str-io.h
str-nq.h str-nq.j: fini str-nq.fin
./fini `echo $(srcdir)/str-nq.fin | sed 's,^\./,,'` str-nq.j str-nq.h
str-op.h str-op.j: fini str-op.fin
./fini `echo $(srcdir)/str-op.fin | sed 's,^\./,,'` str-op.j str-op.h
str-ot.h str-ot.j: fini str-ot.fin
./fini `echo $(srcdir)/str-ot.fin | sed 's,^\./,,'` str-ot.j str-ot.h
fini: fini.o proj-h.o
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o fini fini.o proj-h.o
fini.o:
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
`echo $(srcdir)/fini.c | sed 's,^\./,,'` -o $@
# Like proj.o, but depends on hconfig.h instead of config.h.
proj-h.o: proj.c proj.h $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H)
$(HOST_CC) -c -DUSE_HCONFIG $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
`echo $(srcdir)/proj.c | sed 's,^\./,,'` -o $@
# Other than str-*.j, the *.j files are dummy #include files
# that normally just #include the corresponding back-end *.h
# files, but not if MAKING_DEPENDENCIES is #defined. The str-*.j
# files also are not actually included if MAKING_DEPENDENCIES
# is #defined. The point of all this is to come up with a clean
# dependencies list whether working in a clean directory, such
# that str-*.j and such do not exist, or in a directory full
# of already-built files. Any dependency on a str-*.j file
# implies a dependency on str.h, so we key on that to replace
# it with stamp-str, and dependencies on the other *.j files
# are generally left alone (modulo special macros like RTL_H)
# because we might not want to recompile all of g77 just
# because a back-end file changes. MG is usually "-MG" but
# should be defined with "make MG= deps-kinda..." if using
# a compiler that doesn't support -MG (gcc does as of 2.6) --
# it prevents diagnostics when an #include file is missing,
# as will be the case with proj.h in a clean directory.
MG=-MG
deps-kinda:
$(HOST_CC) -DMAKING_DEPENDENCIES -MM $(MG) *.c 2>&1 | \
sed -e 's: \([.]/\)*assert[.]j: $$(ASSERT_H):g' \
-e 's: \([.]/\)*config[.]j: $$(CONFIG_H):g' \
-e 's: \([.]/\)*convert[.]j: $$(CONVERT_H):g' \
-e 's: \([.]/\)*flags[.]j: $$(FLAGS_H):g' \
-e 's: \([.]/\)*glimits[.]j: $$(GLIMITS_H):g' \
-e 's: \([.]/\)*hconfig[.]j: $$(HCONFIG_H):g' \
-e 's: \([.]/\)*input[.]j: $$(INPUT_H):g' \
-e 's: \([.]/\)*output[.]j: $$(OUTPUT_H):g' \
-e 's: \([.]/\)*rtl[.]j: $$(RTL_H):g' \
-e 's: \([.]/\)*system[.]j: $$(SYSTEM_H):g' \
-e 's: \([.]/\)*tconfig[.]j: $$(TCONFIG_H):g' \
-e 's: \([.]/\)*tm[.]j: $$(TM_H):g' \
-e 's: \([.]/\)*toplev[.]j: $$(TOPLEV_H):g' \
-e 's: \([.]/\)*tree[.]j: $$(TREE_H):g' \
-e 's: \([.]/\)*str[.]h: stamp-str:g' \
-e 's:.*g77spec.*::g' \
-e 's%^\(.*\)[ ]*: %\1: %g'
# This rule is just a handy way to build the g77 derived files without
# having the gcc source tree around.
g77-only: force
if [ -f g77.texi ] ; then \
(cd ..; $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt); \
else \
$(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt; \
fi
#
# These exist for maintenance purposes.
# Update the tags table.
TAGS: force
cd $(srcdir)/f ; \
etags *.c *.h ; \
echo 'l' | tr 'l' '\f' >> TAGS ; \
etags -a ../*.h ../*.c;
.PHONY: none all all.indirect f77.rebuilt compiler native deps-kinda g77-only TAGS force
force:

1603
gcc/f/NEWS

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +0,0 @@
1995-02-15
This directory is the f/ subdirectory, which is designed to
be a subdirectory in a gcc development tree, i.e. named gcc/f/.
Please see gcc/README.g77 for information on the contents of this
directory.

View File

@ -1,208 +0,0 @@
/* ansify.c
Copyright (C) 1997 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
/* From f/proj.h, which uses #error -- not all C compilers
support that, and we want *this* program to be compilable
by pretty much any C compiler. */
#include "hconfig.j"
#include "system.j"
#include "assert.j"
#if HAVE_STDDEF_H
#include <stddef.h>
#endif
typedef enum
{
#if !defined(false) || !defined(true)
false = 0, true = 1,
#endif
#if !defined(FALSE) || !defined(TRUE)
FALSE = 0, TRUE = 1,
#endif
Doggone_Trailing_Comma_Dont_Work = 1
} bool;
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
#define die_unless(c) \
do if (!(c)) \
{ \
fprintf (stderr, "%s:%lu: " #c "\n", argv[1], lineno); \
die (); \
} \
while(0)
static void
die ()
{
exit (1);
}
int
main(int argc, char **argv)
{
int c;
static unsigned long lineno = 1;
die_unless (argc == 2);
printf ("\
/* This file is automatically generated from `%s',\n\
which you should modify instead. */\n\
# 1 \"%s\"\n\
",
argv[1], argv[1]);
while ((c = getchar ()) != EOF)
{
switch (c)
{
default:
putchar (c);
break;
case '\n':
++lineno;
putchar (c);
break;
case '"':
putchar (c);
for (;;)
{
c = getchar ();
die_unless (c != EOF);
switch (c)
{
case '"':
putchar (c);
goto next_char;
case '\n':
putchar ('\\');
putchar ('n');
putchar ('\\');
putchar ('\n');
++lineno;
break;
case '\\':
putchar (c);
c = getchar ();
die_unless (c != EOF);
putchar (c);
if (c == '\n')
++lineno;
break;
default:
putchar (c);
break;
}
}
break;
case '\'':
putchar (c);
for (;;)
{
c = getchar ();
die_unless (c != EOF);
switch (c)
{
case '\'':
putchar (c);
goto next_char;
case '\n':
putchar ('\\');
putchar ('n');
putchar ('\\');
putchar ('\n');
++lineno;
break;
case '\\':
putchar (c);
c = getchar ();
die_unless (c != EOF);
putchar (c);
if (c == '\n')
++lineno;
break;
default:
putchar (c);
break;
}
}
break;
case '/':
putchar (c);
c = getchar ();
putchar (c);
if (c != '*')
break;
for (;;)
{
c = getchar ();
die_unless (c != EOF);
switch (c)
{
case '\n':
++lineno;
putchar (c);
break;
case '*':
c = getchar ();
die_unless (c != EOF);
if (c == '/')
{
putchar ('*');
putchar ('/');
goto next_char;
}
if (c == '\n')
{
++lineno;
putchar (c);
}
break;
default:
/* Don't bother outputting content of comments. */
break;
}
}
break;
}
next_char:
;
}
die_unless (c == EOF);
return 0;
}

View File

@ -1,27 +0,0 @@
/* assert.j -- Wrapper for GCC's assert.h
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#ifndef MAKING_DEPENDENCIES
#ifndef _J_f_assert
#define _J_f_assert
#include "assert.h"
#endif
#endif

View File

@ -1,544 +0,0 @@
/* bad.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Related Modules:
None
Description:
Handles the displaying of diagnostic messages regarding the user's source
files.
Modifications:
*/
/* If there's a %E or %4 in the messages, set this to at least 5,
for example. */
#define FFEBAD_MAX_ 6
/* Include files. */
#include "proj.h"
#include "bad.h"
#include "flags.j"
#include "com.h"
#include "toplev.j"
#include "where.h"
/* Externals defined here. */
bool ffebad_is_inhibited_ = FALSE;
/* Simple definitions and enumerations. */
#define FFEBAD_LONG_MSGS_ 1 /* 0 to use short (or same) messages. */
/* Internal typedefs. */
/* Private include files. */
/* Internal structure definitions. */
struct _ffebad_message_
{
ffebadSeverity severity;
char *message;
};
/* Static objects accessed by functions in this module. */
static struct _ffebad_message_ ffebad_messages_[]
=
{
#define FFEBAD_MSGS1(KWD,SEV,MSG) { SEV, MSG },
#if FFEBAD_LONG_MSGS_ == 0
#define FFEBAD_MSGS2(KWD,SEV,LMSG,SMSG) { SEV, SMSG },
#else
#define FFEBAD_MSGS2(KWD,SEV,LMSG,SMSG) { SEV, LMSG },
#endif
#include "bad.def"
#undef FFEBAD_MSGS1
#undef FFEBAD_MSGS2
};
static struct
{
ffewhereLine line;
ffewhereColumn col;
ffebadIndex tag;
}
ffebad_here_[FFEBAD_MAX_];
static char *ffebad_string_[FFEBAD_MAX_];
static ffebadIndex ffebad_order_[FFEBAD_MAX_];
static ffebad ffebad_errnum_;
static ffebadSeverity ffebad_severity_;
static char *ffebad_message_;
static unsigned char ffebad_index_;
static ffebadIndex ffebad_places_;
static bool ffebad_is_temp_inhibited_; /* Effective setting of
_is_inhibited_ for this
_start/_finish invocation. */
/* Static functions (internal). */
static int ffebad_bufputs_ (char buf[], int bufi, char *s);
/* Internal macros. */
#define ffebad_bufflush_(buf, bufi) \
(((buf)[bufi] = '\0'), fputs ((buf), stderr), 0)
#define ffebad_bufputc_(buf, bufi, c) \
(((bufi) == ARRAY_SIZE (buf)) \
? (ffebad_bufflush_ ((buf), (bufi)), ((buf)[0] = (c)), 1) \
: (((buf)[bufi] = (c)), (bufi) + 1))
static int
ffebad_bufputs_ (char buf[], int bufi, char *s)
{
for (; *s != '\0'; ++s)
bufi = ffebad_bufputc_ (buf, bufi, *s);
return bufi;
}
/* ffebad_init_0 -- Initialize
ffebad_init_0(); */
void
ffebad_init_0 ()
{
assert (FFEBAD == ARRAY_SIZE (ffebad_messages_));
}
ffebadSeverity
ffebad_severity (ffebad errnum)
{
return ffebad_messages_[errnum].severity;
}
/* ffebad_start_ -- Start displaying an error message
ffebad_start(FFEBAD_SOME_ERROR_CODE);
Call ffebad_start to establish the message, ffebad_here and ffebad_string
to send run-time data to it as necessary, then ffebad_finish when through
to actually get it to print (to stderr).
Note: ffebad_start(errnum) turns into ffebad_start_(FALSE,errnum). No
outside caller should call ffebad_start_ directly (as indicated by the
trailing underscore).
Call ffebad_start to start a normal message, one that might be inhibited
by the current state of statement guessing. Call ffebad_start_lex
instead to start a message that is global to all statement guesses and
happens only once for all guesses (i.e. the lexer).
sev and message are overrides for the severity and messages when errnum
is FFEBAD, meaning the caller didn't want to have to put a message in
bad.def to produce a diagnostic. */
bool
ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
char *message)
{
unsigned char i;
if (ffebad_is_inhibited_ && !lex_override)
{
ffebad_is_temp_inhibited_ = TRUE;
return FALSE;
}
if (errnum != FFEBAD)
{
ffebad_severity_ = ffebad_messages_[errnum].severity;
ffebad_message_ = ffebad_messages_[errnum].message;
}
else
{
ffebad_severity_ = sev;
ffebad_message_ = message;
}
#if FFECOM_targetCURRENT == FFECOM_targetGCC
{
extern int inhibit_warnings; /* From toplev.c. */
switch (ffebad_severity_)
{ /* Tell toplev.c about this message. */
case FFEBAD_severityINFORMATIONAL:
case FFEBAD_severityTRIVIAL:
if (inhibit_warnings)
{ /* User wants no warnings. */
ffebad_is_temp_inhibited_ = TRUE;
return FALSE;
}
/* Fall through. */
case FFEBAD_severityWARNING:
case FFEBAD_severityPECULIAR:
case FFEBAD_severityPEDANTIC:
if ((ffebad_severity_ != FFEBAD_severityPEDANTIC)
|| !flag_pedantic_errors)
{
if (count_error (1) == 0)
{ /* User wants no warnings. */
ffebad_is_temp_inhibited_ = TRUE;
return FALSE;
}
break;
}
/* Fall through (PEDANTIC && flag_pedantic_errors). */
case FFEBAD_severityFATAL:
case FFEBAD_severityWEIRD:
case FFEBAD_severitySEVERE:
case FFEBAD_severityDISASTER:
count_error (0);
break;
default:
break;
}
}
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
ffebad_is_temp_inhibited_ = FALSE;
ffebad_errnum_ = errnum;
ffebad_index_ = 0;
ffebad_places_ = 0;
for (i = 0; i < FFEBAD_MAX_; ++i)
{
ffebad_string_[i] = NULL;
ffebad_here_[i].line = ffewhere_line_unknown ();
ffebad_here_[i].col = ffewhere_column_unknown ();
}
return TRUE;
}
/* ffebad_here -- Establish source location of some diagnostic concern
ffebad_here(ffebadIndex i,ffewhereLine line,ffewhereColumn col);
Call ffebad_start to establish the message, ffebad_here and ffebad_string
to send run-time data to it as necessary, then ffebad_finish when through
to actually get it to print (to stderr). */
void
ffebad_here (ffebadIndex index, ffewhereLine line, ffewhereColumn col)
{
ffewhereLineNumber line_num;
ffewhereLineNumber ln;
ffewhereColumnNumber col_num;
ffewhereColumnNumber cn;
ffebadIndex i;
ffebadIndex j;
if (ffebad_is_temp_inhibited_)
return;
assert (index < FFEBAD_MAX_);
ffebad_here_[index].line = ffewhere_line_use (line);
ffebad_here_[index].col = ffewhere_column_use (col);
if (ffewhere_line_is_unknown (line)
|| ffewhere_column_is_unknown (col))
{
ffebad_here_[index].tag = FFEBAD_MAX_;
return;
}
ffebad_here_[index].tag = 0; /* For now, though it shouldn't matter. */
/* Sort the source line/col points into the order they occur in the source
file. Deal with duplicates appropriately. */
line_num = ffewhere_line_number (line);
col_num = ffewhere_column_number (col);
/* Determine where in the ffebad_order_ array this new place should go. */
for (i = 0; i < ffebad_places_; ++i)
{
ln = ffewhere_line_number (ffebad_here_[ffebad_order_[i]].line);
cn = ffewhere_column_number (ffebad_here_[ffebad_order_[i]].col);
if (line_num < ln)
break;
if (line_num == ln)
{
if (col_num == cn)
{
ffebad_here_[index].tag = i;
return; /* Shouldn't go in, has equivalent. */
}
else if (col_num < cn)
break;
}
}
/* Before putting new place in ffebad_order_[i], first increment all tags
that are i or greater. */
if (i != ffebad_places_)
{
for (j = 0; j < FFEBAD_MAX_; ++j)
{
if (ffebad_here_[j].tag >= i)
++ffebad_here_[j].tag;
}
}
/* Then slide all ffebad_order_[] entries at and above i up one entry. */
for (j = ffebad_places_; j > i; --j)
ffebad_order_[j] = ffebad_order_[j - 1];
/* Finally can put new info in ffebad_order_[i]. */
ffebad_order_[i] = index;
ffebad_here_[index].tag = i;
++ffebad_places_;
}
/* Establish string for next index (always in order) of message
ffebad_string(char *string);
Call ffebad_start to establish the message, ffebad_here and ffebad_string
to send run-time data to it as necessary, then ffebad_finish when through
to actually get it to print (to stderr). Note: don't trash the string
until after calling ffebad_finish, since we just maintain a pointer to
the argument passed in until then. */
void
ffebad_string (char *string)
{
if (ffebad_is_temp_inhibited_)
return;
assert (ffebad_index_ != FFEBAD_MAX_);
ffebad_string_[ffebad_index_++] = string;
}
/* ffebad_finish -- Display error message with where & run-time info
ffebad_finish();
Call ffebad_start to establish the message, ffebad_here and ffebad_string
to send run-time data to it as necessary, then ffebad_finish when through
to actually get it to print (to stderr). */
void
ffebad_finish ()
{
#define MAX_SPACES 132
static char *spaces
= "...>\
\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
\040\040\040"; /* MAX_SPACES - 1 spaces. */
ffewhereLineNumber last_line_num;
ffewhereLineNumber ln;
ffewhereLineNumber rn;
ffewhereColumnNumber last_col_num;
ffewhereColumnNumber cn;
ffewhereColumnNumber cnt;
ffewhereLine l;
ffebadIndex bi;
unsigned short i;
char pointer;
unsigned char c;
unsigned char *s;
char *fn;
static char buf[1024];
int bufi;
int index;
if (ffebad_is_temp_inhibited_)
return;
switch (ffebad_severity_)
{
case FFEBAD_severityINFORMATIONAL:
s = "note:";
break;
case FFEBAD_severityWARNING:
s = "warning:";
break;
case FFEBAD_severitySEVERE:
s = "fatal:";
break;
default:
s = "";
break;
}
/* Display the annoying source references. */
last_line_num = 0;
last_col_num = 0;
for (bi = 0; bi < ffebad_places_; ++bi)
{
if (ffebad_places_ == 1)
pointer = '^';
else
pointer = '1' + bi;
l = ffebad_here_[ffebad_order_[bi]].line;
ln = ffewhere_line_number (l);
rn = ffewhere_line_filelinenum (l);
cn = ffewhere_column_number (ffebad_here_[ffebad_order_[bi]].col);
fn = ffewhere_line_filename (l);
if (ln != last_line_num)
{
if (bi != 0)
fputc ('\n', stderr);
#if FFECOM_targetCURRENT == FFECOM_targetGCC
report_error_function (fn);
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
fprintf (stderr,
#if 0
"Line %" ffewhereLineNumber_f "u of %s:\n %s\n %s%c",
rn, fn,
#else
/* the trailing space on the <file>:<line>: line
fools emacs19 compilation mode into finding the
report */
"%s:%" ffewhereLineNumber_f "u: %s\n %s\n %s%c",
fn, rn,
#endif
s,
ffewhere_line_content (l),
&spaces[cn > MAX_SPACES ? 0 : MAX_SPACES - cn + 4],
pointer);
last_line_num = ln;
last_col_num = cn;
s = "(continued):";
}
else
{
cnt = cn - last_col_num;
fprintf (stderr,
"%s%c", &spaces[cnt > MAX_SPACES
? 0 : MAX_SPACES - cnt + 4],
pointer);
last_col_num = cn;
}
}
if (ffebad_places_ == 0)
{
/* Didn't output "warning:" string, capitalize it for message. */
if ((s[0] != '\0') && ISALPHA (s[0]) && ISLOWER (s[0]))
{
char c;
c = toupper (s[0]);
fprintf (stderr, "%c%s ", c, &s[1]);
}
else if (s[0] != '\0')
fprintf (stderr, "%s ", s);
}
else
fputc ('\n', stderr);
/* Release the ffewhere info. */
for (bi = 0; bi < FFEBAD_MAX_; ++bi)
{
ffewhere_line_kill (ffebad_here_[bi].line);
ffewhere_column_kill (ffebad_here_[bi].col);
}
/* Now display the message. */
bufi = 0;
for (i = 0; (c = ffebad_message_[i]) != '\0'; ++i)
{
if (c == '%')
{
c = ffebad_message_[++i];
if (ISALPHA (c) && ISUPPER (c))
{
index = c - 'A';
if ((index < 0) || (index >= FFEBAD_MAX_))
{
bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!] %");
bufi = ffebad_bufputc_ (buf, bufi, c);
}
else
{
s = ffebad_string_[index];
if (s == NULL)
bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!]");
else
bufi = ffebad_bufputs_ (buf, bufi, s);
}
}
else if (ISDIGIT (c))
{
index = c - '0';
if ((index < 0) || (index >= FFEBAD_MAX_))
{
bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!] %");
bufi = ffebad_bufputc_ (buf, bufi, c);
}
else
{
pointer = ffebad_here_[index].tag + '1';
if (pointer == FFEBAD_MAX_ + '1')
pointer = '?';
else if (ffebad_places_ == 1)
pointer = '^';
bufi = ffebad_bufputc_ (buf, bufi, '(');
bufi = ffebad_bufputc_ (buf, bufi, pointer);
bufi = ffebad_bufputc_ (buf, bufi, ')');
}
}
else if (c == '\0')
break;
else if (c == '%')
bufi = ffebad_bufputc_ (buf, bufi, '%');
else
{
bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!]");
bufi = ffebad_bufputc_ (buf, bufi, '%');
bufi = ffebad_bufputc_ (buf, bufi, c);
}
}
else
bufi = ffebad_bufputc_ (buf, bufi, c);
}
bufi = ffebad_bufputc_ (buf, bufi, '\n');
bufi = ffebad_bufflush_ (buf, bufi);
}

View File

@ -1,711 +0,0 @@
/* bad.def -- Public #include File (module.h template V1.0)
Copyright (C) 1995-1997 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Owning Modules:
bad.c
Modifications:
*/
#define INFORM FFEBAD_severityINFORMATIONAL
#define TRIVIAL FFEBAD_severityTRIVIAL
#define WARN FFEBAD_severityWARNING
#define PECULIAR FFEBAD_severityPECULIAR
#define FATAL FFEBAD_severityFATAL
#define WEIRD FFEBAD_severityWEIRD
#define SEVERE FFEBAD_severitySEVERE
#define DISASTER FFEBAD_severityDISASTER
FFEBAD_MSGS1 (FFEBAD_MISSING_FIRST_BINARY_OPERAND, FATAL,
"Missing first operand for binary operator at %0")
FFEBAD_MSGS1 (FFEBAD_NULL_CHAR_CONST, WARN,
"Zero-length character constant at %0")
FFEBAD_MSGS1 (FFEBAD_INVALID_TOKEN_IN_EXPRESSION, FATAL,
"Invalid token at %0 in expression or subexpression at %1")
FFEBAD_MSGS1 (FFEBAD_MISSING_OPERAND_FOR_OPERATOR, FATAL,
"Missing operand for operator at %1 at end of expression at %0")
FFEBAD_MSGS1 (FFEBAD_LABEL_ALREADY_DEFINED, FATAL,
"Label %A already defined at %1 when redefined at %0")
FFEBAD_MSGS1 (FFEBAD_UNRECOGNIZED_CHARACTER, FATAL,
"Unrecognized character at %0 [info -f g77 M LEX]")
FFEBAD_MSGS1 (FFEBAD_LABEL_WITHOUT_STMT, WARN,
"Label definition %A at %0 on empty statement (as of %1)")
FFEBAD_MSGS2 (FFEBAD_EXTRA_LABEL_DEF, FATAL,
"Extra label definition %A at %0 -- perhaps previous label definition %B at %1 should have CONTINUE statement?",
"Extra label definition %A at %0 following label definition %B at %1")
FFEBAD_MSGS1 (FFEBAD_FIRST_CHAR_INVALID, FATAL,
"Invalid first character at %0 [info -f g77 M LEX]")
FFEBAD_MSGS1 (FFEBAD_LINE_TOO_LONG, FATAL,
"Line too long as of %0 [info -f g77 M LEX]")
FFEBAD_MSGS1 (FFEBAD_LABEL_FIELD_NOT_NUMERIC, FATAL,
"Non-numeric character at %0 in label field [info -f g77 M LEX]")
FFEBAD_MSGS1 (FFEBAD_LABEL_NUMBER_INVALID, FATAL,
"Label number at %0 not in range 1-99999")
FFEBAD_MSGS1 (FFEBAD_NON_ANSI_COMMENT, WARN,
"At %0, '!' and '/*' are not valid comment delimiters")
FFEBAD_MSGS1 (FFEBAD_NON_ANSI_CONTINUATION_COLUMN, WARN,
"Continuation indicator at %0 must appear in column 6 [info -f g77 M LEX]")
FFEBAD_MSGS1 (FFEBAD_LABEL_ON_CONTINUATION, FATAL,
"Label at %0 invalid with continuation line indicator at %1 [info -f g77 M LEX]")
FFEBAD_MSGS2 (FFEBAD_INVALID_CONTINUATION, FATAL,
"Continuation indicator at %0 invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX]",
"Continuation indicator at %0 invalid here [info -f g77 M LEX]")
FFEBAD_MSGS1 (FFEBAD_NO_CLOSING_APOSTROPHE, FATAL,
"Character constant at %0 has no closing apostrophe at %1")
FFEBAD_MSGS1 (FFEBAD_NOT_ENOUGH_HOLLERITH_CHARS, FATAL,
"Hollerith constant at %0 specified %A more characters than are present as of %1")
FFEBAD_MSGS1 (FFEBAD_MISSING_CLOSE_PAREN, FATAL,
"Missing close parenthese at %0 needed to match open parenthese at %1")
FFEBAD_MSGS1 (FFEBAD_INTEGER_TOO_LARGE, FATAL,
"Integer at %0 too large")
FFEBAD_MSGS2 (FFEBAD_BAD_MAGICAL, WARN,
"Integer at %0 too large except as negative number (preceded by unary minus sign)",
"Non-negative integer at %0 too large")
FFEBAD_MSGS2 (FFEBAD_BAD_MAGICAL_PRECEDENCE, WARN,
"Integer at %0 too large; even though preceded by unary minus sign at %1, subsequent operator at %2 has precedence over unary minus -- enclose unary minus sign and integer in parentheses to force precedence",
"Integer at %0 too large (%2 has precedence over %1)")
FFEBAD_MSGS2 (FFEBAD_BAD_MAGICAL_BINARY, WARN,
"Integer at %0 too large; even though preceded by minus sign at %1, because minus sign is a binary, not unary, operator -- insert plus sign before minus sign to change it to a unary minus sign",
"Integer at %0 too large (needs unary, not binary, minus at %1)")
FFEBAD_MSGS2 (FFEBAD_BAD_MAGICAL_PRECEDENCE_BINARY, WARN,
"Integer at %0 too large; even though preceded by minus sign at %1, subsequent operator at %2 has precedence over minus, and that minus sign should be a unary minus rather than a binary minus -- insert plus sign before minus sign to change it to a unary minus sign, and enclose unary minus sign and integer in parentheses to force precedence",
"Integer at %0 too large (%2 has precedence over %1, which needs to be unary, not binary, minus)")
FFEBAD_MSGS1 (FFEBAD_IGNORING_PERIOD, FATAL,
"Period at %0 not followed by digits for floating-point number or by `NOT.', `TRUE.', or `FALSE.'")
FFEBAD_MSGS1 (FFEBAD_INSERTING_PERIOD, FATAL,
"Missing close-period between `.%A' at %0 and %1")
FFEBAD_MSGS1 (FFEBAD_INVALID_EXPONENT, FATAL,
"Invalid exponent at %0 for real constant at %1; nondigit `%A' in exponent field")
FFEBAD_MSGS1 (FFEBAD_MISSING_EXPONENT_VALUE, FATAL,
"Missing value at %1 for real-number exponent at %0")
FFEBAD_MSGS1 (FFEBAD_MISSING_BINARY_OPERATOR, FATAL,
"Expected binary operator between expressions at %0 and at %1")
FFEBAD_MSGS2 (FFEBAD_INVALID_DOTDOT, FATAL,
"Period at %0 not followed by valid keyword forming a valid binary operator; `.%A.' is not a valid binary operator",
"`.%A.' at %0 not a binary operator")
FFEBAD_MSGS2 (FFEBAD_QUOTE_MISSES_DIGITS, FATAL,
"Double-quote at %0 not followed by a string of valid octal digits at %1",
"Invalid octal constant at %0")
FFEBAD_MSGS2 (FFEBAD_INVALID_BINARY_DIGIT, FATAL,
"Invalid binary digit(s) found in string of digits at %0",
"Invalid binary constant at %0")
FFEBAD_MSGS2 (FFEBAD_INVALID_HEX_DIGIT, FATAL,
"Invalid hexadecimal digit(s) found in string of digits at %0",
"Invalid hexadecimal constant at %0")
FFEBAD_MSGS2 (FFEBAD_INVALID_OCTAL_DIGIT, FATAL,
"Invalid octal digit(s) found in string of digits at %0",
"Invalid octal constant at %0")
FFEBAD_MSGS2 (FFEBAD_INVALID_RADIX_SPECIFIER, FATAL,
"Invalid radix specifier `%A' at %0 for typeless constant at %1",
"Invalid typeless constant at %1")
FFEBAD_MSGS2 (FFEBAD_INVALID_TYPELESS_BINARY_DIGIT, FATAL,
"Invalid binary digit(s) found in string of digits at %0",
"Invalid binary constant at %0")
FFEBAD_MSGS2 (FFEBAD_INVALID_TYPELESS_OCTAL_DIGIT, FATAL,
"Invalid octal digit(s) found in string of digits at %0",
"Invalid octal constant at %0")
FFEBAD_MSGS2 (FFEBAD_INVALID_TYPELESS_HEX_DIGIT, FATAL,
"Invalid hexadecimal digit(s) found in string of digits at %0",
"Invalid hexadecimal constant at %0")
FFEBAD_MSGS2 (FFEBAD_INVALID_COMPLEX_PART, FATAL,
"%A part of complex constant at %0 must be a real or integer constant -- otherwise use CMPLX() or COMPLEX() in place of ()",
"%A part of complex constant at %0 not a real or integer constant")
FFEBAD_MSGS2 (FFEBAD_INVALID_PERCENT, FATAL,
"Invalid keyword `%%%A' at %0 in this context",
"Invalid keyword `%%%A' at %0")
FFEBAD_MSGS2 (FFEBAD_NULL_EXPRESSION, FATAL,
"Null expression between %0 and %1 invalid in this context",
"Invalid null expression between %0 and %1")
FFEBAD_MSGS2 (FFEBAD_CONCAT_ARGS_TYPE, FATAL,
"Concatenation operator at %0 must operate on two subexpressions of character type, but neither subexpression at %1 or %2 is of character type",
"Invalid operands at %1 and %2 for concatenation operator at %0")
FFEBAD_MSGS2 (FFEBAD_CONCAT_ARG_TYPE, FATAL,
"Concatenation operator at %0 must operate on two subexpressions of character type, but the subexpression at %1 is not of character type",
"Invalid operand at %1 for concatenation operator at %0")
FFEBAD_MSGS2 (FFEBAD_CONCAT_ARG_KIND, FATAL,
"Concatenation operator at %0 must operate on two scalar (not array) subexpressions, two function invocations returning character scalars, or a combination of both -- but the subexpression at %1 is %A",
"Invalid operand (is %A) at %1 for concatenation operator at %0")
FFEBAD_MSGS2 (FFEBAD_MATH_ARGS_TYPE, FATAL,
"Arithmetic operator at %0 must operate on two subexpressions of arithmetic type, but neither subexpression at %1 or %2 is of arithmetic type",
"Invalid operands at %1 and %2 for arithmetic operator at %0")
FFEBAD_MSGS2 (FFEBAD_MATH_ARG_TYPE, FATAL,
"Arithmetic operator at %0 must operate on two subexpressions of arithmetic type, but the subexpression at %1 is not of arithmetic type",
"Invalid operand at %1 for arithmetic operator at %0")
FFEBAD_MSGS2 (FFEBAD_MATH_ARG_KIND, FATAL,
"Arithmetic operator at %0 must operate on two scalar (not array) subexpressions, two function invocations returning arithmetic scalars, or a combination of both -- but the subexpression at %1 is %A",
"Invalid operand (is %A) at %1 for arithmetic operator at %0")
FFEBAD_MSGS2 (FFEBAD_NO_CLOSING_QUOTE, FATAL,
"Character constant at %0 has no closing quote at %1 [info -f g77 M LEX]",
"Unterminated character constant at %0 [info -f g77 M LEX]")
FFEBAD_MSGS2 (FFEBAD_BAD_CHAR_CONTINUE, FATAL,
"Continuation line at %0 must have initial `&' since it continues a character context [info -f g77 M LEX]",
"Missing initial `&' on continuation line at %0 [info -f g77 M LEX]")
FFEBAD_MSGS2 (FFEBAD_BAD_LEXTOK_CONTINUE, FATAL,
"Continuation line at %0 must have initial `&' since it continues a split lexical token [info -f g77 M LEX]",
"Missing initial `&' on continuation line at %0 [info -f g77 M LEX]")
FFEBAD_MSGS2 (FFEBAD_BAD_FREE_CONTINUE, FATAL,
"Continuation line at %0 invalid because it consists only of a single `&' as the only nonblank character",
"Invalid continuation line at %0")
FFEBAD_MSGS2 (FFEBAD_STMT_BEGINS_BAD, FATAL,
"Statement at %0 begins with invalid token [info -f g77 M LEX]",
"Invalid statement at %0 [info -f g77 M LEX]")
FFEBAD_MSGS1 (FFEBAD_SEMICOLON, FATAL,
"Semicolon at %0 is an invalid token")
FFEBAD_MSGS2 (FFEBAD_UNREC_STMT, FATAL,
"Unrecognized statement name at %0 and invalid form for assignment or statement-function definition at %1",
"Invalid statement at %0")
FFEBAD_MSGS2 (FFEBAD_INVALID_STMT_FORM, FATAL,
"Invalid form for %A statement at %0",
"Invalid %A statement at %0")
FFEBAD_MSGS2 (FFEBAD_INVALID_HOLL_IN_STMT, FATAL,
"Invalid use of hollerith constant in statement at %0 -- enclose the constant in parentheses (for example, change BACKSPACE 2HAB to BACKSPACE (2HAB))",
"Enclose hollerith constant in statement at %0 in parentheses")
FFEBAD_MSGS1 (FFEBAD_FORMAT_EXTRA_COMMA, FATAL,
"Extraneous comma in FORMAT statement at %0")
FFEBAD_MSGS1 (FFEBAD_FORMAT_MISSING_COMMA, WARN,
"Missing comma in FORMAT statement at %0")
FFEBAD_MSGS1 (FFEBAD_FORMAT_SPURIOUS_SIGN, FATAL,
"Spurious sign in FORMAT statement at %0")
FFEBAD_MSGS1 (FFEBAD_FORMAT_SPURIOUS_NUMBER, FATAL,
"Spurious number in FORMAT statement at %0")
FFEBAD_MSGS1 (FFEBAD_FORMAT_TEXT_IN_NUMBER, FATAL,
"Spurious text trailing number in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_P_NOCOMMA, FATAL,
"nP control edit descriptor not followed by comma but followed by edit descriptor at %0 other than D, E, EN, F, or G",
"Invalid edit descriptor at %0 following nP control edit descriptor")
FFEBAD_MSGS1 (FFEBAD_FORMAT_BAD_SPEC, FATAL,
"Unrecognized FORMAT specifier at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_I_SPEC, FATAL,
"Invalid I specifier in FORMAT statement at %0 -- correct form: [r]Iw.[m]",
"Invalid I specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_B_SPEC, FATAL,
"Invalid B specifier in FORMAT statement at %0 -- correct form: [r]Bw.[m]",
"Invalid B specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_O_SPEC, FATAL,
"Invalid O specifier in FORMAT statement at %0 -- correct form: [r]Ow.[m]",
"Invalid O specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_Z_SPEC, FATAL,
"Invalid Z specifier in FORMAT statement at %0 -- correct form: [r]Zw.[m]",
"Invalid Z specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_F_SPEC, FATAL,
"Invalid F specifier in FORMAT statement at %0 -- correct form: [r]Fw.d",
"Invalid F specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_E_SPEC, FATAL,
"Invalid E specifier in FORMAT statement at %0 -- correct form: [r]Ew.d[Ee]",
"Invalid E specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_EN_SPEC, FATAL,
"Invalid EN specifier in FORMAT statement at %0 -- correct form: [r]ENw.d[Ee]",
"Invalid EN specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_G_SPEC, FATAL,
"Invalid G specifier in FORMAT statement at %0 -- correct form: [r]Gw.d[Ee]",
"Invalid G specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_L_SPEC, FATAL,
"Invalid L specifier in FORMAT statement at %0 -- correct form: [r]Lw",
"Invalid L specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_A_SPEC, FATAL,
"Invalid A specifier in FORMAT statement at %0 -- correct form: [r]A[w]",
"Invalid A specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_D_SPEC, FATAL,
"Invalid D specifier in FORMAT statement at %0 -- correct form: [r]Dw.d",
"Invalid D specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_Q_SPEC, FATAL,
"Invalid Q specifier in FORMAT statement at %0 -- correct form: Q",
"Invalid Q specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_DOLLAR_SPEC, FATAL,
"Invalid $ specifier in FORMAT statement at %0 -- correct form: $",
"Invalid $ specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_P_SPEC, FATAL,
"Invalid P specifier in FORMAT statement at %0 -- correct form: kP",
"Invalid P specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_T_SPEC, FATAL,
"Invalid T specifier in FORMAT statement at %0 -- correct form: Tn",
"Invalid T specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_TL_SPEC, FATAL,
"Invalid TL specifier in FORMAT statement at %0 -- correct form: TLn",
"Invalid TL specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_TR_SPEC, FATAL,
"Invalid TR specifier in FORMAT statement at %0 -- correct form: TRn",
"Invalid TR specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_X_SPEC, FATAL,
"Invalid X specifier in FORMAT statement at %0 -- correct form: nX",
"Invalid X specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_S_SPEC, FATAL,
"Invalid S specifier in FORMAT statement at %0 -- correct form: S",
"Invalid S specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_SP_SPEC, FATAL,
"Invalid SP specifier in FORMAT statement at %0 -- correct form: SP",
"Invalid SP specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_SS_SPEC, FATAL,
"Invalid SS specifier in FORMAT statement at %0 -- correct form: SS",
"Invalid SS specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_BN_SPEC, FATAL,
"Invalid BN specifier in FORMAT statement at %0 -- correct form: BN",
"Invalid BN specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_BZ_SPEC, FATAL,
"Invalid BZ specifier in FORMAT statement at %0 -- correct form: BZ",
"Invalid BZ specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_COLON_SPEC, FATAL,
"Invalid : specifier in FORMAT statement at %0 -- correct form: :",
"Invalid : specifier in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_BAD_H_SPEC, FATAL,
"Invalid H specifier in FORMAT statement at %0 -- correct form: nHcharacters !where n is an unsigned decimal constant, and characters !contains exactly n characters (including spaces)",
"Invalid H specifier in FORMAT statement at %0")
FFEBAD_MSGS1 (FFEBAD_FORMAT_MISSING_PAREN, FATAL,
"Missing close-parenthese(s) in FORMAT statement at %0")
FFEBAD_MSGS1 (FFEBAD_FORMAT_MISSING_DOT, FATAL,
"Missing number following period in FORMAT statement at %0")
FFEBAD_MSGS1 (FFEBAD_FORMAT_MISSING_EXP, FATAL,
"Missing number following `E' in FORMAT statement at %0")
FFEBAD_MSGS2 (FFEBAD_FORMAT_EXPR_TOKEN, FATAL,
"Invalid token with FORMAT run-time expression at %0 -- use the traditional operators .LT., .LE., .GT., .GE., .EQ., and .NE. in place of the newer tokens <, <=, >, >=, ==, and !=, because > ends an expression within a FORMAT statement",
"Invalid token with FORMAT run-time expression at %0")
FFEBAD_MSGS1 (FFEBAD_TRAILING_COMMA, WARN,
"Spurious trailing comma preceding terminator at %0")
FFEBAD_MSGS1 (FFEBAD_INTERFACE_ASSIGNMENT, WARN,
"At %0, specify OPERATOR instead of ASSIGNMENT for INTERFACE statement not specifying the assignment operator (=)")
FFEBAD_MSGS1 (FFEBAD_INTERFACE_OPERATOR, WARN,
"At %0, specify ASSIGNMENT instead of OPERATOR for INTERFACE statement specifying the assignment operator (=)")
FFEBAD_MSGS2 (FFEBAD_INTERFACE_NONLETTER, FATAL,
"Defined operator at %0 contains a nonletter -- must contain only letters A-Z (or a-z)",
"Nonletter in defined operator at %0")
FFEBAD_MSGS2 (FFEBAD_INVALID_TYPEDECL_ATTR, FATAL,
"Invalid type-declaration attribute at %0 -- must be one of: DIMENSION(array-spec), EXTERNAL, INTRINSIC, PARAMETER, or SAVE",
"Invalid type-declaration attribute at %0")
FFEBAD_MSGS1 (FFEBAD_INVALID_TYPEDECL_INIT, FATAL,
"Cannot specify =initialization-expr at %0 unless `::' appears before list of objects")
FFEBAD_MSGS1 (FFEBAD_LABEL_USE_DEF, FATAL,
"Reference to label at %1 inconsistent with its definition at %0")
FFEBAD_MSGS1 (FFEBAD_LABEL_USE_USE, FATAL,
"Reference to label at %1 inconsistent with earlier reference at %0")
FFEBAD_MSGS1 (FFEBAD_LABEL_DEF_DO, FATAL,
"DO-statement reference to label at %1 follows its definition at %0")
FFEBAD_MSGS1 (FFEBAD_LABEL_BLOCK, WARN,
"Reference to label at %1 is outside block containing definition at %0")
FFEBAD_MSGS1 (FFEBAD_LABEL_DO_BLOCK_DO, FATAL,
"DO-statement references to label at %0 and %2 separated by unterminated block starting at %1")
FFEBAD_MSGS1 (FFEBAD_LABEL_DO_BLOCK_END, FATAL,
"DO-statement reference to label at %0 and label definition at %2 separated by unterminated block starting at %1")
FFEBAD_MSGS1 (FFEBAD_INVALID_LABEL_DEF, FATAL,
"Label definition at %0 invalid on this kind of statement")
FFEBAD_MSGS1 (FFEBAD_ORDER_1, FATAL,
"Statement at %0 invalid in this context")
FFEBAD_MSGS1 (FFEBAD_ORDER_2, FATAL,
"Statement at %0 invalid in context established by statement at %1")
FFEBAD_MSGS1 (FFEBAD_CONSTRUCT_NAMED, FATAL,
"Statement at %0 must specify construct name specified at %1")
FFEBAD_MSGS1 (FFEBAD_CONSTRUCT_NOT_NAMED, FATAL,
"Construct name at %0 superfluous, no construct name specified at %1")
FFEBAD_MSGS1 (FFEBAD_CONSTRUCT_WRONG_NAME, FATAL,
"Construct name at %0 not the same as construct name at %1")
FFEBAD_MSGS1 (FFEBAD_CONSTRUCT_NO_DO_NAME, FATAL,
"Construct name at %0 does not match construct name for any containing DO constructs")
FFEBAD_MSGS1 (FFEBAD_DO_HAD_LABEL, FATAL,
"Label definition missing at %0 for DO construct specifying label at %1")
FFEBAD_MSGS1 (FFEBAD_AFTER_ELSE, FATAL,
"Statement at %0 follows ELSE block for IF construct at %1")
FFEBAD_MSGS1 (FFEBAD_FORMAT_NO_LABEL_DEF, FATAL,
"No label definition for FORMAT statement at %0")
FFEBAD_MSGS1 (FFEBAD_SECOND_ELSE_WHERE, FATAL,
"Second occurrence of ELSE WHERE at %0 within WHERE at %1")
FFEBAD_MSGS1 (FFEBAD_END_WO, WARN,
"END statement at %0 missing `%A' keyword required for internal or module procedure(s) bounded by %1")
FFEBAD_MSGS1 (FFEBAD_INVALID_MODULE_PROCEDURE, FATAL,
"MODULE PROCEDURE statement at %0 disallowed because INTERFACE at %1 specifies no generic name, operator, or assignment")
FFEBAD_MSGS1 (FFEBAD_BLOCKDATA_NOT_NAMED, FATAL,
"BLOCK DATA name at %0 superfluous, no name specified at %1")
FFEBAD_MSGS1 (FFEBAD_PROGRAM_NOT_NAMED, FATAL,
"Program name at %0 superfluous, no PROGRAM statement specified at %1")
FFEBAD_MSGS1 (FFEBAD_UNIT_WRONG_NAME, FATAL,
"Program unit name at %0 not the same as name at %1")
FFEBAD_MSGS1 (FFEBAD_TYPE_WRONG_NAME, FATAL,
"Type name at %0 not the same as name at %1")
FFEBAD_MSGS1 (FFEBAD_EOF_BEFORE_BLOCK_END, FATAL,
"End of source file before end of block started at %0")
FFEBAD_MSGS1 (FFEBAD_UNDEF_LABEL, FATAL,
"Undefined label, first referenced at %0")
FFEBAD_MSGS1 (FFEBAD_CONFLICTING_SAVES, WARN,
"SAVE statement or attribute at %1 cannot be specified along with SAVE statement or attribute at %0")
FFEBAD_MSGS1 (FFEBAD_CONFLICTING_ACCESSES, FATAL,
"PUBLIC or PRIVATE statement at %1 cannot be specified along with PUBLIC or PRIVATE statement at %0")
FFEBAD_MSGS1 (FFEBAD_RETURN_IN_MAIN, WARN,
"RETURN statement at %0 invalid within a main program unit")
FFEBAD_MSGS1 (FFEBAD_ALTRETURN_IN_PROGRAM, FATAL,
"Alternate return specifier at %0 invalid within a main program unit")
FFEBAD_MSGS1 (FFEBAD_ALTRETURN_IN_FUNCTION, FATAL,
"Alternate return specifier at %0 invalid within a function")
FFEBAD_MSGS1 (FFEBAD_DERIVTYP_ACCESS, FATAL,
"Access specifier or PRIVATE statement at %0 invalid for derived-type definition within other than the specification part of a module")
FFEBAD_MSGS1 (FFEBAD_DERIVTYP_ACCESS_FIRST, FATAL,
"Access specifier at %0 must immediately follow derived-type statement at %1 with no intervening statements")
FFEBAD_MSGS1 (FFEBAD_DERIVTYP_NO_COMPONENTS, FATAL,
"No components specified as of %0 for derived-type definition beginning at %1")
FFEBAD_MSGS1 (FFEBAD_STRUCT_NO_COMPONENTS, FATAL,
"No components specified as of %0 for structure definition beginning at %1")
FFEBAD_MSGS1 (FFEBAD_STRUCT_MISSING_NAME, FATAL,
"Missing structure name for outer structure definition at %0")
FFEBAD_MSGS1 (FFEBAD_STRUCT_IGNORING_FIELD, FATAL,
"Field names at %0 for outer structure definition -- specify them in a subsequent RECORD statement instead")
FFEBAD_MSGS1 (FFEBAD_STRUCT_MISSING_FIELD, FATAL,
"Missing field name(s) for structure definition at %0 within structure definition at %1")
FFEBAD_MSGS1 (FFEBAD_MAP_NO_COMPONENTS, FATAL,
"No components specified as of %0 for map beginning at %1")
FFEBAD_MSGS1 (FFEBAD_UNION_NO_TWO_MAPS, FATAL,
"Zero or one maps specified as of %0 for union beginning at %1 -- at least two are required")
FFEBAD_MSGS1 (FFEBAD_MISSING_SPECIFIER, FATAL,
"Missing %A specifier in statement at %0")
FFEBAD_MSGS1 (FFEBAD_NAMELIST_ITEMS, FATAL,
"Items in I/O list starting at %0 invalid for namelist-directed I/O")
FFEBAD_MSGS1 (FFEBAD_CONFLICTING_SPECS, FATAL,
"Conflicting I/O control specifications at %0 and %1")
FFEBAD_MSGS1 (FFEBAD_NO_UNIT_SPEC, FATAL,
"No UNIT= specifier in I/O control list at %0")
FFEBAD_MSGS1 (FFEBAD_MISSING_ADVANCE_SPEC, FATAL,
"Specification at %0 requires ADVANCE=`NO' specification in same I/O control list")
FFEBAD_MSGS1 (FFEBAD_MISSING_FORMAT_SPEC, FATAL,
"Specification at %0 requires explicit FMT= specification in same I/O control list")
FFEBAD_MSGS2 (FFEBAD_SPEC_VALUE, FATAL,
"Unrecognized value for character constant at %0 -- expecting %A",
"Unrecognized value for character constant at %0")
FFEBAD_MSGS1 (FFEBAD_CASE_SECOND_DEFAULT, FATAL,
"Second occurrence of CASE DEFAULT at %0 within SELECT CASE at %1")
FFEBAD_MSGS1 (FFEBAD_CASE_DUPLICATE, FATAL,
"Duplicate or overlapping case values/ranges at %0 and %1")
FFEBAD_MSGS1 (FFEBAD_CASE_TYPE_DISAGREE, FATAL,
"Type and/or kind-type parameter disagreement between CASE value or value within range at %0 and SELECT CASE at %1")
FFEBAD_MSGS1 (FFEBAD_CASE_LOGICAL_RANGE, FATAL,
"Range specification at %0 invalid for CASE statement within logical-type SELECT CASE statement")
FFEBAD_MSGS2 (FFEBAD_CASE_BAD_RANGE, FATAL,
"Range specification at %0 invalid -- at least one expression must be specified, or use CASE DEFAULT",
"Range specification at %0 invalid")
FFEBAD_MSGS2 (FFEBAD_CASE_RANGE_USELESS, INFORM,
"Range specification at %0 useless; first expression greater than second expression in range, so range can never be matched by any selection expression",
"Useless range at %0")
FFEBAD_MSGS1 (FFEBAD_F90, FATAL,
"Fortran 90 feature at %0 unsupported")
FFEBAD_MSGS2 (FFEBAD_KINDTYPE, FATAL,
"Invalid kind at %0 for type at %1 -- unsupported or not permitted",
"Invalid kind at %0 for type at %1")
FFEBAD_MSGS2 (FFEBAD_BAD_IMPLICIT, FATAL,
"Cannot establish implicit type for initial letter `%A' at %0 -- already explicitly established or used to set implicit type of some name, or backwards order of letters in letter range",
"Cannot establish implicit type for initial letter `%A' at %0")
FFEBAD_MSGS1 (FFEBAD_SYMERR, FATAL,
"Invalid declaration of or reference to symbol `%A' at %0 [initially seen at %1]")
FFEBAD_MSGS2 (FFEBAD_LABEL_WRONG_PLACE, FATAL,
"Label definition %A (at %0) invalid -- must be in columns 1-5",
"Invalid label definition %A (at %0)")
FFEBAD_MSGS1 (FFEBAD_NULL_ELEMENT, FATAL,
"Null element at %0 for array reference at %1")
FFEBAD_MSGS1 (FFEBAD_TOO_FEW_ELEMENTS, FATAL,
"Too few elements (%A missing) as of %0 for array reference at %1")
FFEBAD_MSGS1 (FFEBAD_TOO_MANY_ELEMENTS, FATAL,
"Too many elements as of %0 for array reference at %1")
FFEBAD_MSGS1 (FFEBAD_MISSING_COLON_IN_SUBSTR, FATAL,
"Missing colon as of %0 in substring reference for %1")
FFEBAD_MSGS1 (FFEBAD_BAD_SUBSTR, FATAL,
"Invalid use at %0 of substring operator on %1")
FFEBAD_MSGS1 (FFEBAD_RANGE_SUBSTR, WARN,
"Substring begin/end point at %0 out of defined range")
FFEBAD_MSGS1 (FFEBAD_RANGE_ARRAY, WARN,
"Array element value at %0 out of defined range")
FFEBAD_MSGS1 (FFEBAD_EXPR_WRONG, FATAL,
"Expression at %0 has incorrect data type or rank for its context")
FFEBAD_MSGS1 (FFEBAD_DIV_BY_ZERO, WARN,
"Division by 0 (zero) at %0 (IEEE not yet supported)")
FFEBAD_MSGS1 (FFEBAD_DO_STEP_ZERO, FATAL,
"%A step count known to be 0 (zero) at %0")
FFEBAD_MSGS1 (FFEBAD_DO_END_OVERFLOW, WARN,
"%A end value plus step count known to overflow at %0")
FFEBAD_MSGS1 (FFEBAD_DO_IMP_OVERFLOW, WARN,
"%A begin, end, and step-count values known to result in implementation-dependent behavior due to overflow(s) in intermediate calculations at %0")
FFEBAD_MSGS1 (FFEBAD_DO_NULL, WARN,
"%A begin, end, and step-count values known to result in no iterations at %0")
FFEBAD_MSGS1 (FFEBAD_BAD_TYPES, FATAL,
"Type disagreement between expressions at %0 and %1")
FFEBAD_MSGS2 (FFEBAD_FORMAT_EXPR_SPEC, FATAL,
"Run-time expression at %0 in FORMAT statement that does not follow the first executable statement in the program unit -- move the statement",
"FORMAT at %0 with run-time expression must follow first executable statement")
FFEBAD_MSGS2 (FFEBAD_BAD_IMPDO, FATAL,
"Unexpected token at %0 in implied-DO construct at %1 -- form of implied-DO is `(item-list,do-var=start,end[,incr])'",
"Unexpected token at %0 in implied-DO construct at %1")
FFEBAD_MSGS1 (FFEBAD_BAD_IMPDCL, FATAL,
"No specification for implied-DO iterator `%A' at %0")
FFEBAD_MSGS1 (FFEBAD_IMPDO_PAREN, WARN,
"Gratuitous parentheses surround implied-DO construct at %0")
FFEBAD_MSGS1 (FFEBAD_ZERO_SIZE, FATAL,
"Zero-size specification invalid at %0")
FFEBAD_MSGS1 (FFEBAD_ZERO_ARRAY, FATAL,
"Zero-size array at %0")
FFEBAD_MSGS1 (FFEBAD_BAD_COMPLEX, FATAL,
"Target machine does not support complex entity of kind specified at %0")
FFEBAD_MSGS1 (FFEBAD_BAD_DBLCMPLX, FATAL,
"Target machine does not support DOUBLE COMPLEX, specified at %0")
FFEBAD_MSGS1 (FFEBAD_BAD_POWER, WARN,
"Attempt to raise constant zero to a power at %0")
FFEBAD_MSGS2 (FFEBAD_BOOL_ARGS_TYPE, FATAL,
"Boolean/logical operator at %0 must operate on two subexpressions of logical type, but neither subexpression at %1 or %2 is of logical type",
"Invalid operands at %1 and %2 for boolean operator at %0")
FFEBAD_MSGS2 (FFEBAD_BOOL_ARG_TYPE, FATAL,
"Boolean/logical operator at %0 must operate on two subexpressions of logical type, but the subexpression at %1 is not of logical type",
"Invalid operand at %1 for boolean operator at %0")
FFEBAD_MSGS2 (FFEBAD_BOOL_ARG_KIND, FATAL,
"Boolean/logical operator at %0 must operate on two scalar (not array) subexpressions, two function invocations returning logical scalars, or a combination of both -- but the subexpression at %1 is %A",
"Invalid operand (is %A) at %1 for boolean operator at %0")
FFEBAD_MSGS2 (FFEBAD_NOT_ARG_TYPE, FATAL,
".NOT. operator at %0 must operate on subexpression of logical type, but the subexpression at %1 is not of logical type",
"Invalid operand at %1 for .NOT. operator at %0")
FFEBAD_MSGS2 (FFEBAD_NOT_ARG_KIND, FATAL,
".NOT. operator at %0 must operate on scalar subexpressions -- but the subexpression at %1 is %A",
"Invalid operand (is %A) at %1 for .NOT. operator at %0")
FFEBAD_MSGS2 (FFEBAD_EQOP_ARGS_TYPE, FATAL,
"Equality operator at %0 must operate on two subexpressions of arithmetic or character type, but neither subexpression at %1 or %2 is of arithmetic or character type",
"Invalid operands at %1 and %2 for equality operator at %0")
FFEBAD_MSGS2 (FFEBAD_EQOP_ARG_TYPE, FATAL,
"Equality operator at %0 must operate on two subexpressions of arithmetic or character type, but the subexpression at %1 is not of arithmetic or character type",
"Invalid operand at %1 for equality operator at %0")
FFEBAD_MSGS2 (FFEBAD_EQOP_ARG_KIND, FATAL,
"Equality operator at %0 must operate on two scalar (not array) subexpressions, two function invocations returning arithmetic or character scalars, or a combination of both -- but the subexpression at %1 is %A",
"Invalid operand (is %A) at %1 for equality operator at %0")
FFEBAD_MSGS2 (FFEBAD_RELOP_ARGS_TYPE, FATAL,
"Relational operator at %0 must operate on two subexpressions of integer, real, or character type, but neither subexpression at %1 or %2 is of integer, real, or character type",
"Invalid operands at %1 and %2 for relational operator at %0")
FFEBAD_MSGS2 (FFEBAD_RELOP_ARG_TYPE, FATAL,
"Relational operator at %0 must operate on two subexpressions of integer, real, or character type, but the subexpression at %1 is not of integer, real, or character type",
"Invalid operand at %1 for relational operator at %0")
FFEBAD_MSGS2 (FFEBAD_RELOP_ARG_KIND, FATAL,
"Relational operator at %0 must operate on two scalar (not array) subexpressions, two function invocations returning integer, real, or character scalars, or a combination of both -- but the subexpression at %1 is %A",
"Invalid operand (is %A) at %1 for relational operator at %0")
FFEBAD_MSGS2 (FFEBAD_INTRINSIC_REF, FATAL,
"Reference to intrinsic `%A' at %0 invalid -- one or more arguments have incorrect type",
"Invalid reference to intrinsic `%A' at %0")
FFEBAD_MSGS2 (FFEBAD_INTRINSIC_TOOFEW, FATAL,
"Too few arguments passed to intrinsic `%A' at %0",
"Too few arguments for intrinsic `%A' at %0")
FFEBAD_MSGS2 (FFEBAD_INTRINSIC_TOOMANY, FATAL,
"Too many arguments passed to intrinsic `%A' at %0",
"Too many arguments for intrinsic `%A' at %0")
FFEBAD_MSGS2 (FFEBAD_INTRINSIC_DISABLED, FATAL,
"Reference to disabled intrinsic `%A' at %0",
"Disabled intrinsic `%A' at %0")
FFEBAD_MSGS2 (FFEBAD_INTRINSIC_IS_SUBR, FATAL,
"Reference to intrinsic subroutine `%A' as if it were a function at %0",
"Function reference to intrinsic subroutine `%A' at %0")
FFEBAD_MSGS2 (FFEBAD_INTRINSIC_IS_FUNC, FATAL,
"Reference to intrinsic function `%A' as if it were a subroutine at %0",
"Subroutine reference to intrinsic function `%A' at %0")
FFEBAD_MSGS2 (FFEBAD_INTRINSIC_UNIMPL, FATAL,
"Reference to unimplemented intrinsic `%A' at %0 -- use EXTERNAL to reference user-written procedure with this name",
"Unimplemented intrinsic `%A' at %0")
FFEBAD_MSGS2 (FFEBAD_INTRINSIC_UNIMPLW, WARN,
"Reference to unimplemented intrinsic `%A' at %0 (assumed EXTERNAL)",
"Unimplemented intrinsic `%A' at %0 (assumed EXTERNAL)")
FFEBAD_MSGS1 (FFEBAD_INTRINSIC_AMBIG, FATAL,
"Reference to generic intrinsic `%A' at %0 could be to form %B or %C")
FFEBAD_MSGS1 (FFEBAD_INTRINSIC_CMPAMBIG, FATAL,
"Ambiguous use of intrinsic `%A' at %0 [info -f g77 M CMPAMBIG]")
FFEBAD_MSGS1 (FFEBAD_INTRINSIC_EXPIMP, WARN,
"Intrinsic `%A' referenced %Bly at %0, %Cly at %1 [info -f g77 M EXPIMP]")
FFEBAD_MSGS1 (FFEBAD_INTRINSIC_GLOBAL, WARN,
"Same name `%A' used for %B at %0 and %C at %1 [info -f g77 M INTGLOB]")
FFEBAD_MSGS1 (FFEBAD_INTRINSIC_TYPE, WARN,
"Explicit type declaration for intrinsic `%A' disagrees with invocation at %0")
FFEBAD_MSGS1 (FFEBAD_OPEN_INCLUDE, FATAL,
"Unable to open INCLUDE file `%A' at %0")
FFEBAD_MSGS2 (FFEBAD_DOITER, FATAL,
"Attempt to modify variable `%A' at %0 while it serves as DO-loop iterator at %1",
"Modification of DO-loop iterator `%A' at %0")
FFEBAD_MSGS2 (FFEBAD_DOITER_IMPDO, FATAL,
"Attempt to modify variable `%A' via item #%B in list at %0 while it serves as implied-DO iterator at %1",
"Modification of DO-loop iterator `%A' at %0")
FFEBAD_MSGS2 (FFEBAD_TOO_MANY_DIMS, FATAL,
"Array has too many dimensions, as of dimension specifier at %0",
"Too many dimensions at %0")
FFEBAD_MSGS1 (FFEBAD_NULL_ARGUMENT, FATAL,
"Null argument at %0 for statement function reference at %1")
FFEBAD_MSGS1 (FFEBAD_NULL_ARGUMENT_W, WARN,
"Null argument at %0 for procedure invocation at %1")
FFEBAD_MSGS1 (FFEBAD_TOO_FEW_ARGUMENTS, FATAL,
"%A too few arguments (starting with dummy argument `%B') as of %0 for statement function reference at %1")
FFEBAD_MSGS1 (FFEBAD_TOO_MANY_ARGUMENTS, FATAL,
"%A too many arguments as of %0 for statement function reference at %1")
FFEBAD_MSGS1 (FFEBAD_ARRAY_AS_SFARG, FATAL,
"Array supplied at %1 for dummy argument `%A' in statement function reference at %0")
FFEBAD_MSGS1 (FFEBAD_FORMAT_UNSUPPORTED, FATAL,
"Unsupported FORMAT specifier at %0")
FFEBAD_MSGS1 (FFEBAD_FORMAT_VARIABLE, FATAL,
"Variable-expression FORMAT specifier at %0 -- unsupported")
FFEBAD_MSGS2 (FFEBAD_OPEN_UNSUPPORTED, FATAL,
"Unsupported OPEN control item at %0 -- ACTION=, ASSOCIATEVARIABLE=, BLOCKSIZE=, BUFFERCOUNT=, CARRIAGECONTROL=, DEFAULTFILE=, DELIM=, DISPOSE=, EXTENDSIZE=, INITIALSIZE=, KEY=, MAXREC=, NOSPANBLOCKS, ORGANIZATION=, PAD=, POSITION=, READONLY=, RECORDTYPE=, SHARED=, and USEROPEN= are not supported",
"Unsupported OPEN control item at %0")
FFEBAD_MSGS2 (FFEBAD_INQUIRE_UNSUPPORTED, FATAL,
"Unsupported INQUIRE control item at %0 -- ACTION=, CARRIAGECONTROL=, DEFAULTFILE=, DELIM=, KEYED=, ORGANIZATION=, PAD=, POSITION=, READ=, READWRITE=, RECORDTYPE=, and WRITE= are not supported",
"Unsupported INQUIRE control item at %0")
FFEBAD_MSGS2 (FFEBAD_READ_UNSUPPORTED, FATAL,
"Unsupported READ control item at %0 -- ADVANCE=, EOR=, KEYEQ=, KEYGE=, KEYGT=, KEYID=, NULLS=, and SIZE= are not supported",
"Unsupported READ control item at %0")
FFEBAD_MSGS2 (FFEBAD_WRITE_UNSUPPORTED, FATAL,
"Unsupported WRITE control item at %0 -- ADVANCE= and EOR= are not supported",
"Unsupported WRITE control item at %0")
FFEBAD_MSGS1 (FFEBAD_VXT_UNSUPPORTED, FATAL,
"Unsupported VXT statement at %0")
FFEBAD_MSGS1 (FFEBAD_DATA_REINIT, FATAL,
"Attempt to specify second initial value for `%A' at %0")
FFEBAD_MSGS1 (FFEBAD_DATA_TOOFEW, FATAL,
"Too few initial values in list of initializers for `%A' at %0")
FFEBAD_MSGS1 (FFEBAD_DATA_TOOMANY, FATAL,
"Too many initial values in list of initializers starting at %0")
FFEBAD_MSGS1 (FFEBAD_DATA_RANGE, FATAL,
"Array or substring specification for `%A' out of range in statement at %0")
FFEBAD_MSGS1 (FFEBAD_DATA_SUBSCRIPT, FATAL,
"Array subscript #%B out of range for initialization of `%A' in statement at %0")
FFEBAD_MSGS1 (FFEBAD_DATA_ZERO, FATAL,
"Implied do-loop step count of 0 (zero) for iteration variable `%A' in statement at %0")
FFEBAD_MSGS1 (FFEBAD_DATA_EMPTY, FATAL,
"Implied do-loop iteration count of 0 (zero) for iteration variable `%A' in statement at %0")
FFEBAD_MSGS1 (FFEBAD_DATA_EVAL, FATAL,
"Not an integer constant expression in implied do-loop in statement at %0")
FFEBAD_MSGS1 (FFEBAD_DATA_MULTIPLE, FATAL,
"Attempt to specify second initial value for element of `%A' at %0")
FFEBAD_MSGS1 (FFEBAD_EQUIV_COMMON, FATAL,
"Attempt to EQUIVALENCE common areas `%A' and `%B' at %0")
FFEBAD_MSGS1 (FFEBAD_EQUIV_ALIGN, FATAL,
"Can't place `%A' as directed by EQUIVALENCE due to alignment restrictions")
FFEBAD_MSGS1 (FFEBAD_EQUIV_MISMATCH, FATAL,
"Mismatched EQUIVALENCE requirements for placement of `%A' at both %C and %D bytes offset from `%B'")
FFEBAD_MSGS1 (FFEBAD_EQUIV_RANGE, FATAL,
"Array or substring specification for `%A' out of range in EQUIVALENCE statement")
FFEBAD_MSGS1 (FFEBAD_EQUIV_SUBSTR, FATAL,
"Substring of non-CHARACTER entity `%A' in EQUIVALENCE statement")
FFEBAD_MSGS1 (FFEBAD_EQUIV_ARRAY, FATAL,
"Array reference to scalar variable `%A' in EQUIVALENCE statement")
FFEBAD_MSGS1 (FFEBAD_EQUIV_SUBSCRIPT, WARN,
"Array subscript #%B out of range for EQUIVALENCE of `%A'")
FFEBAD_MSGS2 (FFEBAD_COMMON_PAD, WARN,
"Padding of %A %D required before `%B' in common block `%C' at %0 -- consider reordering members, largest-type-size first",
"Padding of %A %D required before `%B' in common block `%C' at %0")
FFEBAD_MSGS1 (FFEBAD_COMMON_NEG, FATAL,
"Attempt to extend COMMON area beyond its starting point via EQUIVALENCE of `%A'")
FFEBAD_MSGS1 (FFEBAD_EQUIV_FEW, FATAL,
"Too few elements in reference to array `%A' in EQUIVALENCE statement")
FFEBAD_MSGS1 (FFEBAD_EQUIV_MANY, FATAL,
"Too many elements in reference to array `%A' in EQUIVALENCE statement")
FFEBAD_MSGS1 (FFEBAD_MIXED_TYPES, WARN,
"Mixed CHARACTER and non-CHARACTER types via COMMON/EQUIVALENCE -- for example, `%A' and `%B'")
FFEBAD_MSGS2 (FFEBAD_IMPLICIT_ADJLEN, FATAL,
"Invalid length specification at %0 for IMPLICIT statement -- must be integer constant expression",
"Invalid length specification at %0")
FFEBAD_MSGS2 (FFEBAD_ENTRY_CONFLICTS, FATAL,
"Type of ENTRY point at %0 to function conflicts with type(s) of previous entrypoint(s) -- must all be identical-length CHARACTER or none be CHARACTER type",
"Type of ENTRY point at %0 to function conflicts with type(s) of previous entrypoint(s)")
FFEBAD_MSGS1 (FFEBAD_RETURN_VALUE_UNSET, WARN,
"Return value `%A' for FUNCTION at %0 not referenced in subprogram")
FFEBAD_MSGS2 (FFEBAD_COMMON_ALREADY_INIT, FATAL,
"Common block `%A' initialized at %0 already initialized at %1 -- only one program unit may specify initial values for a particular common block",
"Common block `%A' initialized at %0 already initialized at %1")
FFEBAD_MSGS2 (FFEBAD_COMMON_INIT_PAD, WARN,
"Initial padding for common block `%A' is %B %C at %0 -- consider reordering members, largest-type-size first",
"Initial padding for common block `%A' is %B %C at %0")
FFEBAD_MSGS2 (FFEBAD_COMMON_DIFF_PAD, FATAL,
"Initial padding for common block `%A' is %B %D at %0 but %C %E at %1 -- consider reordering members, largest-type-size first",
"Initial padding for common block `%A' is %B %D at %0 but %C %E at %1")
FFEBAD_MSGS1 (FFEBAD_COMMON_DIFF_SAVE, WARN,
"Common block `%A' is SAVEd, explicitly or implicitly, at %0 but not SAVEd at %1")
FFEBAD_MSGS1 (FFEBAD_COMMON_DIFF_SIZE, WARN,
"Common block `%A' is %B %D in length at %0 but %C %E at %1")
FFEBAD_MSGS2 (FFEBAD_COMMON_ENLARGED, FATAL,
"Common block `%A' is initialized to %B %D long at %0 but enlarged to %C %E at %1 -- use consistent definitions or reorder program units in source file",
"Common block `%A' is initialized to %B %D long at %0 but enlarged to %C %E at %1")
FFEBAD_MSGS1 (FFEBAD_COMMON_BLANK_INIT, WARN,
"Blank common initialized at %0")
FFEBAD_MSGS1 (FFEBAD_NEED_INTRINSIC, WARN,
"Intrinsic `%A' is passed as actual argument at %0 but not explicitly declared INTRINSIC")
FFEBAD_MSGS1 (FFEBAD_NEED_EXTERNAL, WARN,
"External procedure `%A' is passed as actual argument at %0 but not explicitly declared EXTERNAL")
FFEBAD_MSGS1 (FFEBAD_SYMBOL_UPPER_CASE, WARN,
"Character `%A' (for example) is upper-case in symbol name at %0")
FFEBAD_MSGS1 (FFEBAD_SYMBOL_LOWER_CASE, WARN,
"Character `%A' (for example) is lower-case in symbol name at %0")
FFEBAD_MSGS1 (FFEBAD_SYMBOL_NOLOWER_INITCAP, WARN,
"Character `%A' not followed at some point by lower-case character in symbol name at %0")
FFEBAD_MSGS1 (FFEBAD_SYMBOL_LOWER_INITCAP, WARN,
"Initial character `%A' is lower-case in symbol name at %0")
FFEBAD_MSGS2 (FFEBAD_DO_REAL, WARN,
"DO-variable `%A' is type REAL or DOUBLE PRECISION at %0 -- unexpected behavior likely",
"DO-variable `%A' is type REAL or DOUBLE PRECISION at %0")
FFEBAD_MSGS1 (FFEBAD_NAMELIST_CASE, WARN,
"NAMELIST not adequately supported by run-time library for source files with case preserved")
FFEBAD_MSGS1 (FFEBAD_NESTED_PERCENT, WARN,
"Nested %% construct (%%VAL, %%REF, or %%DESCR) at %0")
FFEBAD_MSGS2 (FFEBAD_ACTUALARG, WARN,
"Invalid actual argument at %0 -- replace hollerith constants with %%REF('string') and typeless constants with INTEGER constant equivalents, or use -fugly-args or -fugly",
"Invalid actual argument at %0")
FFEBAD_MSGS2 (FFEBAD_QUAD_UNSUPPORTED, FATAL,
"Quadruple-precision floating-point unsupported -- treating constant at %0 as double-precision",
"Quadruple-precision floating-point unsupported")
FFEBAD_MSGS2 (FFEBAD_TOO_BIG_INIT, WARN,
"Initialization of large (%B-unit) aggregate area `%A' at %0 currently very slow and takes lots of memory during g77 compile -- to be improved in 0.6",
"This could take a while (initializing `%A' at %0)...")
FFEBAD_MSGS1 (FFEBAD_BLOCKDATA_STMT, FATAL,
"Statement at %0 invalid in BLOCK DATA program unit at %1")
FFEBAD_MSGS1 (FFEBAD_TRUNCATING_CHARACTER, FATAL,
"Truncating characters on right side of character constant at %0")
FFEBAD_MSGS1 (FFEBAD_TRUNCATING_HOLLERITH, FATAL,
"Truncating characters on right side of hollerith constant at %0")
FFEBAD_MSGS1 (FFEBAD_TRUNCATING_NUMERIC, FATAL,
"Truncating non-zero data on left side of numeric constant at %0")
FFEBAD_MSGS1 (FFEBAD_TRUNCATING_TYPELESS, FATAL,
"Truncating non-zero data on left side of typeless constant at %0")
FFEBAD_MSGS1 (FFEBAD_TYPELESS_OVERFLOW, FATAL,
"Typeless constant at %0 too large")
FFEBAD_MSGS1 (FFEBAD_AMPERSAND, WARN,
"First-column ampersand continuation at %0")
FFEBAD_MSGS1 (FFEBAD_FILEWIDE_ALREADY_SEEN, FATAL,
"Global name `%A' defined at %0 already defined at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_FILEWIDE_ALREADY_SEEN_W, WARN,
"Global name `%A' defined at %0 already defined at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_FILEWIDE_DISAGREEMENT, FATAL,
"Global name `%A' is %B at %0 but is %C at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_FILEWIDE_DISAGREEMENT_W, WARN,
"Global name `%A' is %B at %0 but is %C at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_FILEWIDE_TYPE_MISMATCH, FATAL,
"Global name `%A' at %0 has different type at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_FILEWIDE_TYPE_MISMATCH_W, WARN,
"Global name `%A' at %0 has different type at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_FILEWIDE_NARGS, FATAL,
"Too %B arguments passed to `%A' at %0 versus definition at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_FILEWIDE_NARGS_W, WARN,
"Too %B arguments for `%A' at %0 versus invocation at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_FILEWIDE_ARG, FATAL,
"Argument #%B of `%A' is %C at %0 but is %D at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_FILEWIDE_ARG_W, WARN,
"Argument #%B of `%A' is %C at %0 but is %D at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_ARRAY_LARGE, FATAL,
"Array `%A' at %0 is too large to handle")
FFEBAD_MSGS1 (FFEBAD_SFUNC_UNUSED, WARN,
"Statement function `%A' defined at %0 is not used")
#undef INFORM
#undef TRIVIAL
#undef WARN
#undef PECULIAR
#undef FATAL
#undef WEIRD
#undef SEVERE
#undef DISASTER

View File

@ -1,108 +0,0 @@
/* bad.h -- Public #include File (module.h template V1.0)
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Owning Modules:
bad.c
Modifications:
*/
/* Allow multiple inclusion to work. */
#ifndef _H_f_bad
#define _H_f_bad
/* Simple definitions and enumerations. */
typedef enum
{
#define FFEBAD_MSGS1(KWD,SEV,MSG) KWD,
#define FFEBAD_MSGS2(KWD,SEV,LMSG,SMSG) KWD,
#include "bad.def"
#undef FFEBAD_MSGS1
#undef FFEBAD_MSGS2
FFEBAD
} ffebad;
typedef enum
{
/* Order important; must be increasing severity. */
FFEBAD_severityINFORMATIONAL, /* User notice. */
FFEBAD_severityTRIVIAL, /* Internal notice. */
FFEBAD_severityWARNING, /* User warning. */
FFEBAD_severityPECULIAR, /* Internal warning. */
FFEBAD_severityPEDANTIC, /* Pedantic, could be warning or error. */
FFEBAD_severityFATAL, /* User error. */
FFEBAD_severityWEIRD, /* Internal error. */
FFEBAD_severitySEVERE, /* User error, cannot continue. */
FFEBAD_severityDISASTER, /* Internal error, cannot continue. */
FFEBAD_severity
} ffebadSeverity;
/* Typedefs. */
typedef unsigned char ffebadIndex;
/* Include files needed by this one. */
#include "where.h"
/* Structure definitions. */
/* Global objects accessed by users of this module. */
extern bool ffebad_is_inhibited_;
/* Declare functions with prototypes. */
void ffebad_finish (void);
void ffebad_here (ffebadIndex i, ffewhereLine wl, ffewhereColumn wc);
void ffebad_init_0 (void);
bool ffebad_is_fatal (ffebad errnum);
ffebadSeverity ffebad_severity (ffebad errnum);
bool ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
char *message);
void ffebad_string (char *string);
/* Define macros. */
#define ffebad_inhibit() (ffebad_is_inhibited_)
#define ffebad_init_1()
#define ffebad_init_2()
#define ffebad_init_3()
#define ffebad_init_4()
#define ffebad_set_inhibit(f) (ffebad_is_inhibited_ = (f))
#define ffebad_start(e) ffebad_start_ (FALSE, (e), FFEBAD_severity, NULL)
#define ffebad_start_lex(e) ffebad_start_ (TRUE, (e), FFEBAD_severity, NULL)
#define ffebad_start_msg(m,s) ffebad_start_ (FALSE, FFEBAD, (s), (m))
#define ffebad_start_msg_lex(m,s) ffebad_start_ (TRUE, FFEBAD, (s), (m))
#define ffebad_terminate_0()
#define ffebad_terminate_1()
#define ffebad_terminate_2()
#define ffebad_terminate_3()
#define ffebad_terminate_4()
/* End of #include file. */
#endif

View File

@ -1,201 +0,0 @@
/* bit.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Related Modules:
None
Description:
Tracks arrays of booleans in useful ways.
Modifications:
*/
/* Include files. */
#include "proj.h"
#include "glimits.j"
#include "bit.h"
#include "malloc.h"
/* Externals defined here. */
/* Simple definitions and enumerations. */
/* Internal typedefs. */
/* Private include files. */
/* Internal structure definitions. */
/* Static objects accessed by functions in this module. */
/* Static functions (internal). */
/* Internal macros. */
/* ffebit_count -- Count # of bits set a particular way
ffebit b; // the ffebit object
ffebitCount offset; // 0..size-1
bool value; // FALSE (0), TRUE (1)
ffebitCount range; // # bits to test
ffebitCount number; // # bits equal to value
ffebit_count(b,offset,value,range,&number);
Sets <number> to # bits at <offset> through <offset + range - 1> set to
<value>. If <range> is 0, <number> is set to 0. */
void
ffebit_count (ffebit b, ffebitCount offset, bool value, ffebitCount range,
ffebitCount *number)
{
ffebitCount element;
ffebitCount bitno;
assert (offset + range <= b->size);
for (*number = 0; range != 0; --range, ++offset)
{
element = offset / CHAR_BIT;
bitno = offset % CHAR_BIT;
if (value
== ((b->bits[element] & ((unsigned char) 1 << bitno)) == 0 ? FALSE : TRUE))
++ * number;
}
}
/* ffebit_new -- Create a new ffebit object
ffebit b;
ffebit_kill(b);
Destroys an ffebit object obtained via ffebit_new. */
void
ffebit_kill (ffebit b)
{
malloc_kill_ks (b->pool, b,
offsetof (struct _ffebit_, bits)
+ (b->size + CHAR_BIT - 1) / CHAR_BIT);
}
/* ffebit_new -- Create a new ffebit object
ffebit b;
mallocPool pool;
ffebitCount size;
b = ffebit_new(pool,size);
Allocates an ffebit object that holds the values of <size> bits in pool
<pool>. */
ffebit
ffebit_new (mallocPool pool, ffebitCount size)
{
ffebit b;
b = malloc_new_zks (pool, "ffebit",
offsetof (struct _ffebit_, bits)
+ (size + CHAR_BIT - 1) / CHAR_BIT,
0);
b->pool = pool;
b->size = size;
return b;
}
/* ffebit_set -- Set value of # of bits
ffebit b; // the ffebit object
ffebitCount offset; // 0..size-1
bool value; // FALSE (0), TRUE (1)
ffebitCount length; // # bits to set starting at offset (usually 1)
ffebit_set(b,offset,value,length);
Sets bit #s <offset> through <offset + length - 1> to <value>. */
void
ffebit_set (ffebit b, ffebitCount offset, bool value, ffebitCount length)
{
ffebitCount i;
ffebitCount element;
ffebitCount bitno;
assert (offset + length <= b->size);
for (i = 0; i < length; ++i, ++offset)
{
element = offset / CHAR_BIT;
bitno = offset % CHAR_BIT;
b->bits[element] = (((unsigned char) (value ? 1 : 0)) << bitno)
| (b->bits[element] & ~((unsigned char) 1 << bitno));
}
}
/* ffebit_test -- Test value of # of bits
ffebit b; // the ffebit object
ffebitCount offset; // 0..size-1
bool value; // FALSE (0), TRUE (1)
ffebitCount length; // # bits with same value
ffebit_test(b,offset,&value,&length);
Returns value of bits at <offset> through <offset + length - 1> in
<value>. If <offset> is already at the end of the bit array (if
offset == ffebit_size(b)), <length> is set to 0 and <value> is
undefined. */
void
ffebit_test (ffebit b, ffebitCount offset, bool *value, ffebitCount *length)
{
ffebitCount i;
ffebitCount element;
ffebitCount bitno;
if (offset >= b->size)
{
assert (offset == b->size);
*length = 0;
return;
}
element = offset / CHAR_BIT;
bitno = offset % CHAR_BIT;
*value = (b->bits[element] & ((unsigned char) 1 << bitno)) == 0 ? FALSE : TRUE;
*length = 1;
for (i = b->size - offset - 1, ++offset; i != 0; --i, ++offset, ++*length)
{
element = offset / CHAR_BIT;
bitno = offset % CHAR_BIT;
if (*value
!= ((b->bits[element] & ((unsigned char) 1 << bitno)) == 0 ? FALSE : TRUE))
break;
}
}

View File

@ -1,84 +0,0 @@
/* bit.h -- Public #include File (module.h template V1.0)
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Owning Modules:
bit.c
Modifications:
*/
/* Allow multiple inclusion to work. */
#ifndef _H_f_bit
#define _H_f_bit
/* Simple definitions and enumerations. */
/* Typedefs. */
typedef struct _ffebit_ *ffebit;
typedef unsigned long ffebitCount;
#define ffebitCount_f "l"
/* Include files needed by this one. */
#include "malloc.h"
/* Structure definitions. */
struct _ffebit_
{
mallocPool pool;
ffebitCount size;
unsigned char bits[1];
};
/* Global objects accessed by users of this module. */
/* Declare functions with prototypes. */
void ffebit_count (ffebit b, ffebitCount offset, bool value, ffebitCount range,
ffebitCount *number);
void ffebit_kill (ffebit b);
ffebit ffebit_new (mallocPool pool, ffebitCount size);
void ffebit_set (ffebit b, ffebitCount offset, bool value, ffebitCount length);
void ffebit_test (ffebit b, ffebitCount offset, bool *value, ffebitCount *length);
/* Define macros. */
#define ffebit_init_0()
#define ffebit_init_1()
#define ffebit_init_2()
#define ffebit_init_3()
#define ffebit_init_4()
#define ffebit_pool(b) ((b)->pool)
#define ffebit_size(b) ((b)->size)
#define ffebit_terminate_0()
#define ffebit_terminate_1()
#define ffebit_terminate_2()
#define ffebit_terminate_3()
#define ffebit_terminate_4()
/* End of #include file. */
#endif

View File

@ -1,69 +0,0 @@
/* bld-op.def -- Public #include File (module.h template V1.0)
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Owning Modules:
bad.c
Modifications:
*/
FFEBLD_OP (FFEBLD_opANY, "ANY", 0)
FFEBLD_OP (FFEBLD_opSTAR, "STAR", 0) /* For adjustable arrays, alternate return dummies, etc. */
FFEBLD_OP (FFEBLD_opCONTER, "CONTER", 0)
FFEBLD_OP (FFEBLD_opARRTER, "ARRTER", 0) /* Array of constants (DATA...). */
FFEBLD_OP (FFEBLD_opACCTER, "ACCTER", 0) /* Accreting ARRTER. */
FFEBLD_OP (FFEBLD_opSYMTER, "SYMTER", 0)
FFEBLD_OP (FFEBLD_opITEM, "ITEM", 0)
FFEBLD_OP (FFEBLD_opUPLUS, "UPLUS", 1)
FFEBLD_OP (FFEBLD_opUMINUS, "UMINUS", 1)
FFEBLD_OP (FFEBLD_opADD, "ADD", 2)
FFEBLD_OP (FFEBLD_opSUBTRACT, "SUBTRACT", 2)
FFEBLD_OP (FFEBLD_opMULTIPLY, "MULTIPLY", 2)
FFEBLD_OP (FFEBLD_opDIVIDE, "DIVIDE", 2)
FFEBLD_OP (FFEBLD_opPOWER, "POWER", 2)
FFEBLD_OP (FFEBLD_opCONCATENATE, "CONCATENATE", 2)
FFEBLD_OP (FFEBLD_opNOT, "NOT", 1)
FFEBLD_OP (FFEBLD_opLT, "LT", 2)
FFEBLD_OP (FFEBLD_opLE, "LE", 2)
FFEBLD_OP (FFEBLD_opEQ, "EQ", 2)
FFEBLD_OP (FFEBLD_opNE, "NE", 2)
FFEBLD_OP (FFEBLD_opGT, "GT", 2)
FFEBLD_OP (FFEBLD_opGE, "GE", 2)
FFEBLD_OP (FFEBLD_opAND, "AND", 2)
FFEBLD_OP (FFEBLD_opOR, "OR", 2)
FFEBLD_OP (FFEBLD_opXOR, "XOR", 2)
FFEBLD_OP (FFEBLD_opEQV, "EQV", 2)
FFEBLD_OP (FFEBLD_opNEQV, "NEQV", 2)
FFEBLD_OP (FFEBLD_opPAREN, "PAREN", 1)
FFEBLD_OP (FFEBLD_opPERCENT_LOC, "%LOC", 1)
FFEBLD_OP (FFEBLD_opPERCENT_VAL, "%VAL", 1)
FFEBLD_OP (FFEBLD_opPERCENT_REF, "%REF", 1)
FFEBLD_OP (FFEBLD_opPERCENT_DESCR, "%DESCR", 1)
FFEBLD_OP (FFEBLD_opCONVERT, "CONVERT", 1)
FFEBLD_OP (FFEBLD_opREPEAT, "REPEAT", 2)
FFEBLD_OP (FFEBLD_opBOUNDS, "BOUNDS", 2) /* For low:high in dimension lists. */
FFEBLD_OP (FFEBLD_opFUNCREF, "FUNCREF", 2)
FFEBLD_OP (FFEBLD_opSUBRREF, "SUBRREF", 2)
FFEBLD_OP (FFEBLD_opARRAYREF, "ARRAYREF", 2)
FFEBLD_OP (FFEBLD_opSUBSTR, "SUBSTR", 2)
FFEBLD_OP (FFEBLD_opLABTER, "LABTER", 0)
FFEBLD_OP (FFEBLD_opLABTOK, "LABTOK", 0) /* Like LABTER but contains ffelexToken instead. */
FFEBLD_OP (FFEBLD_opIMPDO, "IMPDO", 2)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,320 +0,0 @@
@c Copyright (C) 1995-1998 Free Software Foundation, Inc.
@c This is part of the G77 manual.
@c For copying conditions, see the file g77.texi.
@c The text of this file appears in the file BUGS
@c in the G77 distribution, as well as in the G77 manual.
@c 1998-09-01
@ifclear BUGSONLY
@node Actual Bugs
@section Actual Bugs We Haven't Fixed Yet
@end ifclear
This section identifies bugs that @code{g77} @emph{users}
might run into.
This includes bugs that are actually in the @code{gcc}
back end (GBE) or in @code{libf2c}, because those
sets of code are at least somewhat under the control
of (and necessarily intertwined with) @code{g77}, so it
isn't worth separating them out.
For information on bugs that might afflict people who
configure, port, build, and install @code{g77},
@ref{Problems Installing}.
@itemize @bullet
@item
@code{g77} sometimes crashes when compiling code
containing the construct @samp{CMPLX(0.)} or similar.
This is a @code{gcc} back-end bug.
It can be worked around using @samp{-fno-emulate-complex},
though that might trigger other, older bugs.
Compiling without optimization is another work-around.
Fixed in @code{egcs} 1.1.
@item
@c Tim Prince discovered this.
Automatic arrays aren't working on HP-UX systems,
at least in HP-UX version 10.20.
Writing into them apparently causes over-writing
of statically declared data in the main program.
This probably means the arrays themselves are being under-allocated,
or pointers to them being improperly handled,
e.g. not passed to other procedures as they should be.
@item
@c Toon Moene discovered these.
Some Fortran code has been found to be miscompiled
by @code{g77} built on @code{gcc} version 2.8.1
on m68k-next-nextstep3 configurations
when using the @samp{-O2} option.
Even a C function is known to miscompile
on that configuration
when using the @samp{-O2 -funroll-loops} options.
Fixed in @code{egcs}.
@cindex DNRM2
@cindex stack, 387 coprocessor
@cindex ix86
@cindex -O2
@item
A code-generation bug afflicts
Intel x86 targets when @samp{-O2} is specified
compiling, for example, an old version of
the @samp{DNRM2} routine.
The x87 coprocessor stack is being
mismanaged in cases where assigned @code{GOTO}
and @code{ASSIGN} are involved.
Fixed in @code{egcs} version 1.1.
@item
@code{g77} fails to warn about
use of a ``live'' iterative-DO variable
as an implied-DO variable
in a @samp{WRITE} or @samp{PRINT} statement
(although it does warn about this in a @samp{READ} statement).
@item
A compiler crash, or apparently infinite run time,
can result when compiling complicated expressions
involving @code{COMPLEX} arithmetic
(especially multiplication).
Fixed in @code{egcs} version 1.1.
@item
Something about @code{g77}'s straightforward handling of
label references and definitions sometimes prevents the GBE
from unrolling loops.
Until this is solved, try inserting or removing @code{CONTINUE}
statements as the terminal statement, using the @code{END DO}
form instead, and so on.
@item
Some confusion in diagnostics concerning failing @code{INCLUDE}
statements from within @code{INCLUDE}'d or @code{#include}'d files.
@cindex integer constants
@cindex constants, integer
@item
@code{g77} assumes that @code{INTEGER(KIND=1)} constants range
from @samp{-2**31} to @samp{2**31-1} (the range for
two's-complement 32-bit values),
instead of determining their range from the actual range of the
type for the configuration (and, someday, for the constant).
Further, it generally doesn't implement the handling
of constants very well in that it makes assumptions about the
configuration that it no longer makes regarding variables (types).
Included with this item is the fact that @code{g77} doesn't recognize
that, on IEEE-754/854-compliant systems, @samp{0./0.} should produce a NaN
and no warning instead of the value @samp{0.} and a warning.
This is to be fixed in version 0.6, when @code{g77} will use the
@code{gcc} back end's constant-handling mechanisms to replace its own.
@cindex compiler speed
@cindex speed, of compiler
@cindex compiler memory usage
@cindex memory usage, of compiler
@cindex large aggregate areas
@cindex initialization
@cindex DATA statement
@cindex statements, DATA
@item
@code{g77} uses way too much memory and CPU time to process large aggregate
areas having any initialized elements.
For example, @samp{REAL A(1000000)} followed by @samp{DATA A(1)/1/}
takes up way too much time and space, including
the size of the generated assembler file.
This is to be mitigated somewhat in version 0.6.
Version 0.5.18 improves cases like this---specifically,
cases of @emph{sparse} initialization that leave large, contiguous
areas uninitialized---significantly.
However, even with the improvements, these cases still
require too much memory and CPU time.
(Version 0.5.18 also improves cases where the initial values are
zero to a much greater degree, so if the above example
ends with @samp{DATA A(1)/0/}, the compile-time performance
will be about as good as it will ever get, aside from unrelated
improvements to the compiler.)
Note that @code{g77} does display a warning message to
notify the user before the compiler appears to hang.
@xref{Large Initialization,,Initialization of Large Aggregate Areas},
for information on how to change the point at which
@code{g77} decides to issue this warning.
@cindex debugging
@cindex common blocks
@cindex equivalence areas
@cindex local equivalence areas
@item
@code{g77} doesn't emit variable and array members of common blocks for use
with a debugger (the @samp{-g} command-line option).
The code is present to do this, but doesn't work with at least
one debug format---perhaps it works with others.
And it turns out there's a similar bug for
local equivalence areas, so that has been disabled as well.
As of Version 0.5.19, a temporary kludge solution is provided whereby
some rudimentary information on a member is written as a string that
is the member's value as a character string.
@xref{Code Gen Options,,Options for Code Generation Conventions},
for information on the @samp{-fdebug-kludge} option.
@cindex code, displaying main source
@cindex displaying main source code
@cindex debugging main source code
@cindex printing main source
@item
When debugging, after starting up the debugger but before being able
to see the source code for the main program unit, the user must currently
set a breakpoint at @samp{MAIN__} (or @samp{MAIN___} or @samp{MAIN_} if
@samp{MAIN__} doesn't exist)
and run the program until it hits the breakpoint.
At that point, the
main program unit is activated and about to execute its first
executable statement, but that's the state in which the debugger should
start up, as is the case for languages like C.
@cindex debugger
@item
Debugging @code{g77}-compiled code using debuggers other than
@code{gdb} is likely not to work.
Getting @code{g77} and @code{gdb} to work together is a known
problem---getting @code{g77} to work properly with other
debuggers, for which source code often is unavailable to @code{g77}
developers, seems like a much larger, unknown problem,
and is a lower priority than making @code{g77} and @code{gdb}
work together properly.
On the other hand, information about problems other debuggers
have with @code{g77} output might make it easier to properly
fix @code{g77}, and perhaps even improve @code{gdb}, so it
is definitely welcome.
Such information might even lead to all relevant products
working together properly sooner.
@cindex Alpha, support
@cindex support, Alpha
@item
@code{g77} doesn't work perfectly on 64-bit configurations
such as the Digital Semiconductor (``DEC'') Alpha.
This problem is largely resolved as of version 0.5.23.
Version 0.6 should solve most or all remaining problems
(such as cross-compiling involving 64-bit machines).
@cindex COMPLEX support
@cindex support, COMPLEX
@item
Maintainers of @code{gcc} report that the back end definitely has ``broken''
support for @code{COMPLEX} types.
Based on their input, it seems many of
the problems affect only the more-general facilities for gcc's
@code{__complex__} type, such as @code{__complex__ int}
(where the real and imaginary parts are integers) that GNU
Fortran does not use.
Version 0.5.20 of @code{g77} works around this
problem by not using the back end's support for @code{COMPLEX}.
The new option @samp{-fno-emulate-complex} avoids the work-around,
reverting to using the same ``broken'' mechanism as that used
by versions of @code{g77} prior to 0.5.20.
@cindex ELF support
@cindex support, ELF
@cindex -fPIC option
@cindex options, -fPIC
@item
@code{g77} sometimes produces invalid assembler code
when using the @samp{-fPIC} option (such as compiling for ELF targets)
on the Intel x86 architecture target.
The symptom is that the assembler complains about invalid opcodes.
This bug is in the @code{gcc} back end.
Fixed in @code{egcs} version 1.0.2.
@cindex padding
@cindex structures
@cindex common blocks
@cindex equivalence areas
@item
@code{g77} currently inserts needless padding for things like
@samp{COMMON A,IPAD} where @samp{A} is @code{CHARACTER*1} and @samp{IPAD}
is @code{INTEGER(KIND=1)} on machines like x86,
because the back end insists that @samp{IPAD}
be aligned to a 4-byte boundary,
but the processor has no such requirement
(though it is usually good for performance).
The @code{gcc} back end needs to provide a wider array
of specifications of alignment requirements and preferences for targets,
and front ends like @code{g77} should take advantage of this
when it becomes available.
@cindex alignment
@cindex double-precision performance
@cindex -malign-double
@item
The x86 target's @samp{-malign-double} option
no longer reliably aligns double-precision variables and arrays
when they are placed in the stack frame.
This can significantly reduce the performance of some applications,
even on a run-to-run basis
(that is, performance measurements can vary fairly widely
depending on whether frequently used variables are properly aligned,
and that can change from one program run to the next,
even from one procedure call to the next).
Versions 0.5.22 and earlier of @code{g77}
included a patch to @code{gcc} that enabled this,
but that patch has been deemed an improper (probably buggy) one
for version 2.8 of @code{gcc} and for @code{egcs}.
Note that version 1.1 of @code{egcs}
aligns double-precision variables and arrays
when they are in static storage
even if @samp{-malign-double} is not specified.
There is ongoing investigation into
how to make @samp{-malign-double} work properly,
also into how to make it unnecessary to get
all double-precision variables and arrays aligned
when such alignment would not violate
the relevant specifications for processor
and inter-procedural interfaces.
For a suite of programs to test double-precision alignment,
see @uref{ftp://alpha.gnu.org/gnu/g77/align/}.
@cindex complex performance
@cindex aliasing
@item
The @code{libf2c} routines that perform some run-time
arithmetic on @code{COMPLEX} operands
were modified circa version 0.5.20 of @code{g77}
to work properly even in the presence of aliased operands.
While the @code{g77} and @code{netlib} versions of @code{libf2c}
differ on how this is accomplished,
the main differences are that we believe
the @code{g77} version works properly
even in the presence of @emph{partially} aliased operands.
However, these modifications have reduced performance
on targets such as x86,
due to the extra copies of operands involved.
@end itemize

View File

@ -1,17 +0,0 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename BUGS
@set BUGSONLY
@c %**end of header
@c The immediately following lines apply to the BUGS file
@c which is generated using this file.
This file lists known bugs in the GNU Fortran compiler.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
You may copy, distribute, and modify it freely as long as you preserve
this copyright notice and permission notice.
@node Top,,, (dir)
@chapter Bugs in GNU Fortran
@include bugs.texi
@bye

View File

@ -1,282 +0,0 @@
/* com-rt.def -- Public #include File (module.h template V1.0)
Copyright (C) 1995-1997 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Owning Modules:
com.c
Modifications:
*/
/* DEFGFRT(CODE,NAME,TYPE,VOLATILE,COMPLEX):
CODE -- the #define name to use to refer to the function in g77 code
NAME -- the name as seen by the back end and, with whatever massaging
is normal, the linker
TYPE -- a code for the tree for the type, assigned when first encountered
(NOTE: There's a distinction made between the semantic return
value for the function, and the actual return mechanism; e.g.
`r_abs()' computes a single-precision `float' return value
but returns it as a `double'. This distinction is important
and is flagged via the _F2C_ versus _GNU_ suffix.)
ARGS -- a string of codes representing the types of the arguments; the
last type specifies the type for that and all following args,
and the null pointer (0) means the same as "0":
0 Not applicable at and beyond this point
& Pointer to type that follows
a char
c complex
d doublereal
e doublecomplex
f real
i integer
j longint
VOLATILE -- TRUE if the function never returns (gen's emit_barrier in
g77 back end)
COMPLEX -- TRUE if the return value is COMPLEX or DOUBLE COMPLEX and
thus might need to be returned as ptr-to-1st-arg
*/
DEFGFRT (FFECOM_gfrtCAT, "s_cat", FFECOM_rttypeVOID_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtCMP, "s_cmp", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtCOPY, "s_copy", FFECOM_rttypeVOID_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtPAUSE, "s_paus", FFECOM_rttypeVOID_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSTOP, "s_stop", FFECOM_rttypeVOID_, 0, TRUE, FALSE)
DEFGFRT (FFECOM_gfrtSRDUE, "s_rdue", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtERDUE, "e_rdue", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSRSUE, "s_rsue", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtERSUE, "e_rsue", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSRDFE, "s_rdfe", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtERDFE, "e_rdfe", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSRSFI, "s_rsfi", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtERSFI, "e_rsfi", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSRSFE, "s_rsfe", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtERSFE, "e_rsfe", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSRSLI, "s_rsli", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtERSLI, "e_rsli", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSRSLE, "s_rsle", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtERSLE, "e_rsle", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSRSNE, "s_rsne", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSWDUE, "s_wdue", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtEWDUE, "e_wdue", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSWSUE, "s_wsue", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtEWSUE, "e_wsue", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSWDFE, "s_wdfe", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtEWDFE, "e_wdfe", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSWSFI, "s_wsfi", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtEWSFI, "e_wsfi", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSWSFE, "s_wsfe", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtEWSFE, "e_wsfe", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSWSLI, "s_wsli", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtEWSLI, "e_wsli", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSWSLE, "s_wsle", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtEWSLE, "e_wsle", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSWSNE, "s_wsne", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDOFIO, "do_fio", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDOLIO, "do_lio", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDOUIO, "do_uio", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFOPEN, "f_open", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFCLOS, "f_clos", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFINQU, "f_inqu", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFBACK, "f_back", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFEND, "f_end", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFREW, "f_rew", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtABORT, "G77_abort_0", FFECOM_rttypeVOID_, 0, TRUE, FALSE)
DEFGFRT (FFECOM_gfrtABS, "r_abs", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtACCESS, "G77_access_0", FFECOM_rttypeINTEGER_, "&a&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtACOS, "r_acos", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtAIMAG, "r_imag", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtAINT, "r_int", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtALARM, "G77_alarm_0", FFECOM_rttypeINTEGER_, "&i0", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtALOG, "r_log", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtALOG10, "r_lg10", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtAMOD, "r_mod", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtANINT, "r_nint", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtASIN, "r_asin", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtATAN, "r_atan", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtATAN2, "r_atn2", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtCABS, "c_abs", FFECOM_rttypeREAL_F2C_, "&c", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtCCOS, "c_cos", FFECOM_rttypeCOMPLEX_F2C_, "&c", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtCEXP, "c_exp", FFECOM_rttypeCOMPLEX_F2C_, "&c", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtCHDIR, "G77_chdir_0", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtCLOG, "c_log", FFECOM_rttypeCOMPLEX_F2C_, "&c", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtCHMOD, "G77_chmod_0", FFECOM_rttypeINTEGER_, "&a&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtCONJG, "r_cnjg", FFECOM_rttypeCOMPLEX_F2C_, "&c", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtCOS, "r_cos", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtCOSH, "r_cosh", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtCSIN, "c_sin", FFECOM_rttypeCOMPLEX_F2C_, "&c", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtCSQRT, "c_sqrt", FFECOM_rttypeCOMPLEX_F2C_, "&c", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtCTIME, "G77_ctime_0", FFECOM_rttypeCHARACTER_, "&j", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDABS, "d_abs", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDACOS, "d_acos", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDASIN, "d_asin", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDATAN, "d_atan", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDATAN2, "d_atn2", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDATE, "G77_date_0", FFECOM_rttypeVOID_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDATE_AND_TIME, "G77_date_and_time_0", FFECOM_rttypeVOID_, "&a&a&a&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_BESJ0, "j0", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_BESJ1, "j1", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_BESJN, "jn", FFECOM_rttypeDOUBLE_, "id", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_BESY0, "y0", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_BESY1, "y1", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_BESYN, "yn", FFECOM_rttypeDOUBLE_, "id", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDCOS, "d_cos", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDCOSH, "d_cosh", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDDIM, "d_dim", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDERF, "G77_derf_0", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDERFC, "G77_derfc_0", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDEXP, "d_exp", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDIM, "r_dim", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDINT, "d_int", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDLOG, "d_log", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDLOG10, "d_lg10", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDMOD, "d_mod", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDNINT, "d_nint", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDPROD, "d_prod", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDSIGN, "d_sign", FFECOM_rttypeDOUBLE_, "&d&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDSIN, "d_sin", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDSINH, "d_sinh", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDSQRT, "d_sqrt", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDTAN, "d_tan", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDTANH, "d_tanh", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDTIME, "G77_dtime_0", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtERF, "G77_erf_0", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtERFC, "G77_erfc_0", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtETIME, "G77_etime_0", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtEXIT, "G77_exit_0", FFECOM_rttypeVOID_, "&i", TRUE, FALSE)
DEFGFRT (FFECOM_gfrtEXP, "r_exp", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFDATE, "G77_fdate_0", FFECOM_rttypeCHARACTER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFGET, "G77_fget_0", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFGETC, "G77_fgetc_0", FFECOM_rttypeINTEGER_, "&i&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFLUSH, "G77_flush_0", FFECOM_rttypeVOID_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFLUSH1, "G77_flush1_0", FFECOM_rttypeVOID_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFNUM, "G77_fnum_0", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFPUT, "G77_fput_0", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFPUTC, "G77_fputc_0", FFECOM_rttypeINTEGER_, "&i&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFSTAT, "G77_fstat_0", FFECOM_rttypeINTEGER_, "&i&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFTELL, "G77_ftell_0", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtFSEEK, "G77_fseek_0", FFECOM_rttypeINTEGER_, "&i&i&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtGERROR, "G77_gerror_0", FFECOM_rttypeVOID_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtGETARG, "G77_getarg_0", FFECOM_rttypeVOID_, "&i&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtGETCWD, "G77_getcwd_0", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtGETGID, "G77_getgid_0", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtGETLOG, "G77_getlog_0", FFECOM_rttypeVOID_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtGETPID, "G77_getpid_0", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtGETUID, "G77_getuid_0", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtGETENV, "G77_getenv_0", FFECOM_rttypeVOID_, "&a&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtGMTIME, "G77_gmtime_0", FFECOM_rttypeVOID_, "&i&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtHOSTNM, "G77_hostnm_0", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtIABS, "i_abs", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtIARGC, "G77_iargc_0", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtIDATE, "G77_idate_0", FFECOM_rttypeVOID_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtIDIM, "i_dim", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtIDNINT, "i_dnnt", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtIERRNO, "G77_ierrno_0", FFECOM_rttypeINTEGER_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtINDEX, "i_indx", FFECOM_rttypeINTEGER_, "&a&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtIRAND, "G77_irand_0", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtISIGN, "i_sign", FFECOM_rttypeINTEGER_, "&i&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtISATTY, "G77_isatty_0", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtITIME, "G77_itime_0", FFECOM_rttypeVOID_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtKILL, "G77_kill_0", FFECOM_rttypeINTEGER_, "&i&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtLEN, "i_len", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtLGE, "l_ge", FFECOM_rttypeLOGICAL_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtLGT, "l_gt", FFECOM_rttypeLOGICAL_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtLINK, "G77_link_0", FFECOM_rttypeINTEGER_, "&a&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtLLE, "l_le", FFECOM_rttypeLOGICAL_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtLLT, "l_lt", FFECOM_rttypeLOGICAL_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtLNBLNK, "G77_lnblnk_0", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtLSTAT, "G77_lstat_0", FFECOM_rttypeINTEGER_, "&a&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtLTIME, "G77_ltime_0", FFECOM_rttypeVOID_, "&i&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtMCLOCK, "G77_mclock_0", FFECOM_rttypeLONGINT_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtMOD, "i_mod", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtNINT, "i_nint", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtPERROR, "G77_perror_0", FFECOM_rttypeVOID_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtRAND, "G77_rand_0", FFECOM_rttypeREAL_F2C_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtRENAME, "G77_rename_0", FFECOM_rttypeINTEGER_, "&a&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSECNDS, "G77_secnds_0", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSECOND, "G77_second_0", FFECOM_rttypeREAL_F2C_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSIGN, "r_sign", FFECOM_rttypeREAL_F2C_, "&f&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_SIGNAL, "G77_signal_0", FFECOM_rttypeVOIDSTAR_, "&i0", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSIN, "r_sin", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSINH, "r_sinh", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSLEEP, "G77_sleep_0", FFECOM_rttypeVOID_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSQRT, "r_sqrt", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSRAND, "G77_srand_0", FFECOM_rttypeVOID_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSTAT, "G77_stat_0", FFECOM_rttypeINTEGER_, "&a&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSYMLNK, "G77_symlnk_0", FFECOM_rttypeINTEGER_, "&a&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSYSTEM, "G77_system_0", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSYSTEM_CLOCK, "G77_system_clock_0", FFECOM_rttypeVOID_, "&i&i&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtTAN, "r_tan", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtTANH, "r_tanh", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtTIME, "G77_time_0", FFECOM_rttypeLONGINT_, 0, FALSE, FALSE)
DEFGFRT (FFECOM_gfrtTTYNAM, "G77_ttynam_0", FFECOM_rttypeCHARACTER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtUNLINK, "G77_unlink_0", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtUMASK, "G77_umask_0", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtVXTIDATE, "G77_vxtidate_0", FFECOM_rttypeVOID_, "&i&i&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtVXTTIME, "G77_vxttime_0", FFECOM_rttypeVOID_, "&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtCDABS, "z_abs", FFECOM_rttypeDOUBLE_, "&e", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtCDCOS, "z_cos", FFECOM_rttypeDBLCMPLX_F2C_, "&e", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtCDEXP, "z_exp", FFECOM_rttypeDBLCMPLX_F2C_, "&e", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtCDLOG, "z_log", FFECOM_rttypeDBLCMPLX_F2C_, "&e", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtDCONJG, "d_cnjg", FFECOM_rttypeDBLCMPLX_F2C_, "&e", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtCDSIN, "z_sin", FFECOM_rttypeDBLCMPLX_F2C_, "&e", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtCDSQRT, "z_sqrt", FFECOM_rttypeDBLCMPLX_F2C_, "&e", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtDIMAG, "d_imag", FFECOM_rttypeDOUBLE_, "&e", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_ACOS, "acos", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_ASIN, "asin", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_ATAN, "atan", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_ATAN2, "atan2", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_COS, "__builtin_cos", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_COSH, "cosh", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_ERF, "erf", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_ERFC, "erfc", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_EXP, "exp", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_FLOOR, "floor", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_LOG, "log", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_SIN, "__builtin_sin", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_SINH, "sinh", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_SQRT, "__builtin_fsqrt", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_TAN, "tan", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_TANH, "tanh", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtPOW_CI, "pow_ci", FFECOM_rttypeCOMPLEX_F2C_, "&c&i", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtPOW_DD, "pow_dd", FFECOM_rttypeDOUBLE_, "&d&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtPOW_DI, "pow_di", FFECOM_rttypeDOUBLE_, "&d&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtPOW_II, "pow_ii", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtPOW_QQ, "pow_qq", FFECOM_rttypeLONGINT_, "&j&j", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtPOW_RI, "pow_ri", FFECOM_rttypeREAL_F2C_, "&f&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtPOW_ZI, "pow_zi", FFECOM_rttypeDBLCMPLX_F2C_, "&e&i", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtPOW_ZZ, "pow_zz", FFECOM_rttypeDBLCMPLX_F2C_, "&e&e", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtDIV_CC, "c_div", FFECOM_rttypeCOMPLEX_F2C_, "&c", FALSE, TRUE)
DEFGFRT (FFECOM_gfrtDIV_ZZ, "z_div", FFECOM_rttypeDBLCMPLX_F2C_, "&e", FALSE, TRUE)

16512
gcc/f/com.c

File diff suppressed because it is too large Load Diff

View File

@ -1,376 +0,0 @@
/* com.h -- Public #include File (module.h template V1.0)
Copyright (C) 1995-1997 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Owning Modules:
com.c
Modifications:
*/
/* Allow multiple inclusion to work. */
#ifndef _H_f_com
#define _H_f_com
/* Simple definitions and enumerations. */
#define FFECOM_dimensionsMAX 7 /* Max # dimensions (quick hack). */
#define FFECOM_targetFFE 1
#define FFECOM_targetGCC 2
#ifndef FFE_STANDALONE
#define FFECOM_targetCURRENT FFECOM_targetGCC /* Backend! */
#define FFECOM_ONEPASS 0
#else
#define FFECOM_targetCURRENT FFECOM_targetFFE
#define FFECOM_ONEPASS 0
#endif
#if FFECOM_ONEPASS
#define FFECOM_TWOPASS 0
#else
#define FFECOM_TWOPASS 1
#endif
#define FFECOM_SIZE_UNIT "byte" /* Singular form. */
#define FFECOM_SIZE_UNITS "bytes" /* Plural form. */
#if FFECOM_targetCURRENT == FFECOM_targetGCC
#define FFECOM_constantNULL NULL_TREE
#define FFECOM_globalNULL NULL_TREE
#define FFECOM_labelNULL NULL_TREE
#define FFECOM_storageNULL NULL_TREE
#define FFECOM_symbolNULL ffecom_symbol_null_
/* Shorthand for types used in f2c.h and that g77 perhaps allows some
flexibility regarding in the section below. I.e. the actual numbers
below aren't important, as long as they're unique. */
#define FFECOM_f2ccodeCHAR 1
#define FFECOM_f2ccodeSHORT 2
#define FFECOM_f2ccodeINT 3
#define FFECOM_f2ccodeLONG 4
#define FFECOM_f2ccodeLONGLONG 5
#define FFECOM_f2ccodeCHARPTR 6 /* char * */
#define FFECOM_f2ccodeFLOAT 7
#define FFECOM_f2ccodeDOUBLE 8
#define FFECOM_f2ccodeLONGDOUBLE 9
#define FFECOM_f2ccodeTWOREALS 10
#define FFECOM_f2ccodeTWODOUBLEREALS 11
#if FFECOM_DETERMINE_TYPES /* only for com.c and configure */
/* Begin f2c.h information. This must match the info in the f2c.h used
to build the libf2c with which g77-generated code is linked, or there
will probably be bugs, some of them difficult to detect or even trigger. */
/* Do we need int (for 32-bit or 64-bit systems) or long (16-bit or
normally 32-bit) for f2c-type integers? */
#ifndef BITS_PER_WORD
#define BITS_PER_WORD 32
#endif
#ifndef CHAR_TYPE_SIZE
#define CHAR_TYPE_SIZE BITS_PER_UNIT
#endif
#ifndef SHORT_TYPE_SIZE
#define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
#endif
#ifndef INT_TYPE_SIZE
#define INT_TYPE_SIZE BITS_PER_WORD
#endif
#ifndef LONG_TYPE_SIZE
#define LONG_TYPE_SIZE BITS_PER_WORD
#endif
#ifndef LONG_LONG_TYPE_SIZE
#define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
#endif
#ifndef WCHAR_UNSIGNED
#define WCHAR_UNSIGNED 0
#endif
#ifndef FLOAT_TYPE_SIZE
#define FLOAT_TYPE_SIZE BITS_PER_WORD
#endif
#ifndef DOUBLE_TYPE_SIZE
#define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
#endif
#ifndef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
#endif
#if LONG_TYPE_SIZE == FLOAT_TYPE_SIZE
# define FFECOM_f2cINTEGER FFECOM_f2ccodeLONG
# define FFECOM_f2cLOGICAL FFECOM_f2ccodeLONG
#elif INT_TYPE_SIZE == FLOAT_TYPE_SIZE
# define FFECOM_f2cINTEGER FFECOM_f2ccodeINT
# define FFECOM_f2cLOGICAL FFECOM_f2ccodeINT
#else
# error Cannot find a suitable type for FFECOM_f2cINTEGER
#endif
#if LONG_TYPE_SIZE == (FLOAT_TYPE_SIZE * 2)
# define FFECOM_f2cLONGINT FFECOM_f2ccodeLONG
#elif LONG_LONG_TYPE_SIZE == (FLOAT_TYPE_SIZE * 2)
# define FFECOM_f2cLONGINT FFECOM_f2ccodeLONGLONG
#else
# error Cannot find a suitable type for FFECOM_f2cLONGINT
#endif
#define FFECOM_f2cADDRESS FFECOM_f2ccodeCHARPTR
#define FFECOM_f2cSHORTINT FFECOM_f2ccodeSHORT
#define FFECOM_f2cREAL FFECOM_f2ccodeFLOAT
#define FFECOM_f2cDOUBLEREAL FFECOM_f2ccodeDOUBLE
#define FFECOM_f2cCOMPLEX FFECOM_f2ccodeTWOREALS
#define FFECOM_f2cDOUBLECOMPLEX FFECOM_f2ccodeTWODOUBLEREALS
#define FFECOM_f2cSHORTLOGICAL FFECOM_f2ccodeSHORT
#define FFECOM_f2cLOGICAL1 FFECOM_f2ccodeCHAR
#define FFECOM_f2cINTEGER1 FFECOM_f2ccodeCHAR
/* These must be f2c's INTEGER type, to match runtime/f2c.h.in. */
#define FFECOM_f2cFLAG FFECOM_f2cINTEGER
#define FFECOM_f2cFTNINT FFECOM_f2cINTEGER
#define FFECOM_f2cFTNLEN FFECOM_f2cINTEGER
#endif /* #if FFECOM_DETERMINE_TYPES */
/* Everything else in f2c.h, specifically the structures used in
interfacing compiled code with the library, must remain exactly
as delivered, or g77 internals (mostly com.c and ste.c) must
be modified accordingly to compensate. Or there will be...trouble. */
typedef enum
{
#define DEFGFRT(CODE,NAME,TYPE,ARGS,VOLATILE,COMPLEX) CODE,
#include "com-rt.def"
#undef DEFGFRT
FFECOM_gfrt
} ffecomGfrt;
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
/* Typedefs. */
#if FFECOM_targetCURRENT == FFECOM_targetGCC
#ifndef TREE_CODE
#include "tree.j"
#endif
#ifndef BUILT_FOR_270
#ifdef DECL_STATIC_CONSTRUCTOR /* In gcc/tree.h. */
#define BUILT_FOR_270 1
#else
#define BUILT_FOR_270 0
#endif
#endif /* !defined (BUILT_FOR_270) */
#ifndef BUILT_FOR_280
#ifdef DECL_ONE_ONLY /* In gcc/tree.h. */
#define BUILT_FOR_280 1
#else
#define BUILT_FOR_280 0
#endif
#endif /* !defined (BUILT_FOR_280) */
typedef tree ffecomConstant;
#define FFECOM_constantHOOK
typedef tree ffecomLabel;
#define FFECOM_globalHOOK
typedef tree ffecomGlobal;
#define FFECOM_labelHOOK
typedef tree ffecomStorage;
#define FFECOM_storageHOOK
typedef struct _ffecom_symbol_ ffecomSymbol;
#define FFECOM_symbolHOOK
struct _ffecom_symbol_
{
tree decl_tree;
tree length_tree; /* For CHARACTER dummies. */
tree vardesc_tree; /* For NAMELIST. */
tree assign_tree; /* For ASSIGN'ed vars. */
bool addr; /* Is address of item instead of item. */
};
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
/* Include files needed by this one. */
#include "bld.h"
#include "info.h"
#include "lab.h"
#include "storag.h"
#include "symbol.h"
/* Structure definitions. */
/* Global objects accessed by users of this module. */
#if FFECOM_targetCURRENT == FFECOM_targetGCC
extern tree long_integer_type_node;
extern tree complex_double_type_node;
extern tree string_type_node;
extern tree ffecom_integer_type_node;
extern tree ffecom_integer_zero_node;
extern tree ffecom_integer_one_node;
extern tree ffecom_tree_type[FFEINFO_basictype][FFEINFO_kindtype];
extern ffecomSymbol ffecom_symbol_null_;
extern ffeinfoKindtype ffecom_pointer_kind_;
extern ffeinfoKindtype ffecom_label_kind_;
extern int ffecom_f2c_typecode_[FFEINFO_basictype][FFEINFO_kindtype];
extern tree ffecom_f2c_integer_type_node;
extern tree ffecom_f2c_address_type_node;
extern tree ffecom_f2c_real_type_node;
extern tree ffecom_f2c_doublereal_type_node;
extern tree ffecom_f2c_complex_type_node;
extern tree ffecom_f2c_doublecomplex_type_node;
extern tree ffecom_f2c_longint_type_node;
extern tree ffecom_f2c_logical_type_node;
extern tree ffecom_f2c_flag_type_node;
extern tree ffecom_f2c_ftnlen_type_node;
extern tree ffecom_f2c_ftnlen_zero_node;
extern tree ffecom_f2c_ftnlen_one_node;
extern tree ffecom_f2c_ftnlen_two_node;
extern tree ffecom_f2c_ptr_to_ftnlen_type_node;
extern tree ffecom_f2c_ftnint_type_node;
extern tree ffecom_f2c_ptr_to_ftnint_type_node;
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
/* Declare functions with prototypes. */
#if FFECOM_targetCURRENT == FFECOM_targetGCC
tree ffecom_1 (enum tree_code code, tree type, tree node);
tree ffecom_1_fn (tree node);
tree ffecom_2 (enum tree_code code, tree type, tree node1, tree node2);
bool ffecom_2pass_advise_entrypoint (ffesymbol entry);
void ffecom_2pass_do_entrypoint (ffesymbol entry);
tree ffecom_2s (enum tree_code code, tree type, tree node1, tree node2);
tree ffecom_3 (enum tree_code code, tree type, tree node1, tree node2,
tree node3);
tree ffecom_3s (enum tree_code code, tree type, tree node1, tree node2,
tree node3);
tree ffecom_arg_expr (ffebld expr, tree *length);
tree ffecom_arg_ptr_to_expr (ffebld expr, tree *length);
tree ffecom_call_gfrt (ffecomGfrt ix, tree args);
tree ffecom_constantunion (ffebldConstantUnion *cu, ffeinfoBasictype bt,
ffeinfoKindtype kt, tree tree_type);
tree ffecom_decl_field (tree context, tree prevfield, char *name,
tree type);
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
void ffecom_close_include (FILE *f);
int ffecom_decode_include_option (char *spec);
void ffecom_end_transition (void);
void ffecom_exec_transition (void);
void ffecom_expand_let_stmt (ffebld dest, ffebld source);
#if FFECOM_targetCURRENT == FFECOM_targetGCC
tree ffecom_expr (ffebld expr);
tree ffecom_expr_assign (ffebld expr);
tree ffecom_expr_assign_w (ffebld expr);
tree ffecom_expr_rw (ffebld expr);
void ffecom_finish_compile (void);
void ffecom_finish_decl (tree decl, tree init, bool is_top_level);
void ffecom_finish_progunit (void);
tree ffecom_get_invented_identifier (char *pattern, char *text,
int number);
ffeinfoKindtype ffecom_gfrt_basictype (ffecomGfrt ix);
ffeinfoKindtype ffecom_gfrt_kindtype (ffecomGfrt ix);
void ffecom_init_0 (void);
void ffecom_init_2 (void);
tree ffecom_list_expr (ffebld list);
tree ffecom_list_ptr_to_expr (ffebld list);
tree ffecom_lookup_label (ffelab label);
tree ffecom_modify (tree newtype, tree lhs, tree rhs);
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
void ffecom_file (char *name);
void ffecom_notify_init_storage (ffestorag st);
void ffecom_notify_init_symbol (ffesymbol s);
void ffecom_notify_primary_entry (ffesymbol fn);
FILE *ffecom_open_include (char *name, ffewhereLine l, ffewhereColumn c);
#if FFECOM_targetCURRENT == FFECOM_targetGCC
void ffecom_pop_calltemps (void);
void ffecom_pop_tempvar (tree var);
tree ffecom_ptr_to_expr (ffebld expr);
void ffecom_push_calltemps (void);
tree ffecom_push_tempvar (tree type, ffetargetCharacterSize size,
int elements, bool auto_pop);
tree ffecom_return_expr (ffebld expr);
tree ffecom_save_tree (tree t);
tree ffecom_start_decl (tree decl, bool is_init);
void ffecom_sym_commit (ffesymbol s);
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
ffesymbol ffecom_sym_end_transition (ffesymbol s);
ffesymbol ffecom_sym_exec_transition (ffesymbol s);
ffesymbol ffecom_sym_learned (ffesymbol s);
#if FFECOM_targetCURRENT == FFECOM_targetGCC
void ffecom_sym_retract (ffesymbol s);
tree ffecom_temp_label (void);
tree ffecom_truth_value (tree expr);
tree ffecom_truth_value_invert (tree expr);
tree ffecom_which_entrypoint_decl (void);
/* These need to be in the front end with exactly these interfaces,
as they're called by the back end. */
int mark_addressable (tree expr);
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
/* Define macros. */
#if FFECOM_targetCURRENT == FFECOM_targetFFE
#define ffecom_expr(e) (e)
#define ffecom_init_0()
#define ffecom_init_2()
#define ffecom_label_kind() FFEINFO_kindtypeINTEGERDEFAULT
#define ffecom_pointer_kind() FFEINFO_kindtypeINTEGERDEFAULT
#define ffecom_ptr_to_expr(e) (e)
#define ffecom_sym_commit(s)
#define ffecom_sym_retract(s)
#endif /* FFECOM_targetCURRENT == FFECOM_targetFFE */
#if FFECOM_targetCURRENT == FFECOM_targetGCC
#define ffecom_f2c_typecode(bt,kt) ffecom_f2c_typecode_[(bt)][(kt)]
#define ffecom_label_kind() ffecom_label_kind_
#define ffecom_pointer_kind() ffecom_pointer_kind_
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
#define ffecom_init_1()
#define ffecom_init_3()
#define ffecom_init_4()
#define ffecom_terminate_0()
#define ffecom_terminate_1()
#define ffecom_terminate_2()
#define ffecom_terminate_3()
#define ffecom_terminate_4()
/* End of #include file. */
#endif

View File

@ -1,37 +0,0 @@
# Top level configure fragment for GNU FORTRAN.
# Copyright (C) 1995-1997 Free Software Foundation, Inc.
#This file is part of GNU Fortran.
#GNU Fortran 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 Fortran 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 Fortran; 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)
# diff_excludes - files to ignore when building diffs between two versions.
language="f77"
compilers="f771\$(exeext)"
stagestuff="g77\$(exeext) g77-cross\$(exeext) f771\$(exeext)"
diff_excludes="-x f/BUGS -x f/NEWS -x f/INSTALL -x f/intdoc.texi"
outputs=f/Makefile

View File

@ -1,27 +0,0 @@
/* config.j -- Wrapper for GCC's config.h
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#ifndef MAKING_DEPENDENCIES
#ifndef _J_f_config
#define _J_f_config
#include "config.h"
#endif
#endif

View File

@ -1,28 +0,0 @@
/* convert.j -- Wrapper for GCC's convert.h
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#ifndef MAKING_DEPENDENCIES
#ifndef _J_f_convert
#define _J_f_convert
#include "tree.j"
#include "convert.h"
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,74 +0,0 @@
/* data.h -- Public #include File (module.h template V1.0)
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Owning Modules:
data.c
Modifications:
*/
/* Allow multiple inclusion to work. */
#ifndef _H_f_data
#define _H_f_data
/* Simple definitions and enumerations. */
/* Typedefs. */
/* Include files needed by this one. */
#include "bld.h"
#include "lex.h"
#include "storag.h"
/* Structure definitions. */
/* Global objects accessed by users of this module. */
/* Declare functions with prototypes. */
void ffedata_begin (ffebld list);
bool ffedata_end (bool report_errors, ffelexToken t);
void ffedata_gather (ffestorag st);
bool ffedata_value (ffetargetIntegerDefault rpt, ffebld value,
ffelexToken value_token);
/* Define macros. */
#define ffedata_init_0()
#define ffedata_init_1()
#define ffedata_init_2()
#define ffedata_init_3()
#define ffedata_init_4()
#define ffedata_terminate_0()
#define ffedata_terminate_1()
#define ffedata_terminate_2()
#define ffedata_terminate_3()
#define ffedata_terminate_4()
/* End of #include file. */
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,103 +0,0 @@
/* equiv.h -- Public #include File (module.h template V1.0)
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Owning Modules:
equiv.c
Modifications:
*/
/* Allow multiple inclusion to work. */
#ifndef _H_f_equiv
#define _H_f_equiv
/* Simple definitions and enumerations. */
/* Typedefs. */
typedef struct _ffeequiv_ *ffeequiv;
/* Include files needed by this one. */
#include "bld.h"
#include "lex.h"
#include "storag.h"
#include "symbol.h"
/* Structure definitions. */
struct _ffeequiv_
{
ffeequiv next;
ffeequiv previous;
ffesymbol common; /* Common area for this equiv, if any. */
ffebld list; /* List of lists of equiv exprs. */
bool is_save; /* Any SAVEd members? */
bool is_init; /* Any initialized members? */
};
/* Global objects accessed by users of this module. */
/* Declare functions with prototypes. */
void ffeequiv_add (ffeequiv eq, ffebld list, ffelexToken t);
#if FFECOM_targetCURRENT == FFECOM_targetFFE
void ffeequiv_dump (ffeequiv eq);
#endif
void ffeequiv_exec_transition (void);
void ffeequiv_init_2 (void);
void ffeequiv_kill (ffeequiv victim);
bool ffeequiv_layout_cblock (ffestorag st);
ffeequiv ffeequiv_merge (ffeequiv eq1, ffeequiv eq2, ffelexToken t);
ffeequiv ffeequiv_new (void);
ffesymbol ffeequiv_symbol (ffebld expr);
void ffeequiv_update_init (ffeequiv eq);
void ffeequiv_update_save (ffeequiv eq);
/* Define macros. */
#define ffeequiv_common(e) ((e)->common)
#define ffeequiv_init_0()
#define ffeequiv_init_1()
#define ffeequiv_init_3()
#define ffeequiv_init_4()
#define ffeequiv_is_init(e) ((e)->is_init)
#define ffeequiv_is_save(e) ((e)->is_save)
#define ffeequiv_list(e) ((e)->list)
#define ffeequiv_next(e) ((e)->next)
#define ffeequiv_previous(e) ((e)->previous)
#define ffeequiv_set_common(e,c) ((e)->common = (c))
#define ffeequiv_set_init(e,i) ((e)->init = (i))
#define ffeequiv_set_is_init(e,in) ((e)->is_init = (in))
#define ffeequiv_set_is_save(e,sa) ((e)->is_save = (sa))
#define ffeequiv_set_list(e,l) ((e)->list = (l))
#define ffeequiv_terminate_0()
#define ffeequiv_terminate_1()
#define ffeequiv_terminate_2()
#define ffeequiv_terminate_3()
#define ffeequiv_terminate_4()
/* End of #include file. */
#endif

Some files were not shown because too many files have changed in this diff Show More