Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
8ac9d31f
Commit
8ac9d31f
authored
Jul 14, 2002
by
Tim Josling
Committed by
Tim Josling
Jul 14, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make gengtype.c language independent.
From-SVN: r55436
parent
33ce85ff
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
341 additions
and
87 deletions
+341
-87
gcc/ChangeLog
+60
-0
gcc/Makefile.in
+41
-6
gcc/c-config-lang.in
+26
-0
gcc/configure
+32
-1
gcc/configure.in
+28
-0
gcc/cp/ChangeLog
+6
-0
gcc/cp/config-lang.in
+1
-1
gcc/doc/gty.texi
+23
-6
gcc/doc/sourcebuild.texi
+10
-3
gcc/gengtype-lex.l
+1
-1
gcc/gengtype.c
+103
-65
gcc/gengtype.h
+1
-1
gcc/objc/config-lang.in
+1
-1
gcc/treelang/ChangeLog
+7
-0
gcc/treelang/config-lang.in
+1
-2
No files found.
gcc/ChangeLog
View file @
8ac9d31f
...
@@ -95,6 +95,66 @@ Thu Jul 11 11:31:12 2002 J"orn Rennecke <joern.rennecke@superh.com>
...
@@ -95,6 +95,66 @@ Thu Jul 11 11:31:12 2002 J"orn Rennecke <joern.rennecke@superh.com>
(emit_move_sequence): Don't directly split DImode constants on 32-bit
(emit_move_sequence): Don't directly split DImode constants on 32-bit
targets.
targets.
2002-07-11 Tim Josling <tej@melbpc.org.au>
Remove front end hard coding from gengtype.c.
* Makefile.in
(STAGESTUFF): add gtyp-gen.h
(GTFILES): Remove front end specific files.
(GTFILES_FILES_LANGS): New, from configure..
(GTFILES_FILES_FILES): Likewise.
(GTFILES_LANG_DIR_NAMES): Likewise.
(GTFILES_SRCDIR): Likewise.
(gtyp-gen.h): Build from configure information.
(s-gtype): Remove command line parameters from gengtype.
(gengtype.o): Remove dependency on GTFILES. Depend on gtyp-gen.h.
(mostlyclean): Delete files generated by and for gengtype.
* c-config-lang.in: New file.
* configure.in (all_gtfiles_files_langs): New. Accumulate files
for each language.
(all_gtfiles_files_files): New. Accumulate language for each file
accumulated.
(gtfiles): Pick up value for C.
(srcdir): AC-SUBST this variable.
(all_gtfiles_files_langs): AC-SUBST this variable.
(all_gtfiles_files_files): AC-SUBST this variable.
* configure: Regenerate.
* gengtype-lex.l (parse_file): Make parameter const.
* gengtype.c (toplevel): include gtyp-gen.h.
(BASE_FILE_<language> unnamed enum): Delete.
(lang_names): Delete (replaced by gtyp-gen.h)
(lang_dir_names): From gtyp-gen.h, replaces lang_names; changed
all references.
(NUM_GT_FILES): New.
(NUM_LANG_FILES): New.
(srcdir_len): New.
(NUM_BASE_FILES): Change calculation.
(open_base_files): Change prototype to avoid warning.
(startswith): Delete.
(get_file_basename): Iterate through generated language list not
hard coded list.
(get_base_file_bitmap): Use generated list of files and languages.
(close_output_files): Add prototype to rmove warning.
(main): Iterate through list of generated files from gtyp-gen.h
rather than command line paramaters. Ignore duplicated file
names.
* gengtype.h (parse_file): Amend prototype for const parameter.
* doc/sourcebuild.texi: Document gtfiles variable.
* doc/gty.texi: Document changes to gtfiles variable for front
ends.
* objc/config-lang.in (gtfiles): Add files needed for objc front
end.
2002-07-10 Roger Sayle <roger@eyesopen.com>
2002-07-10 Roger Sayle <roger@eyesopen.com>
PR c/2454
PR c/2454
...
...
gcc/Makefile.in
View file @
8ac9d31f
...
@@ -755,7 +755,7 @@ STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
...
@@ -755,7 +755,7 @@ STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c
\
insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c
\
insn-attr.h insn-attrtab.c insn-opinit.c insn-constants.h tm-preds.h
\
insn-attr.h insn-attrtab.c insn-opinit.c insn-constants.h tm-preds.h
\
tree-check.h
\
tree-check.h
\
s-flags s-config s-codes s-mlib s-under s-genrtl s-gtype
\
s-flags s-config s-codes s-mlib s-under s-genrtl s-gtype
gtyp-gen.h
\
s-output s-recog s-emit s-extract s-peep s-check
\
s-output s-recog s-emit s-extract s-peep s-check
\
s-attr s-attrtab s-opinit s-preds s-constants s-crt0
\
s-attr s-attrtab s-opinit s-preds s-constants s-crt0
\
genemit
$(build_exeext)
genoutput
$(build_exeext)
genrecog
$(build_exeext)
\
genemit
$(build_exeext)
genoutput
$(build_exeext)
genrecog
$(build_exeext)
\
...
@@ -1823,11 +1823,14 @@ GTFILES = $(GCONFIG_H) $(srcdir)/location.h \
...
@@ -1823,11 +1823,14 @@ GTFILES = $(GCONFIG_H) $(srcdir)/location.h \
$(srcdir)
/profile.c
$(srcdir)
/regclass.c
$(srcdir)
/reg-stack.c
\
$(srcdir)
/profile.c
$(srcdir)
/regclass.c
$(srcdir)
/reg-stack.c
\
$(srcdir)
/sdbout.c
$(srcdir)
/stmt.c
$(srcdir)
/stor-layout.c
\
$(srcdir)
/sdbout.c
$(srcdir)
/stmt.c
$(srcdir)
/stor-layout.c
\
$(srcdir)
/tree.c
$(srcdir)
/varasm.c
\
$(srcdir)
/tree.c
$(srcdir)
/varasm.c
\
$(srcdir)
/c-objc-common.c
$(srcdir)
/c-common.c
$(srcdir)
/c-parse.in
\
$(out_file)
\
$(out_file)
\
$(srcdir)
/c-decl.c
$(srcdir)
/c-pragma.c
\
@all_gtfiles@
@all_gtfiles@
GTFILES_FILES_LANGS
=
@all_gtfiles_files_langs@
GTFILES_FILES_FILES
=
@all_gtfiles_files_files@
GTFILES_LANG_DIR_NAMES
=
@subdirs@
GTFILES_SRCDIR
=
@srcdir@
gtype-desc.h gtype-desc.c gt-except.h gt-function.h
:
s-gtype; @true
gtype-desc.h gtype-desc.c gt-except.h gt-function.h
:
s-gtype; @true
gt-integrate.h gt-stmt.h gt-tree.h gt-varasm.h gt-emit-rtl.h
:
s-gtype; @true
gt-integrate.h gt-stmt.h gt-tree.h gt-varasm.h gt-emit-rtl.h
:
s-gtype; @true
gt-explow.h gt-stor-layout.h gt-regclass.h gt-lists.h
:
s-gtype; @true
gt-explow.h gt-stor-layout.h gt-regclass.h gt-lists.h
:
s-gtype; @true
...
@@ -1837,8 +1840,35 @@ gt-reg-stack.h gt-dependence.h : s-gtype ; @true
...
@@ -1837,8 +1840,35 @@ gt-reg-stack.h gt-dependence.h : s-gtype ; @true
gt-c-common.h gt-c-decl.h gt-c-parse.h gt-c-pragma.h
:
s-gtype; @true
gt-c-common.h gt-c-decl.h gt-c-parse.h gt-c-pragma.h
:
s-gtype; @true
gt-c-objc-common.h gtype-c.h gt-location.h
:
s-gtype ; @true
gt-c-objc-common.h gtype-c.h gt-location.h
:
s-gtype ; @true
s-gtype
:
gengtype$(build_exeext) $(GTFILES)
gtyp-gen.h
:
Makefile
./gengtype
$(GTFILES)
echo
"/* This file is machine generated. Do not edit. */"
>
tmp-gtyp.h
echo
"static const char *srcdir = "
>>
tmp-gtyp.h
echo
"
\"
$(GTFILES_SRCDIR)
\"
"
>>
tmp-gtyp.h
echo
";"
>>
tmp-gtyp.h
echo
"static const char *lang_files[] = {"
>>
tmp-gtyp.h
ll
=
"
$(GTFILES_FILES_FILES)
"
;
\
for
f
in
$$
ll
;
do
\
echo
"
\"
$$
f
\"
, "
;
done
>>
tmp-gtyp.h
echo
"NULL};"
>>
tmp-gtyp.h
echo
"static const char *langs_for_lang_files[] = {"
>>
tmp-gtyp.h
ff
=
"
$(GTFILES_FILES_LANGS)
"
;
\
for
f
in
$$
ff
;
do
\
echo
"
\"
$$
f
\"
, "
;
done
>>
tmp-gtyp.h
echo
"NULL};"
>>
tmp-gtyp.h
echo
"static const char *all_files[] = {"
>>
tmp-gtyp.h
gf
=
"
$(GTFILES)
"
;
\
for
f
in
$$
gf
;
do
\
echo
"
\"
$$
f
\"
, "
;
done
>>
tmp-gtyp.h
echo
" NULL};"
>>
tmp-gtyp.h
echo
"static const char *lang_dir_names[] = {
\"
c
\"
, "
>>
tmp-gtyp.h
gf
=
"
$(GTFILES_LANG_DIR_NAMES)
"
;
\
for
l
in
$$
gf
;
do
\
echo
"
\"
$$
l
\"
, "
;
done
>>
tmp-gtyp.h
echo
"NULL};"
>>
tmp-gtyp.h
$(SHELL)
$(srcdir)
/move-if-change tmp-gtyp.h gtyp-gen.h
s-gtype
:
gengtype$(build_exeext)
./gengtype
$(STAMP)
s-gtype
$(STAMP)
s-gtype
#
#
...
@@ -1977,7 +2007,7 @@ gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
...
@@ -1977,7 +2007,7 @@ gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
$(HOST_CC)
$(HOST_CFLAGS)
$(HOST_LDFLAGS)
-o
$@
\
$(HOST_CC)
$(HOST_CFLAGS)
$(HOST_LDFLAGS)
-o
$@
\
gengtype.o gengtype-lex.o gengtype-yacc.o
$(HOST_LIBS)
gengtype.o gengtype-lex.o gengtype-yacc.o
$(HOST_LIBS)
gengtype.o
:
gengtype.c gengtype.h $(HCONFIG_H) $(SYSTEM_H) real.h
gengtype.o
:
gengtype.c gengtype.h $(HCONFIG_H) $(SYSTEM_H) real.h
gtyp-gen.h
$(HOST_CC)
-c
$(HOST_CFLAGS)
$(HOST_CPPFLAGS)
$(INCLUDES)
\
$(HOST_CC)
-c
$(HOST_CFLAGS)
$(HOST_CPPFLAGS)
$(INCLUDES)
\
$(srcdir)
/gengtype.c
$(OUTPUT_OPTION)
$(srcdir)
/gengtype.c
$(OUTPUT_OPTION)
...
@@ -2534,6 +2564,11 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
...
@@ -2534,6 +2564,11 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
-rm
-f
gcc.vrs
gcc.kys
gcc.tps
gcc.pgs
gcc.fns
-rm
-f
gcc.vrs
gcc.kys
gcc.tps
gcc.pgs
gcc.fns
# Delete core dumps.
# Delete core dumps.
-rm
-f
core
*/core
-rm
-f
core
*/core
# Delete file generated for gengtype.c
-rm
-f
gtyp-gen.h
# Delete files generated by gengtype.c
-rm
-f
gtype-*
-rm
-f
gt-*
# Delete all files made by compilation
# Delete all files made by compilation
# that don't exist in the distribution.
# that don't exist in the distribution.
...
...
gcc/c-config-lang.in
0 → 100644
View file @
8ac9d31f
# Top level configure fragment for GNU C - C language.
# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
#This file is part of GCC.
#GCC 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.
#GCC 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 GCC; see the file COPYING. If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA.
# This file c-config-lang.c is a special pseudo config-lang.in file
# for the language C. It has limited use, specifically to record the
# files used by C that have garbage collection GTY macros in them
# which therefore need to be scanned by gengtype.c.
gtfiles="\$(srcdir)/c-lang.c \$(srcdir)/c-parse.in \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/c-objc-common.c"
gcc/configure
View file @
8ac9d31f
...
@@ -2244,7 +2244,7 @@ EOF
...
@@ -2244,7 +2244,7 @@ EOF
fi
fi
# Find some useful tools
# Find some useful tools
for
ac_prog
in
mawk g
awk nawk awk
for
ac_prog
in
gawk m
awk nawk awk
do
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
# Extract the first word of "$ac_prog", so it can be a program name with args.
set
dummy
$ac_prog
;
ac_word
=
$2
set
dummy
$ac_prog
;
ac_word
=
$2
...
@@ -8168,6 +8168,9 @@ all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
...
@@ -8168,6 +8168,9 @@ all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
all_lang_makefiles
=
all_lang_makefiles
=
# Files for gengtype
# Files for gengtype
all_gtfiles
=
"
$config_gtfiles
"
all_gtfiles
=
"
$config_gtfiles
"
# Files for gengtype with language
all_gtfiles_files_langs
=
all_gtfiles_files_files
=
# Add the language fragments.
# Add the language fragments.
# Languages are added via two mechanisms. Some information must be
# Languages are added via two mechanisms. Some information must be
...
@@ -8208,9 +8211,31 @@ do
...
@@ -8208,9 +8211,31 @@ do
all_stagestuff
=
"
$all_stagestuff
$stagestuff
"
all_stagestuff
=
"
$all_stagestuff
$stagestuff
"
all_outputs
=
"
$all_outputs
$outputs
"
all_outputs
=
"
$all_outputs
$outputs
"
all_gtfiles
=
"
$all_gtfiles
$gtfiles
"
all_gtfiles
=
"
$all_gtfiles
$gtfiles
"
for
f
in
..
$gtfiles
do
if
test
$f
!=
".."
then
all_gtfiles_files_langs
=
"
$all_gtfiles_files_langs
${
s
}
"
all_gtfiles_files_files
=
"
$all_gtfiles_files_files
${
f
}
"
fi
done
fi
fi
done
done
# Pick up gtfiles for c
gtfiles
=
s
=
"c"
.
${
srcdir
}
/c-config-lang.in
all_gtfiles
=
"
$all_gtfiles
$gtfiles
"
for
f
in
..
$gtfiles
do
if
test
$f
!=
".."
then
all_gtfiles_files_langs
=
"
$all_gtfiles_files_langs
${
s
}
"
all_gtfiles_files_files
=
"
$all_gtfiles_files_files
${
f
}
"
fi
done
check_languages
=
check_languages
=
for
language
in
..
$all_languages
for
language
in
..
$all_languages
do
do
...
@@ -8406,6 +8431,9 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma
...
@@ -8406,6 +8431,9 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma
# Echo that links are built
# Echo that links are built
if
test
x
$host
=
x
$target
if
test
x
$host
=
x
$target
then
then
...
@@ -8668,9 +8696,12 @@ s%@dollar@%$dollar%g
...
@@ -8668,9 +8696,12 @@ s%@dollar@%$dollar%g
s%@slibdir@%
$slibdir
%g
s%@slibdir@%
$slibdir
%g
s%@objdir@%
$objdir
%g
s%@objdir@%
$objdir
%g
s%@subdirs@%
$subdirs
%g
s%@subdirs@%
$subdirs
%g
s%@srcdir@%
$srcdir
%g
s%@all_boot_languages@%
$all_boot_languages
%g
s%@all_boot_languages@%
$all_boot_languages
%g
s%@all_compilers@%
$all_compilers
%g
s%@all_compilers@%
$all_compilers
%g
s%@all_gtfiles@%
$all_gtfiles
%g
s%@all_gtfiles@%
$all_gtfiles
%g
s%@all_gtfiles_files_langs@%
$all_gtfiles_files_langs
%g
s%@all_gtfiles_files_files@%
$all_gtfiles_files_files
%g
s%@all_lang_makefiles@%
$all_lang_makefiles
%g
s%@all_lang_makefiles@%
$all_lang_makefiles
%g
s%@all_languages@%
$all_languages
%g
s%@all_languages@%
$all_languages
%g
s%@all_stagestuff@%
$all_stagestuff
%g
s%@all_stagestuff@%
$all_stagestuff
%g
...
...
gcc/configure.in
View file @
8ac9d31f
...
@@ -2408,6 +2408,9 @@ all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
...
@@ -2408,6 +2408,9 @@ all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
all_lang_makefiles=
all_lang_makefiles=
# Files for gengtype
# Files for gengtype
all_gtfiles="$config_gtfiles"
all_gtfiles="$config_gtfiles"
# Files for gengtype with language
all_gtfiles_files_langs=
all_gtfiles_files_files=
# Add the language fragments.
# Add the language fragments.
# Languages are added via two mechanisms. Some information must be
# Languages are added via two mechanisms. Some information must be
...
@@ -2448,9 +2451,31 @@ do
...
@@ -2448,9 +2451,31 @@ do
all_stagestuff="$all_stagestuff $stagestuff"
all_stagestuff="$all_stagestuff $stagestuff"
all_outputs="$all_outputs $outputs"
all_outputs="$all_outputs $outputs"
all_gtfiles="$all_gtfiles $gtfiles"
all_gtfiles="$all_gtfiles $gtfiles"
for f in .. $gtfiles
do
if test $f != ".."
then
all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
fi
done
fi
fi
done
done
# Pick up gtfiles for c
gtfiles=
s="c"
. ${srcdir}/c-config-lang.in
all_gtfiles="$all_gtfiles $gtfiles"
for f in .. $gtfiles
do
if test $f != ".."
then
all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
fi
done
check_languages=
check_languages=
for language in .. $all_languages
for language in .. $all_languages
do
do
...
@@ -2578,9 +2603,12 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma
...
@@ -2578,9 +2603,12 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma
# Substitute configuration variables
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(subdirs)
AC_SUBST(srcdir)
AC_SUBST(all_boot_languages)
AC_SUBST(all_boot_languages)
AC_SUBST(all_compilers)
AC_SUBST(all_compilers)
AC_SUBST(all_gtfiles)
AC_SUBST(all_gtfiles)
AC_SUBST(all_gtfiles_files_langs)
AC_SUBST(all_gtfiles_files_files)
AC_SUBST(all_lang_makefiles)
AC_SUBST(all_lang_makefiles)
AC_SUBST(all_languages)
AC_SUBST(all_languages)
AC_SUBST(all_stagestuff)
AC_SUBST(all_stagestuff)
...
...
gcc/cp/ChangeLog
View file @
8ac9d31f
...
@@ -18,6 +18,12 @@
...
@@ -18,6 +18,12 @@
* pt.c (template_parm_this_level_p, push_template_decl_real):
* pt.c (template_parm_this_level_p, push_template_decl_real):
Pass depth as int pointer.
Pass depth as int pointer.
2002-07-11 Tim Josling <tej@melbpc.org.au>
Remove front end hard coding from gengtype.c.
* config-lang.in (gtfiles): Add files needed for this front end.
2002-07-10 Mark Mitchell <mark@codesourcery.com>
2002-07-10 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (unqualified_name_lookup_error): Declare it.
* cp-tree.h (unqualified_name_lookup_error): Declare it.
...
...
gcc/cp/config-lang.in
View file @
8ac9d31f
...
@@ -34,4 +34,4 @@ stagestuff="g++\$(exeext) g++-cross\$(exeext) cc1plus\$(exeext)"
...
@@ -34,4 +34,4 @@ stagestuff="g++\$(exeext) g++-cross\$(exeext) cc1plus\$(exeext)"
target_libs="${libstdcxx_version} target-gperf"
target_libs="${libstdcxx_version} target-gperf"
gtfiles="\$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/lex.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/parse.y \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/spew.c \$(srcdir)/cp/tree.c"
gtfiles="\$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/lex.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/parse.y \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/spew.c \$(srcdir)/cp/tree.c
\$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c
"
gcc/doc/gty.texi
View file @
8ac9d31f
...
@@ -228,14 +228,31 @@ things you need to do:
...
@@ -228,14 +228,31 @@ things you need to do:
@enumerate
@enumerate
@item
@item
You
need
to
add
the
file
to
the
list
of
source
files
the
type
machinery
You
need
to
add
the
file
to
the
list
of
source
files
the
type
scans
.
For
a
back
-
end
file
,
this
is
usually
done
automatically
;
if
not
,
machinery
scans
.
There
are
three
cases
:
you
should
add
it
to
@code
{
config_gtfiles
}
in
the
appropriate
port
'
s
entries
in
@file
{
config
.
gcc
}.
For
a
front
-
end
file
,
this
is
done
by
@enumerate
a
adding
the
filename
to
the
@code
{
gtfiles
}
variable
defined
in
@item
@file
{
config
-
lang
.
in
}.
For
other
files
,
this
is
done
by
adding
the
For
a
back
-
end
file
,
this
is
usually
done
automatically
;
if
not
,
you
should
add
it
to
@code
{
config_gtfiles
}
in
the
appropriate
port
'
s
entries
in
@file
{
config
.
gcc
}.
@item
For
files
shared
by
all
front
ends
,
this
is
done
by
adding
the
filename
to
the
@code
{
GTFILES
}
variable
in
@file
{
Makefile
.
in
}.
filename
to
the
@code
{
GTFILES
}
variable
in
@file
{
Makefile
.
in
}.
@item
For
any
other
file
used
by
a
front
end
,
this
is
done
by
adding
the
filename
to
the
@code
{
gtfiles
}
variable
defined
in
@file
{
config
-
lang
.
in
}.
For
C
,
the
file
is
@file
{
c
-
config
-
lang
.
in
}.
This
list
should
include
all
files
that
have
GTY
macros
in
them
that
are
used
in
that
front
end
,
other
than
those
defined
in
the
previous
list
items
.
For
example
,
it
is
common
for
front
end
writers
to
use
@file
{
c
-
common
.
c
}
and
other
files
from
the
C
front
end
,
and
these
should
be
included
in
the
@file
{
gtfiles
}
variable
for
such
front
ends
.
@end
enumerate
@item
@item
You
need
to
include
the
file
that
the
type
machinery
will
generate
in
You
need
to
include
the
file
that
the
type
machinery
will
generate
in
the
source
file
you
just
changed
.
The
file
will
be
called
the
source
file
you
just
changed
.
The
file
will
be
called
...
...
gcc/doc/sourcebuild.texi
View file @
8ac9d31f
...
@@ -610,9 +610,10 @@ codes.
...
@@ -610,9 +610,10 @@ codes.
@node
Front
End
Config
@node
Front
End
Config
@subsubsection
The
Front
End
@file{
config
-
lang
.
in
}
File
@subsubsection
The
Front
End
@file{
config
-
lang
.
in
}
File
Each
language
subdirectory
contains
a
@file{
config
-
lang
.
in
}
file
.
Each
language
subdirectory
contains
a
@file{
config
-
lang
.
in
}
file
.
In
This
file
is
a
shell
script
that
may
define
some
variables
describing
addition
the
main
directory
contains
@file{
c
-
config
-
lang
.
in
}
,
which
the
language
:
contains
limited
information
for
the
C
language
.
This
file
is
a
shell
script
that
may
define
some
variables
describing
the
language
:
@table
@code
@table
@code
@item
language
@item
language
...
@@ -655,6 +656,12 @@ by @file{configure} substituting values in them. This mechanism can
...
@@ -655,6 +656,12 @@ by @file{configure} substituting values in them. This mechanism can
be
used
to
create
a
file
@file{@var{
language
}
/
Makefile
}
from
be
used
to
create
a
file
@file{@var{
language
}
/
Makefile
}
from
@file{@var{
language
}
/
Makefile
.
in
}
,
but
this
is
deprecated
,
building
@file{@var{
language
}
/
Makefile
.
in
}
,
but
this
is
deprecated
,
building
everything
from
the
single
@file{
gcc
/
Makefile
}
is
preferred
.
everything
from
the
single
@file{
gcc
/
Makefile
}
is
preferred
.
@item
gtfiles
If
defined
,
a
space
-
separated
list
of
files
that
should
be
scanned
by
gengtype
.
c
to
generate
the
garbage
collection
tables
and
routines
for
this
language
.
This
excludes
the
files
that
are
common
to
all
front
ends
.
@xref{
Type
Information
}
.
@end
table
@end
table
@node
Back
End
@node
Back
End
...
...
gcc/gengtype-lex.l
View file @
8ac9d31f
...
@@ -305,7 +305,7 @@ yyerror (s)
...
@@ -305,7 +305,7 @@ yyerror (s)
void
void
parse_file (fname)
parse_file (fname)
char *fname;
c
onst c
har *fname;
{
{
yyin = fopen (fname, "r");
yyin = fopen (fname, "r");
lexer_line.file = fname;
lexer_line.file = fname;
...
...
gcc/gengtype.c
View file @
8ac9d31f
...
@@ -21,6 +21,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
...
@@ -21,6 +21,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "hconfig.h"
#include "hconfig.h"
#include "system.h"
#include "system.h"
#include "gengtype.h"
#include "gengtype.h"
#include "gtyp-gen.h"
/* Nonzero iff an error has occurred. */
/* Nonzero iff an error has occurred. */
static
int
hit_error
=
0
;
static
int
hit_error
=
0
;
...
@@ -518,18 +519,16 @@ static outf_p output_files;
...
@@ -518,18 +519,16 @@ static outf_p output_files;
source file. */
source file. */
outf_p
header_file
;
outf_p
header_file
;
enum
{
/* Number of files specified in gtfiles. */
BASE_FILE_C
,
#define NUM_GT_FILES (ARRAY_SIZE (all_files) - 1)
BASE_FILE_OBJC
,
BASE_FILE_CPLUSPLUS
,
BASE_FILE_TREELANG
,
BASE_FILE_COBOL
};
static
const
char
*
const
lang_names
[]
=
{
/* Number of files in the language files array. */
"c"
,
"objc"
,
"cp"
,
"treelang"
,
"cobol"
,
"f"
,
"ada"
,
"java"
#define NUM_LANG_FILES (ARRAY_SIZE (lang_files) - 1)
};
#define NUM_BASE_FILES ARRAY_SIZE (lang_names)
/* Length of srcdir name. */
static
int
srcdir_len
=
0
;
#define NUM_BASE_FILES (ARRAY_SIZE (lang_dir_names) - 1)
outf_p
base_files
[
NUM_BASE_FILES
];
outf_p
base_files
[
NUM_BASE_FILES
];
static
outf_p
create_file
PARAMS
((
const
char
*
,
const
char
*
));
static
outf_p
create_file
PARAMS
((
const
char
*
,
const
char
*
));
...
@@ -610,6 +609,8 @@ oprintf VPARAMS ((outf_p o, const char *format, ...))
...
@@ -610,6 +609,8 @@ oprintf VPARAMS ((outf_p o, const char *format, ...))
/* Open the global header file and the language-specific header files. */
/* Open the global header file and the language-specific header files. */
static
void
open_base_files
PARAMS
((
void
));
static
void
static
void
open_base_files
()
open_base_files
()
{
{
...
@@ -618,8 +619,8 @@ open_base_files ()
...
@@ -618,8 +619,8 @@ open_base_files ()
header_file
=
create_file
(
"GCC"
,
"gtype-desc.h"
);
header_file
=
create_file
(
"GCC"
,
"gtype-desc.h"
);
for
(
i
=
0
;
i
<
NUM_BASE_FILES
;
i
++
)
for
(
i
=
0
;
i
<
NUM_BASE_FILES
;
i
++
)
base_files
[
i
]
=
create_file
(
lang_names
[
i
],
base_files
[
i
]
=
create_file
(
lang_
dir_
names
[
i
],
xasprintf
(
"gtype-%s.h"
,
lang_names
[
i
]));
xasprintf
(
"gtype-%s.h"
,
lang_
dir_
names
[
i
]));
/* gtype-desc.c is a little special, so we create it here. */
/* gtype-desc.c is a little special, so we create it here. */
{
{
...
@@ -641,9 +642,6 @@ open_base_files ()
...
@@ -641,9 +642,6 @@ open_base_files ()
}
}
}
}
#define startswith(len, c, s) \
((size_t)(len) >= strlen (s) && memcmp (c, s, strlen (s)) == 0)
/* Determine the pathname to F relative to $(srcdir). */
/* Determine the pathname to F relative to $(srcdir). */
static
const
char
*
static
const
char
*
...
@@ -652,29 +650,35 @@ get_file_basename (f)
...
@@ -652,29 +650,35 @@ get_file_basename (f)
{
{
size_t
len
;
size_t
len
;
const
char
*
basename
;
const
char
*
basename
;
unsigned
i
;
/* Determine the output file name. */
len
=
strlen
(
f
);
basename
=
strrchr
(
f
,
'/'
);
basename
=
strrchr
(
f
,
'/'
);
if
(
basename
==
NULL
)
basename
=
f
;
if
(
!
basename
)
else
return
f
;
basename
++
;
if
(
startswith
(
basename
-
f
,
basename
-
2
,
"f/"
))
len
=
strlen
(
f
);
basename
-=
2
;
basename
++
;
else
if
(
startswith
(
basename
-
f
,
basename
-
3
,
"cp/"
))
basename
-=
3
;
for
(
i
=
1
;
i
<
NUM_BASE_FILES
;
i
++
)
else
if
(
startswith
(
basename
-
f
,
basename
-
4
,
"ada/"
))
{
basename
-=
4
;
const
char
*
s1
;
else
if
(
startswith
(
basename
-
f
,
basename
-
5
,
"java/"
))
const
char
*
s2
;
basename
-=
5
;
int
l1
;
else
if
(
startswith
(
basename
-
f
,
basename
-
5
,
"objc/"
))
int
l2
;
basename
-=
5
;
s1
=
basename
-
strlen
(
lang_dir_names
[
i
])
-
1
;
else
if
(
startswith
(
basename
-
f
,
basename
-
9
,
"treelang/"
))
s2
=
lang_dir_names
[
i
];
basename
-=
9
;
l1
=
strlen
(
s1
);
else
if
(
startswith
(
basename
-
f
,
basename
-
6
,
"cobol/"
))
l2
=
strlen
(
s2
);
basename
-=
6
;
if
(
l1
>=
l2
&&
!
memcmp
(
s1
,
s2
,
l2
))
{
basename
-=
l2
+
1
;
if
((
basename
-
f
-
1
)
!=
srcdir_len
)
abort
();
/* Match is wrong - should be preceded by $srcdir. */
break
;
}
}
return
basename
;
return
basename
;
}
}
...
@@ -692,31 +696,47 @@ get_base_file_bitmap (input_file)
...
@@ -692,31 +696,47 @@ get_base_file_bitmap (input_file)
{
{
const
char
*
basename
=
get_file_basename
(
input_file
);
const
char
*
basename
=
get_file_basename
(
input_file
);
const
char
*
slashpos
=
strchr
(
basename
,
'/'
);
const
char
*
slashpos
=
strchr
(
basename
,
'/'
);
size_t
len
=
strlen
(
basename
);
unsigned
j
;
unsigned
k
;
unsigned
bitmap
;
if
(
slashpos
!=
NULL
)
if
(
slashpos
)
{
{
size_t
i
;
size_t
i
;
for
(
i
=
0
;
i
<
NUM_BASE_FILES
;
i
++
)
for
(
i
=
1
;
i
<
NUM_BASE_FILES
;
i
++
)
if
((
size_t
)(
slashpos
-
basename
)
==
strlen
(
lang_names
[
i
])
if
((
size_t
)(
slashpos
-
basename
)
==
strlen
(
lang_dir_names
[
i
])
&&
memcmp
(
basename
,
lang_names
[
i
],
strlen
(
lang_names
[
i
]))
==
0
)
&&
memcmp
(
basename
,
lang_dir_names
[
i
],
strlen
(
lang_dir_names
[
i
]))
==
0
)
return
1
<<
i
;
{
/* It's in a language directory, set that language. */
bitmap
=
1
<<
i
;
return
bitmap
;
}
abort
();
/* Should have found the language. */
}
}
else
if
(
strcmp
(
basename
,
"c-lang.c"
)
==
0
)
return
1
<<
BASE_FILE_C
;
/* If it's in any config-lang.in, then set for the languages
else
if
(
strcmp
(
basename
,
"c-parse.in"
)
==
0
specified. */
||
strcmp
(
basename
,
"c-tree.h"
)
==
0
||
strcmp
(
basename
,
"c-decl.c"
)
==
0
bitmap
=
0
;
||
strcmp
(
basename
,
"c-objc-common.c"
)
==
0
)
return
1
<<
BASE_FILE_C
|
1
<<
BASE_FILE_OBJC
;
for
(
j
=
0
;
j
<
NUM_LANG_FILES
;
j
++
)
else
if
(
startswith
(
len
,
basename
,
"c-common.c"
))
{
return
1
<<
BASE_FILE_C
|
1
<<
BASE_FILE_OBJC
|
1
<<
BASE_FILE_CPLUSPLUS
if
(
!
strcmp
(
input_file
,
lang_files
[
j
]))
|
1
<<
BASE_FILE_TREELANG
|
1
<<
BASE_FILE_COBOL
;
{
else
if
(
startswith
(
len
,
basename
,
"c-"
))
for
(
k
=
0
;
k
<
NUM_BASE_FILES
;
k
++
)
return
1
<<
BASE_FILE_C
|
1
<<
BASE_FILE_OBJC
|
1
<<
BASE_FILE_CPLUSPLUS
;
{
else
if
(
!
strcmp
(
lang_dir_names
[
k
],
langs_for_lang_files
[
j
]))
return
(
1
<<
NUM_BASE_FILES
)
-
1
;
bitmap
|=
(
1
<<
k
);
abort
();
}
}
}
/* Otherwise, set all languages. */
if
(
!
bitmap
)
bitmap
=
(
1
<<
NUM_BASE_FILES
)
-
1
;
return
bitmap
;
}
}
/* An output file, suitable for definitions, that can see declarations
/* An output file, suitable for definitions, that can see declarations
...
@@ -765,8 +785,8 @@ get_output_file_with_visibility (input_file)
...
@@ -765,8 +785,8 @@ get_output_file_with_visibility (input_file)
size_t
i
;
size_t
i
;
for
(
i
=
0
;
i
<
NUM_BASE_FILES
;
i
++
)
for
(
i
=
0
;
i
<
NUM_BASE_FILES
;
i
++
)
if
(
memcmp
(
basename
,
lang_
names
[
i
],
strlen
(
lang
_names
[
i
]))
==
0
if
(
memcmp
(
basename
,
lang_
dir_names
[
i
],
strlen
(
lang_dir
_names
[
i
]))
==
0
&&
basename
[
strlen
(
lang_names
[
i
])]
==
'/'
)
&&
basename
[
strlen
(
lang_
dir_
names
[
i
])]
==
'/'
)
return
base_files
[
i
];
return
base_files
[
i
];
output_name
=
"gtype-desc.c"
;
output_name
=
"gtype-desc.c"
;
...
@@ -798,6 +818,8 @@ get_output_file_name (input_file)
...
@@ -798,6 +818,8 @@ get_output_file_name (input_file)
/* Copy the output to its final destination,
/* Copy the output to its final destination,
but don't unnecessarily change modification times. */
but don't unnecessarily change modification times. */
static
void
close_output_files
PARAMS
((
void
));
static
void
static
void
close_output_files
()
close_output_files
()
{
{
...
@@ -1896,11 +1918,14 @@ write_gc_roots (variables)
...
@@ -1896,11 +1918,14 @@ write_gc_roots (variables)
extern
int
main
PARAMS
((
int
argc
,
char
**
argv
));
extern
int
main
PARAMS
((
int
argc
,
char
**
argv
));
int
int
main
(
argc
,
argv
)
main
(
argc
,
argv
)
int
argc
;
int
argc
ATTRIBUTE_UNUSED
;
char
**
argv
;
char
**
argv
ATTRIBUTE_UNUSED
;
{
{
int
i
;
unsigned
i
;
static
struct
fileloc
pos
=
{
__FILE__
,
__LINE__
};
static
struct
fileloc
pos
=
{
__FILE__
,
__LINE__
};
unsigned
j
;
srcdir_len
=
strlen
(
srcdir
);
do_typedef
(
"CUMULATIVE_ARGS"
,
do_typedef
(
"CUMULATIVE_ARGS"
,
create_scalar_type
(
"CUMULATIVE_ARGS"
,
create_scalar_type
(
"CUMULATIVE_ARGS"
,
...
@@ -1914,8 +1939,21 @@ main(argc, argv)
...
@@ -1914,8 +1939,21 @@ main(argc, argv)
strlen
(
"void"
))),
strlen
(
"void"
))),
&
pos
);
&
pos
);
for
(
i
=
1
;
i
<
argc
;
i
++
)
for
(
i
=
0
;
i
<
NUM_GT_FILES
;
i
++
)
parse_file
(
argv
[
i
]);
{
int
dupflag
=
0
;
/* Omit if already seen. */
for
(
j
=
0
;
j
<
i
;
j
++
)
{
if
(
!
strcmp
(
all_files
[
i
],
all_files
[
j
]))
{
dupflag
=
1
;
break
;
}
}
if
(
!
dupflag
)
parse_file
(
all_files
[
i
]);
}
if
(
hit_error
!=
0
)
if
(
hit_error
!=
0
)
exit
(
1
);
exit
(
1
);
...
...
gcc/gengtype.h
View file @
8ac9d31f
...
@@ -138,7 +138,7 @@ extern void note_yacc_type PARAMS ((options_p o, pair_p fields,
...
@@ -138,7 +138,7 @@ extern void note_yacc_type PARAMS ((options_p o, pair_p fields,
extern
int
yylex
PARAMS
((
void
));
extern
int
yylex
PARAMS
((
void
));
extern
void
yyerror
PARAMS
((
const
char
*
));
extern
void
yyerror
PARAMS
((
const
char
*
));
extern
int
yyparse
PARAMS
((
void
));
extern
int
yyparse
PARAMS
((
void
));
extern
void
parse_file
PARAMS
((
char
*
name
));
extern
void
parse_file
PARAMS
((
c
onst
c
har
*
name
));
/* Output file handling. */
/* Output file handling. */
...
...
gcc/objc/config-lang.in
View file @
8ac9d31f
...
@@ -33,4 +33,4 @@ stagestuff=""
...
@@ -33,4 +33,4 @@ stagestuff=""
target_libs=target-libobjc
target_libs=target-libobjc
gtfiles="\$(srcdir)/objc/objc-act.h"
gtfiles="\$(srcdir)/objc/objc-act.h
\$(srcdir)/c-parse.in \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/c-parse.in
"
gcc/treelang/ChangeLog
View file @
8ac9d31f
2002-07-11 Tim Josling <tej@melbpc.org.au>
Remove front end hard coding from gengtype.c.
* config-lang.in (gtfiles): Add files needed for this front
end.
2002-07-09 Tim Josling <tej@melbpc.org.au>
2002-07-09 Tim Josling <tej@melbpc.org.au>
Support new attributes regime (Fix for PR c++/7099).
Support new attributes regime (Fix for PR c++/7099).
...
...
gcc/treelang/config-lang.in
View file @
8ac9d31f
...
@@ -36,5 +36,4 @@ diff_excludes="-x lex.c -x parse.c -x parse.h"
...
@@ -36,5 +36,4 @@ diff_excludes="-x lex.c -x parse.c -x parse.h"
headers=
headers=
build_by_default="no"
build_by_default="no"
gtfiles="\$(srcdir)/treelang/tree1.c \$(srcdir)/treelang/treelang.h"
gtfiles="\$(srcdir)/c-decl.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/treelang/tree1.c \$(srcdir)/treelang/treelang.h"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment