aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Berlin <dan@cgsoftware.com>2001-09-06 15:14:00 +0000
committerDaniel Berlin <dan@cgsoftware.com>2001-09-06 15:14:00 +0000
commit21a5bd1c2a7e251769c9ee11a3e2453c7f0324f7 (patch)
tree1080be6f520bff4780c5048565c12b89abae6f65
parentdcae948875f7ee4f9ccc01c7a7021ea5dc62724f (diff)
Initial tree serialization work.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-serialize-branch@45440 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/Makefile.in6
-rw-r--r--gcc/acconfig.h2
-rw-r--r--gcc/c-common.c20
-rw-r--r--gcc/c-common.h2
-rw-r--r--gcc/c-decl.c46
-rw-r--r--gcc/config.in10
-rwxr-xr-xgcc/configure280
-rw-r--r--gcc/configure.in4
-rw-r--r--gcc/cp/Make-lang.in4
-rw-r--r--gcc/cp/decl.c270
-rw-r--r--gcc/cp/semantics.c6
-rw-r--r--gcc/tree.c420
-rw-r--r--gcc/treepch.h19
13 files changed, 988 insertions, 101 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 1c4343d9cb1..7697af64d64 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1166,7 +1166,7 @@ $(srcdir)/c-parse.y: c-parse.in
c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) $(C_TREE_H) \
$(GGC_H) $(TARGET_H) c-lex.h flags.h function.h output.h $(EXPR_H) \
- debug.h toplev.h intl.h $(TM_P_H)
+ debug.h toplev.h intl.h $(TM_P_H) treepch.h
c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
$(TARGET_H) flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
@@ -1247,7 +1247,7 @@ s-under: $(GCC_PASSES)
c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
$(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
- $(EXPR_H) $(TM_P_H) builtin-types.def $(TARGET_H)
+ $(EXPR_H) $(TM_P_H) builtin-types.def $(TARGET_H) treepch.h
c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h
@@ -1341,7 +1341,7 @@ prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) Makefile prefix.h
convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h convert.h toplev.h
tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h function.h toplev.h \
- $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H)
+ $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) treepch.h
print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GGC_H)
stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \
function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H)
diff --git a/gcc/acconfig.h b/gcc/acconfig.h
index dec619b84b0..95366f72367 100644
--- a/gcc/acconfig.h
+++ b/gcc/acconfig.h
@@ -25,6 +25,8 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef ssize_t
+/* Define if we have a DBM compatible database */
+#undef HAVE_DBM
@BOTTOM@
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 84a9262f022..401f3e6c310 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "obstack.h"
#include "cpplib.h"
#include "target.h"
+#include "treepch.h"
cpp_reader *parse_in; /* Declared in c-lex.h. */
#undef WCHAR_TYPE_SIZE
@@ -3904,7 +3905,14 @@ finish_label_address_expr (label)
/* Mark P (a stmt_tree) for GC. The use of a `void *' for the
parameter allows this function to be used as a GC-marking
function. */
-
+void
+pickle_stmt_tree (p)
+ void *p;
+{
+ stmt_tree st = (stmt_tree) p;
+ st->x_last_stmt = (tree) write_tree (&st->x_last_stmt);
+ st->x_last_expr_type = (tree) write_tree (&st->x_last_expr_type);
+}
void
mark_stmt_tree (p)
void *p;
@@ -3924,6 +3932,16 @@ c_mark_lang_decl (c)
ggc_mark_tree (c->saved_tree);
}
+void
+pickle_c_language_function (f)
+ struct language_function *f;
+{
+ if (!f)
+ return;
+ pickle_stmt_tree (&f->x_stmt_tree);
+ f->x_scope_stmt_stack = (tree) write_tree (&f->x_scope_stmt_stack);
+}
+
/* Mark F for GC. */
void
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 26933b74f63..b5cfcd4b63c 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -811,7 +811,7 @@ extern tree boolean_increment PARAMS ((enum tree_code,
extern void extract_interface_info PARAMS ((void));
extern void mark_c_language_function PARAMS ((struct language_function *));
-
+extern void pickle_c_language_function PARAMS ((struct language_function *));
extern int case_compare PARAMS ((splay_tree_key,
splay_tree_key));
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index af61377aa42..6abeda84429 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -43,7 +43,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "cpplib.h"
#include "target.h"
#include "debug.h"
-
+#include "treepch.h"
/* In grokdeclarator, distinguish syntactic contexts of declarators. */
enum decl_context
{ NORMAL, /* Ordinary declaration */
@@ -6959,6 +6959,50 @@ copy_lang_decl (decl)
sizeof (struct lang_decl));
DECL_LANG_SPECIFIC (decl) = ld;
}
+void
+lang_pickle_tree (t, oldt)
+ tree t;
+ tree oldt;
+{
+ if (TREE_CODE (t) == IDENTIFIER_NODE)
+ {
+ struct lang_identifier *i = (struct lang_identifier *) t;
+ i->global_value = (tree)write_tree (&i->global_value);
+ i->local_value = (tree) write_tree (&i->local_value);
+ i->label_value = (tree) write_tree (&i->label_value);
+ i->implicit_decl = (tree) write_tree (&i->implicit_decl);
+ i->error_locus = (tree) write_tree (&i->error_locus);
+ i->limbo_value = (tree) write_tree (&i->limbo_value);
+ }
+ else if (TYPE_P (t) && TYPE_LANG_SPECIFIC (t))
+ {
+ struct lang_type *lt;
+ int id;
+ if (ggc_set_mark (TYPE_LANG_SPECIFIC (t)))
+ {
+ lt = (struct lang_type *) xmalloc (sizeof (struct lang_type));
+ memcpy (lt, TYPE_LANG_SPECIFIC (t), sizeof (struct lang_type));
+ id = current_id++;
+ store_to_db (&id, sizeof (int), lt, sizeof (struct lang_type));
+ free (lt);
+ TYPE_LANG_SPECIFIC (t) = (struct lang_type *)id;
+ }
+
+ }
+ else if (DECL_P (t) && DECL_LANG_SPECIFIC (t))
+ {
+ struct lang_decl *ld;
+ int id;
+ ld = (struct lang_decl *) xmalloc (sizeof (struct lang_decl));
+ memcpy (ld, DECL_LANG_SPECIFIC (t), sizeof (struct lang_decl));
+ id = current_id++;
+ ld->base.saved_tree = (tree) write_tree (&ld->base.saved_tree);
+ ld->pending_sizes = (tree) write_tree (&ld->pending_sizes);
+ store_to_db (&id, sizeof (int), ld, sizeof (struct lang_decl));
+ free (ld);
+ DECL_LANG_SPECIFIC (t) = (struct lang_decl *)id;
+ }
+}
/* Mark the language specific bits in T for GC. */
diff --git a/gcc/config.in b/gcc/config.in
index 88a751703c4..350c6024217 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1,4 +1,4 @@
-/* config.in. Generated automatically from configure.in by autoheader. */
+/* config.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define to empty if the keyword does not work. */
#undef const
@@ -79,6 +79,8 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef ssize_t
+/* Define if we have a DBM compatible database */
+#undef HAVE_DBM
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
@@ -197,6 +199,9 @@
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
+/* Define if you have the <gdbm.h> header file. */
+#undef HAVE_GDBM_H
+
/* Define if you have the <langinfo.h> header file. */
#undef HAVE_LANGINFO_H
@@ -212,6 +217,9 @@
/* Define if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
+/* Define if you have the <sdbm.h> header file. */
+#undef HAVE_SDBM_H
+
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
diff --git a/gcc/configure b/gcc/configure
index 640e5c2e8f9..39f2628ddf7 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -2057,7 +2057,7 @@ EOF
fi
# Find some useful tools
-for ac_prog in gawk mawk nawk awk
+for ac_prog in mawk gawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -4940,6 +4940,114 @@ EOF
fi
+echo "checking for database support" 1>&6
+echo "configure:4945: checking for database support" >&5
+
+for ac_hdr in sdbm.h gdbm.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4951: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4956 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for library containing dbm_open""... $ac_c" 1>&6
+echo "configure:4989: checking for library containing dbm_open" >&5
+if eval "test \"`echo '$''{'ac_cv_search_dbm_open'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_dbm_open="no"
+cat > conftest.$ac_ext <<EOF
+#line 4996 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dbm_open();
+
+int main() {
+dbm_open()
+; return 0; }
+EOF
+if { (eval echo configure:5007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_search_dbm_open="none required"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+test "$ac_cv_search_dbm_open" = "no" && for i in sdbm gdbm; do
+LIBS="-l$i $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5018 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dbm_open();
+
+int main() {
+dbm_open()
+; return 0; }
+EOF
+if { (eval echo configure:5029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_search_dbm_open="-l$i"
+break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+LIBS="$ac_func_search_save_LIBS"
+fi
+
+echo "$ac_t""$ac_cv_search_dbm_open" 1>&6
+if test "$ac_cv_search_dbm_open" != "no"; then
+ test "$ac_cv_search_dbm_open" = "none required" || LIBS="$ac_cv_search_dbm_open $LIBS"
+ cat >> confdefs.h <<\EOF
+#define HAVE_DBM 1
+EOF
+
+else :
+
+fi
# File extensions
manext='.1'
@@ -5203,7 +5311,7 @@ fi
echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:5207: checking for strerror in -lcposix" >&5
+echo "configure:5315: checking for strerror in -lcposix" >&5
ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5211,7 +5319,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5215 "configure"
+#line 5323 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5222,7 +5330,7 @@ int main() {
strerror()
; return 0; }
EOF
-if { (eval echo configure:5226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5245,12 +5353,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5249: checking for working const" >&5
+echo "configure:5357: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5254 "configure"
+#line 5362 "configure"
#include "confdefs.h"
int main() {
@@ -5299,7 +5407,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:5303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -5320,12 +5428,12 @@ EOF
fi
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:5324: checking for off_t" >&5
+echo "configure:5432: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5329 "configure"
+#line 5437 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5353,12 +5461,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:5357: checking for size_t" >&5
+echo "configure:5465: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5362 "configure"
+#line 5470 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5391,17 +5499,17 @@ unistd.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5395: checking for $ac_hdr" >&5
+echo "configure:5503: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5400 "configure"
+#line 5508 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5431,12 +5539,12 @@ done
strdup __argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5435: checking for $ac_func" >&5
+echo "configure:5543: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5440 "configure"
+#line 5548 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5459,7 +5567,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5488,12 +5596,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5492: checking for $ac_func" >&5
+echo "configure:5600: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5497 "configure"
+#line 5605 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5516,7 +5624,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5550,19 +5658,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:5554: checking for LC_MESSAGES" >&5
+echo "configure:5662: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5559 "configure"
+#line 5667 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:5566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -5583,7 +5691,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:5587: checking whether NLS is requested" >&5
+echo "configure:5695: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -5603,7 +5711,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:5607: checking whether included gettext is requested" >&5
+echo "configure:5715: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -5622,17 +5730,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:5626: checking for libintl.h" >&5
+echo "configure:5734: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5631 "configure"
+#line 5739 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5649,19 +5757,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:5653: checking for gettext in libc" >&5
+echo "configure:5761: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5658 "configure"
+#line 5766 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:5665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -5677,7 +5785,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:5681: checking for bindtextdomain in -lintl" >&5
+echo "configure:5789: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5685,7 +5793,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5689 "configure"
+#line 5797 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5696,7 +5804,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:5700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5712,12 +5820,12 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:5716: checking for gettext in libintl" >&5
+echo "configure:5824: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
-echo "configure:5721: checking for gettext in -lintl" >&5
+echo "configure:5829: checking for gettext in -lintl" >&5
ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5725,7 +5833,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5729 "configure"
+#line 5837 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5736,7 +5844,7 @@ int main() {
gettext()
; return 0; }
EOF
-if { (eval echo configure:5740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5779,7 +5887,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5783: checking for $ac_word" >&5
+echo "configure:5891: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5813,12 +5921,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5817: checking for $ac_func" >&5
+echo "configure:5925: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5822 "configure"
+#line 5930 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5841,7 +5949,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5868,7 +5976,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5872: checking for $ac_word" >&5
+echo "configure:5980: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5904,7 +6012,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5908: checking for $ac_word" >&5
+echo "configure:6016: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5936,7 +6044,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 5940 "configure"
+#line 6048 "configure"
#include "confdefs.h"
int main() {
@@ -5944,7 +6052,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:5948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -5969,7 +6077,7 @@ fi
if test "$CATOBJEXT" = "NONE"; then
echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
-echo "configure:5973: checking whether catgets can be used" >&5
+echo "configure:6081: checking whether catgets can be used" >&5
# Check whether --with-catgets or --without-catgets was given.
if test "${with_catgets+set}" = set; then
withval="$with_catgets"
@@ -5982,7 +6090,7 @@ fi
if test "$nls_cv_use_catgets" = "yes"; then
echo $ac_n "checking for main in -li""... $ac_c" 1>&6
-echo "configure:5986: checking for main in -li" >&5
+echo "configure:6094: checking for main in -li" >&5
ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5990,14 +6098,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-li $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5994 "configure"
+#line 6102 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6025,12 +6133,12 @@ else
fi
echo $ac_n "checking for catgets""... $ac_c" 1>&6
-echo "configure:6029: checking for catgets" >&5
+echo "configure:6137: checking for catgets" >&5
if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6034 "configure"
+#line 6142 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char catgets(); below. */
@@ -6053,7 +6161,7 @@ catgets();
; return 0; }
EOF
-if { (eval echo configure:6057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_catgets=yes"
else
@@ -6075,7 +6183,7 @@ EOF
# Extract the first word of "gencat", so it can be a program name with args.
set dummy gencat; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6079: checking for $ac_word" >&5
+echo "configure:6187: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_GENCAT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6111,7 +6219,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6115: checking for $ac_word" >&5
+echo "configure:6223: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6148,7 +6256,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6152: checking for $ac_word" >&5
+echo "configure:6260: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6186,7 +6294,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6190: checking for $ac_word" >&5
+echo "configure:6298: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6244,7 +6352,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6248: checking for $ac_word" >&5
+echo "configure:6356: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6278,7 +6386,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6282: checking for $ac_word" >&5
+echo "configure:6390: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6317,7 +6425,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6321: checking for $ac_word" >&5
+echo "configure:6429: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6416,7 +6524,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:6420: checking for catalogs to be installed" >&5
+echo "configure:6528: checking for catalogs to be installed" >&5
if test "x$LINGUAS" = "x"; then
LINGUAS=$ALL_LINGUAS
else
@@ -6448,17 +6556,17 @@ echo "configure:6420: checking for catalogs to be installed" >&5
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:6452: checking for linux/version.h" >&5
+echo "configure:6560: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6457 "configure"
+#line 6565 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6570: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6534,7 +6642,7 @@ fi
case $host_os in
win32 | pe | cygwin* | mingw32* | uwin*)
echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6
-echo "configure:6538: checking whether windows registry support is requested" >&5
+echo "configure:6646: checking whether windows registry support is requested" >&5
if test "x$enable_win32_registry" != xno; then
cat >> confdefs.h <<\EOF
#define ENABLE_WIN32_REGISTRY 1
@@ -6543,14 +6651,14 @@ EOF
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for library containing RegOpenKeyExA""... $ac_c" 1>&6
-echo "configure:6547: checking for library containing RegOpenKeyExA" >&5
+echo "configure:6655: checking for library containing RegOpenKeyExA" >&5
if eval "test \"`echo '$''{'ac_cv_search_RegOpenKeyExA'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_RegOpenKeyExA="no"
cat > conftest.$ac_ext <<EOF
-#line 6554 "configure"
+#line 6662 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6561,7 +6669,7 @@ int main() {
RegOpenKeyExA()
; return 0; }
EOF
-if { (eval echo configure:6565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_RegOpenKeyExA="none required"
else
@@ -6572,7 +6680,7 @@ rm -f conftest*
test "$ac_cv_search_RegOpenKeyExA" = "no" && for i in advapi32; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6576 "configure"
+#line 6684 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6583,7 +6691,7 @@ int main() {
RegOpenKeyExA()
; return 0; }
EOF
-if { (eval echo configure:6587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_RegOpenKeyExA="-l$i"
break
@@ -6625,7 +6733,7 @@ esac
if test "x$enable_win32_registry" != xno; then
echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6
-echo "configure:6629: checking registry key on windows hosts" >&5
+echo "configure:6737: checking registry key on windows hosts" >&5
cat >> confdefs.h <<EOF
#define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key"
EOF
@@ -6808,7 +6916,7 @@ fi
# Figure out what assembler we will be using.
echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
-echo "configure:6812: checking what assembler to use" >&5
+echo "configure:6920: checking what assembler to use" >&5
gcc_cv_as=
gcc_cv_gas_major_version=
gcc_cv_gas_minor_version=
@@ -6893,7 +7001,7 @@ fi
# Figure out what nm we will be using.
echo $ac_n "checking what nm to use""... $ac_c" 1>&6
-echo "configure:6897: checking what nm to use" >&5
+echo "configure:7005: checking what nm to use" >&5
if test -x nm$host_exeext; then
gcc_cv_nm=./nm$host_exeext
elif test x$host = x$target; then
@@ -6904,7 +7012,7 @@ echo "$ac_t""$gcc_cv_nm" 1>&6
# Figure out what assembler alignment features are present.
echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
-echo "configure:6908: checking assembler alignment features" >&5
+echo "configure:7016: checking assembler alignment features" >&5
gcc_cv_as_alignment_features=none
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
# Gas version 2.6 and later support for .balign and .p2align.
@@ -6952,7 +7060,7 @@ fi
echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
-echo "configure:6956: checking assembler subsection support" >&5
+echo "configure:7064: checking assembler subsection support" >&5
gcc_cv_as_subsections=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
@@ -6992,7 +7100,7 @@ fi
echo "$ac_t""$gcc_cv_as_subsections" 1>&6
echo $ac_n "checking assembler weak support""... $ac_c" 1>&6
-echo "configure:6996: checking assembler weak support" >&5
+echo "configure:7104: checking assembler weak support" >&5
gcc_cv_as_weak=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then
@@ -7015,7 +7123,7 @@ fi
echo "$ac_t""$gcc_cv_as_weak" 1>&6
echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6
-echo "configure:7019: checking assembler hidden support" >&5
+echo "configure:7127: checking assembler hidden support" >&5
gcc_cv_as_hidden=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
@@ -7039,7 +7147,7 @@ fi
echo "$ac_t""$gcc_cv_as_hidden" 1>&6
echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
-echo "configure:7043: checking assembler leb128 support" >&5
+echo "configure:7151: checking assembler leb128 support" >&5
gcc_cv_as_leb128=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
@@ -7084,7 +7192,7 @@ fi
echo "$ac_t""$gcc_cv_as_leb128" 1>&6
echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6
-echo "configure:7088: checking assembler eh_frame optimization" >&5
+echo "configure:7196: checking assembler eh_frame optimization" >&5
gcc_cv_as_eh_frame=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
@@ -7167,7 +7275,7 @@ echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
case "$target" in
sparc*-*-*)
echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
-echo "configure:7171: checking assembler .register pseudo-op support" >&5
+echo "configure:7279: checking assembler .register pseudo-op support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7195,7 +7303,7 @@ EOF
fi
echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
-echo "configure:7199: checking assembler supports -relax" >&5
+echo "configure:7307: checking assembler supports -relax" >&5
if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7225,7 +7333,7 @@ EOF
case "$tm_file" in
*64*)
echo $ac_n "checking for 64 bit support in assembler ($gcc_cv_as)""... $ac_c" 1>&6
-echo "configure:7229: checking for 64 bit support in assembler ($gcc_cv_as)" >&5
+echo "configure:7337: checking for 64 bit support in assembler ($gcc_cv_as)" >&5
if eval "test \"`echo '$''{'gcc_cv_as_flags64'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7270,7 +7378,7 @@ EOF
if test "x$gcc_cv_as_flags64" != xno; then
echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
-echo "configure:7274: checking for assembler offsetable %lo() support" >&5
+echo "configure:7382: checking for assembler offsetable %lo() support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7310,7 +7418,7 @@ EOF
i[34567]86-*-*)
echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
-echo "configure:7314: checking assembler instructions" >&5
+echo "configure:7422: checking assembler instructions" >&5
gcc_cv_as_instructions=
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then
@@ -7339,7 +7447,7 @@ EOF
esac
echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
-echo "configure:7343: checking assembler dwarf2 debug_line support" >&5
+echo "configure:7451: checking assembler dwarf2 debug_line support" >&5
gcc_cv_as_dwarf2_debug_line=no
# ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any
@@ -7524,7 +7632,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:7528: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:7636: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
diff --git a/gcc/configure.in b/gcc/configure.in
index f69250efd01..1fc4b13c80e 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -675,6 +675,10 @@ CFLAGS="$saved_CFLAGS"
# mkdir takes a single argument on some systems.
gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
+AC_CHECKING(for database support)
+
+AC_CHECK_HEADERS(sdbm.h gdbm.h, [break])
+AC_SEARCH_LIBS(dbm_open, sdbm gdbm, [AC_DEFINE(HAVE_DBM)])
# File extensions
manext='.1'
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index b4794145df0..aaa1182bb79 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -242,7 +242,7 @@ cp/lex.o: cp/lex.c $(CXX_TREE_H) cp/parse.h flags.h cp/lex.h c-pragma.h \
$(TM_P_H)
cp/decl.o: cp/decl.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h stack.h \
output.h $(EXPR_H) except.h toplev.h hash.h $(GGC_H) $(RTL_H) \
- cp/operators.def $(TM_P_H)
+ cp/operators.def $(TM_P_H) treepch.h
cp/decl2.o: cp/decl2.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h $(EXPR_H) \
output.h except.h toplev.h $(GGC_H) $(RTL_H)
cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) flags.h toplev.h output.h $(TM_P_H) \
@@ -274,7 +274,7 @@ cp/error.o: cp/error.c $(CXX_TREE_H) toplev.h diagnostic.h
cp/errfn.o: cp/errfn.c $(CXX_TREE_H) toplev.h
cp/repo.o: cp/repo.c $(CXX_TREE_H) toplev.h $(GGC_H) diagnostic.h
cp/semantics.o: cp/semantics.c $(CXX_TREE_H) cp/lex.h except.h toplev.h \
- flags.h $(GGC_H) debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H)
+ flags.h $(GGC_H) debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) treepch.h
cp/dump.o: cp/dump.c $(CXX_TREE_H) c-dump.h
cp/optimize.o: cp/optimize.c $(CXX_TREE_H) rtl.h integrate.h insn-config.h \
input.h $(PARAMS_H) debug.h
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 9020bb32188..67fc9b3e9d3 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -44,7 +44,7 @@ Boston, MA 02111-1307, USA. */
#include "ggc.h"
#include "tm_p.h"
#include "target.h"
-
+#include "treepch.h"
extern int (*valid_lang_attribute) PARAMS ((tree, tree, tree, tree));
#ifndef BOOL_TYPE_SIZE
@@ -1947,6 +1947,262 @@ mark_binding_level (arg)
ggc_mark_tree (lvl->dead_vars_from_for);
}
}
+static int pickle_binding_level PARAMS ((void *));
+static struct binding_level *unpickle_binding_level PARAMS ((int));
+static int pickle_decl_lang_specific PARAMS ((tree, struct lang_decl *));
+static int pickle_lang_function PARAMS ((tree, struct cp_language_function *));
+static int
+pickle_lang_function (t, p)
+ tree t;
+ struct cp_language_function *p;
+{
+ int id;
+ struct cp_language_function *new;
+ splay_tree_node result;
+ if (!p)
+ return 0;
+ if (ggc_set_mark (p))
+ {
+ result = splay_tree_lookup (written_trees, (splay_tree_key)p);
+ if (result)
+ return result->value;
+ }
+ id = current_id++;
+ new = (struct cp_language_function *)xmalloc (sizeof (struct cp_language_function));
+ memcpy (new, p, sizeof (struct cp_language_function));
+ splay_tree_insert (written_trees, (splay_tree_key) p, id);
+ pickle_c_language_function (&new->base);
+ new->x_ctor_label = (tree) write_tree (&new->x_ctor_label);
+ new->x_dtor_label = (tree) write_tree (&new->x_dtor_label);
+ new->x_current_class_ptr = (tree) write_tree (&new->x_current_class_ptr);
+ new->x_current_class_ref = (tree) write_tree (&new->x_current_class_ref);
+ new->x_eh_spec_block = (tree) write_tree (&new->x_eh_spec_block);
+ new->x_local_names = (varray_type) write_tree_varray (new->x_local_names);
+ /* FIXME: What to do about named label lists? */
+ new->bindings = (struct binding_level *)pickle_binding_level (&new->bindings);
+ store_to_db (&id, sizeof(int), new, sizeof (struct cp_language_function));
+ free (new);
+ return id;
+}
+static int
+pickle_decl_lang_specific (t, ld)
+ tree t;
+ struct lang_decl *ld;
+{
+ int id;
+ struct lang_decl *new;
+ splay_tree_node result;
+ if (ggc_set_mark (ld))
+ {
+ result = splay_tree_lookup (written_trees, (splay_tree_key)ld);
+ if (result)
+ return result->value;
+ }
+ id = current_id++;
+ new = (struct lang_decl *)xmalloc (sizeof (struct lang_decl));
+ memcpy (new, ld, sizeof (struct lang_decl));
+ splay_tree_insert (written_trees, (splay_tree_key)ld, id);
+ new->decl_flags.base.saved_tree = (tree) write_tree (&new->decl_flags.base.saved_tree);
+ if (!DECL_GLOBAL_CTOR_P (t)
+ && !DECL_GLOBAL_DTOR_P (t)
+ && !DECL_THUNK_P (t)
+ && !DECL_DISCRIMINATOR_P (t))
+ new->decl_flags.u2.access = (tree) write_tree (&new->decl_flags.u2.access);
+ else if (DECL_THUNK_P (t))
+ new->decl_flags.u2.vcall_offset = (tree) write_tree (&new->decl_flags.u2.vcall_offset);
+ if (TREE_CODE (t) != NAMESPACE_DECL)
+ new->decl_flags.u.template_info = (tree) write_tree (&new->decl_flags.u.template_info);
+ else
+ new->decl_flags.u.level =
+(struct binding_level *)pickle_binding_level (&new->decl_flags.u.level);
+ if (CAN_HAVE_FULL_LANG_DECL_P (t))
+ {
+ new->befriending_classes = (tree) write_tree (&new->befriending_classes);
+ new->context = (tree) write_tree (&new->context);
+ new->cloned_function = (tree) write_tree (&new->cloned_function);
+ new->inlined_fns = (tree) write_tree (&new->inlined_fns);
+ if (TREE_CODE (t) == TYPE_DECL)
+ new->u.sorted_fields = (tree) write_tree (&new->u.sorted_fields);
+ }
+ store_to_db (&id, sizeof (int), new, sizeof (struct lang_decl));
+ free (new);
+ return id;
+}
+static struct binding_level *
+unpickle_binding_level (id)
+ int id;
+{
+ struct binding_level *lvl;
+ splay_tree_node result;
+ datum key, data;
+ if (id == 0)
+ return NULL;
+ result = splay_tree_lookup (read_trees, id);
+ if (result)
+ return (struct binding_level *) result->value;
+ key.dptr = (char *) &id;
+ key.dsize = sizeof (int);
+ data = dbm_fetch (datafile, key);
+ if (!data.dptr)
+ abort();
+ lvl = make_binding_level ();
+ splay_tree_insert (read_trees, (splay_tree_key) id, (splay_tree_value) lvl);
+ memcpy (lvl, data.dptr, sizeof (struct binding_level));
+ free (data.dptr);
+ lvl->names = read_tree (lvl->names);
+ lvl->tags = read_tree (lvl->tags);
+ lvl->usings = read_tree (lvl->usings);
+ lvl->using_directives = read_tree (lvl->using_directives);
+ lvl->class_shadowed = read_tree (lvl->class_shadowed);
+ lvl->type_shadowed = read_tree (lvl->type_shadowed);
+ lvl->shadowed_labels = read_tree (lvl->shadowed_labels);
+ lvl->blocks = read_tree (lvl->blocks);
+ lvl->this_class = read_tree (lvl->this_class);
+ lvl->incomplete = read_tree (lvl->incomplete);
+ lvl->dead_vars_from_for = read_tree (lvl->dead_vars_from_for);
+ if (lvl->level_chain)
+ lvl->level_chain = unpickle_binding_level ((int)lvl->level_chain);
+ return lvl;
+}
+static int
+pickle_binding_level (arg)
+ void *arg;
+{
+ struct binding_level *lvl = *(struct binding_level **)arg;
+ int id;
+ struct binding_level *new;
+ splay_tree_node result;
+ if (!lvl)
+ return 0;
+// if (ggc_set_mark (lvl))
+ // {
+ result = splay_tree_lookup (written_trees, (splay_tree_key)lvl);
+ if (result)
+ return result->value;
+ // }
+ id = current_id++;
+ new = xmalloc (sizeof (struct binding_level));
+ memcpy (new, lvl, sizeof (struct binding_level));
+ splay_tree_insert (written_trees, (splay_tree_key)lvl, id);
+ new->names = (tree) write_tree (&new->names);
+ new->tags = (tree) write_tree (&new->tags);
+ new->usings = (tree) write_tree (&new->usings);
+ new->using_directives = (tree) write_tree (&new->using_directives);
+ new->class_shadowed = (tree) write_tree (&new->class_shadowed);
+ new->type_shadowed = (tree) write_tree (&new->type_shadowed);
+ new->shadowed_labels = (tree) write_tree (&new->shadowed_labels);
+ new->blocks = (tree) write_tree (&new->blocks);
+ new->this_class = (tree) write_tree (&new->this_class);
+ new->incomplete = (tree) write_tree (&new->incomplete);
+ new->dead_vars_from_for = (tree) write_tree (&new->dead_vars_from_for);
+ if (new->level_chain)
+ new->level_chain = (struct binding_level *)
+ pickle_binding_level (&new->level_chain);
+ store_to_db (&id, sizeof (int), new, sizeof (struct binding_level));
+
+ free (new);
+ return id;
+}
+
+void
+lang_pickle_tree (t, oldt)
+ tree t;
+ tree oldt;
+{
+ enum tree_code code = TREE_CODE (oldt);
+ if (code == IDENTIFIER_NODE)
+ {
+ struct lang_identifier *li = (struct lang_identifier *) t;
+ struct lang_id2 *li2 = li->x;
+ li->namespace_bindings = (tree) write_tree (&li->namespace_bindings);
+ li->bindings = (tree) write_tree (&li->bindings);
+ li->class_value = (tree) write_tree (&li->class_value);
+ li->class_template_info = (tree) write_tree (&li->class_template_info);
+ if (li2)
+ {
+ struct lang_id2 *li2new = xmalloc (sizeof (struct lang_id2));
+ int li2id;
+ li2id = current_id++;
+ memcpy (li2new, li2, sizeof (struct lang_id2));
+ li->x = li2new;
+ li2new->label_value = (tree) write_tree (&li2new->label_value);
+ li2new->implicit_decl = (tree) write_tree (&li2new->implicit_decl);
+ li2new->error_locus = (tree) write_tree (&li2new->error_locus);
+ store_to_db (&li2id, sizeof (int), li2new, sizeof (struct lang_id2));
+ free (li2new);
+ li->x = (struct lang_id2 *)li2id;
+ }
+ }
+ else if (code == CPLUS_BINDING)
+ {
+ if (BINDING_HAS_LEVEL_P (oldt))
+ BINDING_LEVEL (t) = (struct binding_level *)
+ pickle_binding_level (&BINDING_LEVEL (t));
+ else
+ BINDING_SCOPE (t) = (tree) write_tree (&BINDING_SCOPE (t));
+ BINDING_VALUE (t) = (tree) write_tree (&BINDING_VALUE (t));
+ }
+ else if (code == OVERLOAD)
+ OVL_FUNCTION (t) = (tree) write_tree (&OVL_FUNCTION (t));
+ else if (code == TEMPLATE_PARM_INDEX)
+ TEMPLATE_PARM_DECL (t) = (tree) write_tree (&TEMPLATE_PARM_DECL (t));
+ else if (TREE_CODE_CLASS (code) == 'd')
+ {
+#if 0
+ struct lang_decl *ld = DECL_LANG_SPECIFIC (t);
+ if (ld)
+ {
+ if (CAN_HAVE_FULL_LANG_DECL_P (oldt))
+ if (TREE_CODE (t) == FUNCTION_DECL
+ && !DECL_PENDING_INLINE_P (oldt))
+ {
+// DECL_SAVED_FUNCTION_DATA (t) = (struct cp_language_function *)pickle_lang_function (t, (struct cp_language_function *)DECL_SAVED_FUNCTION_DATA (t));
+ }
+ DECL_LANG_SPECIFIC (t) =
+ (struct lang_decl *)pickle_decl_lang_specific (oldt, DECL_LANG_SPECIFIC (t));
+ }
+#endif
+ }
+ else if (TREE_CODE_CLASS (code) == 't')
+ {
+ struct lang_type *lt = TYPE_LANG_SPECIFIC (t);
+ if (lt && !(TREE_CODE (t) == POINTER_TYPE
+ && TREE_CODE (TREE_TYPE (oldt)) == METHOD_TYPE))
+ {
+ struct lang_type *new;
+ int id;
+ splay_tree_node result;
+ if (ggc_set_mark (lt))
+ {
+ result = splay_tree_lookup (written_trees, (splay_tree_key) lt);
+ if (result)
+ TYPE_LANG_SPECIFIC (t) = (struct lang_type *)result->value;
+ return;
+ }
+ id = current_id++;
+ new = xmalloc (sizeof (struct lang_type));
+ memcpy (new, lt, sizeof (struct lang_type));
+ splay_tree_insert (written_trees, (splay_tree_key)lt, id);
+ new->primary_base = (tree) write_tree (&new->primary_base);
+ new->vfields = (tree) write_tree (&new->vfields);
+ new->vbases = (tree) write_tree (&new->vbases);
+ new->tags = (tree) write_tree (&new->tags);
+ new->size = (tree) write_tree (&new->size);
+ new->pure_virtuals = (tree) write_tree (&new->pure_virtuals);
+ new->friend_classes = (tree) write_tree (&new->friend_classes);
+ new->rtti = (tree) write_tree (&new->rtti);
+ new->methods = (tree) write_tree (&new->methods);
+ new->template_info = (tree) write_tree (&new->template_info);
+ new->befriending_classes = (tree) write_tree (&new->befriending_classes);
+ store_to_db (&id, sizeof (int), new, sizeof (struct lang_type));
+ free (new);
+ TYPE_LANG_SPECIFIC (t) = (struct lang_type *)id;
+ }
+ else if (lt)
+ TYPE_LANG_SPECIFIC (t) = (struct lang_type *)write_tree ((tree *)&TYPE_LANG_SPECIFIC (t));
+ }
+
+}
static void
mark_named_label_lists (labs, uses)
@@ -8133,6 +8389,8 @@ finish_decl (decl, init, asmspec_tree)
tree decl, init;
tree asmspec_tree;
{
+ int id;
+ tree fred;
cp_finish_decl (decl, init, asmspec_tree, 0);
}
@@ -13888,7 +14146,7 @@ tree
finish_function (flags)
int flags;
{
- register tree fndecl = current_function_decl;
+ tree fndecl = current_function_decl;
tree fntype, ctype = NULL_TREE;
int call_poplevel = (flags & 1) != 0;
int inclass_inline = (flags & 2) != 0;
@@ -13983,6 +14241,12 @@ finish_function (flags)
/* Set the BLOCK_SUPERCONTEXT of the outermost function scope to point
to the FUNCTION_DECL node itself. */
BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
+ {
+ tree temp;
+ temp = read_tree ((tree)write_tree (&fndecl));
+ temp = temp+1;
+ temp = temp-1;
+ }
/* Save away current state, if appropriate. */
if (!processing_template_decl)
@@ -13999,7 +14263,7 @@ finish_function (flags)
function.) */
if (!processing_template_decl && calls_setjmp_p (fndecl))
DECL_UNINLINABLE (fndecl) = 1;
-
+
/* Clear out memory we no longer need. */
free_after_parsing (cfun);
/* Since we never call rest_of_compilation, we never clear
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 6564f8e4169..d71f6674c09 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -38,7 +38,7 @@
#include "output.h"
#include "timevar.h"
#include "debug.h"
-
+#include "treepch.h"
/* There routines provide a modular interface to perform many parsing
operations. They may therefore be used during actual parsing, or
during template instantiation, which may be regarded as a
@@ -1676,7 +1676,7 @@ finish_declarator (declarator, declspecs, attributes,
}
/* Finish a translation unit. */
-
+extern DBM * datafile;
void
finish_translation_unit ()
{
@@ -1690,6 +1690,8 @@ finish_translation_unit ()
finish_fname_decls ();
finish_file ();
+ if (datafile)
+ dbm_close (datafile);
}
/* Finish a template type parameter, specified as AGGR IDENTIFIER.
diff --git a/gcc/tree.c b/gcc/tree.c
index 548ba7e970c..2bbd71e6def 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -45,7 +45,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "hashtab.h"
#include "output.h"
#include "target.h"
-
+#include "treepch.h"
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
/* obstack.[ch] explicitly declined to prototype this. */
@@ -4980,3 +4980,421 @@ build_common_tree_nodes_2 (short_double)
TYPE_MODE (V8QI_type_node) = V8QImode;
finish_vector_type (V8QI_type_node);
}
+DBM * datafile = NULL;
+const char *datafilename = "testtree";
+size_t current_id = 1;
+splay_tree read_trees = NULL;
+splay_tree written_trees = NULL;
+static int pickle_string PARAMS ((const char *));
+static char * pickle_tree PARAMS ((tree));
+static tree unpickle_tree PARAMS ((tree));
+static const char * unpickle_string PARAMS ((int));
+#define VARRAY_BYTES(x) ((sizeof (struct varray_head_tag) - sizeof (varray_data)) + (x->num_elements * x->element_size))
+static int
+pickle_string (s)
+ const char *s;
+{
+ int id;
+ splay_tree_node result;
+ result = splay_tree_lookup (written_trees, (splay_tree_key)s);
+ if (result)
+ return result->value;
+ id = current_id++;
+ splay_tree_insert (written_trees, (splay_tree_key)s, id);
+ store_to_db (&id, sizeof (int), (void *)s, strlen (s) + 1);
+ return id;
+}
+static const char *
+unpickle_string (id)
+ int id;
+{
+ datum key, data;
+ splay_tree_node result;
+ const char *ret;
+ if (id == 0)
+ return NULL;
+ result = splay_tree_lookup (read_trees, id);
+ if (result)
+ return (const char *)result->value;
+ key.dptr = (char *)&id;
+ key.dsize = sizeof (int);
+ data = dbm_fetch (datafile, key);
+ if (!data.dptr)
+ abort ();
+ ret = ggc_alloc_string (data.dptr, -1);
+ return ret;
+}
+static varray_type unpickle_tree_varray PARAMS ((varray_type));
+varray_type
+read_tree_varray (id)
+ varray_type id;
+{
+ splay_tree_node result;
+ varray_type ret;
+ if (id == 0)
+ return 0;
+ result = splay_tree_lookup (read_trees, (splay_tree_key) id);
+ if (result)
+ return (varray_type) result->value;
+ ret = unpickle_tree_varray (id);
+ return ret;
+}
+tree
+read_tree (id)
+ tree id;
+{
+ splay_tree_node result;
+ tree ret;
+ if (id == 0)
+ return NULL_TREE;
+ if (read_trees == NULL)
+ read_trees = splay_tree_new (splay_tree_compare_pointers, NULL, NULL);
+ result = splay_tree_lookup (read_trees, (splay_tree_key) id);
+ if (result)
+ return (tree) result->value;
+ ret = unpickle_tree (id);
+ return ret;
+}
+extern void lang_pickle_tree PARAMS ((tree, tree));
+extern void lang_unpickle_tree PARAMS ((tree));
+static
+varray_type
+unpickle_tree_varray (id)
+ varray_type id;
+{
+ int i;
+ datum key, data;
+ varray_type buffer;
+ if (id == 0)
+ return 0;
+ key.dptr = (char *)&id;
+ key.dsize = sizeof(int);
+ data = dbm_fetch (datafile,key);
+ if (!data.dptr)
+ abort ();
+ buffer = xmalloc (VARRAY_BYTES (((varray_type)data.dptr)));
+ memcpy (buffer, data.dptr, VARRAY_BYTES (((varray_type)data.dptr)));
+ buffer->name = unpickle_string ((int)buffer->name);
+ for (i = buffer->num_elements - 1; i >= 0; --i)
+ VARRAY_TREE (buffer, i) = (tree) read_tree (VARRAY_TREE (buffer, i));
+ return buffer;
+}
+
+static tree
+unpickle_tree (id)
+ tree id;
+{
+ datum key, data;
+ tree buffer;
+ if (id == 0)
+ return NULL_TREE;
+ key.dptr = (char *) &id;
+ key.dsize = sizeof (int);
+ data = dbm_fetch (datafile, key);
+ if (!data.dptr)
+ abort();
+ if (TREE_CODE ((tree) data.dptr) == TREE_VEC)
+ buffer = make_tree_vec (TREE_VEC_LENGTH ((tree) data.dptr));
+ else
+ buffer = make_node (TREE_CODE ((tree) data.dptr));
+ splay_tree_insert (read_trees, (splay_tree_key) id,
+ (splay_tree_value) buffer);
+ memcpy (buffer, data.dptr, data.dsize);
+ TREE_CHAIN (buffer) = read_tree (TREE_CHAIN (buffer));
+ TREE_TYPE (buffer) = read_tree (TREE_TYPE (buffer));
+ if (TREE_CODE (buffer) == IDENTIFIER_NODE)
+ {
+ return buffer;
+ }
+
+ switch (TREE_CODE_CLASS (TREE_CODE (buffer)))
+ {
+ case 'c':
+ if (TREE_CODE (buffer) == STRING_CST)
+ TREE_STRING_POINTER (buffer) =
+ unpickle_string ((int)TREE_STRING_POINTER (buffer));
+ else if (TREE_CODE (buffer) == COMPLEX_CST)
+ {
+ TREE_REALPART (buffer) = read_tree (TREE_REALPART (buffer));
+ TREE_IMAGPART (buffer) = read_tree (TREE_IMAGPART (buffer));
+ }
+
+ break;
+ case 'x':
+ if (TREE_CODE (buffer) == IDENTIFIER_NODE)
+ IDENTIFIER_POINTER (buffer) = (const char *)
+ unpickle_string ((int)IDENTIFIER_POINTER (buffer));
+ else if (TREE_CODE (buffer) == TREE_LIST)
+ {
+ TREE_PURPOSE (buffer) = read_tree (TREE_PURPOSE (buffer));
+ TREE_VALUE (buffer) = read_tree (TREE_VALUE (buffer));
+ }
+ else if (TREE_CODE (buffer) == TREE_VEC)
+ {
+ int i;
+ for (i = 0; i < TREE_VEC_LENGTH (buffer); i++)
+ TREE_VEC_ELT (buffer, i) = read_tree (TREE_VEC_ELT (buffer, i));
+ }
+ break;
+ case 'd':
+ DECL_SOURCE_FILE (buffer) =
+ unpickle_string ((int)DECL_SOURCE_FILE (buffer));
+ DECL_SIZE (buffer) = read_tree(DECL_SIZE (buffer));
+ DECL_SIZE_UNIT (buffer) = read_tree(DECL_SIZE_UNIT (buffer));
+ DECL_NAME (buffer) = read_tree (DECL_NAME (buffer));
+ DECL_CONTEXT (buffer) = read_tree (DECL_CONTEXT (buffer));
+ DECL_ARGUMENTS (buffer) = read_tree (DECL_ARGUMENTS (buffer));
+ DECL_RESULT_FLD (buffer) = read_tree (DECL_RESULT_FLD (buffer));
+ DECL_INITIAL (buffer) = read_tree (DECL_INITIAL (buffer));
+ DECL_ABSTRACT_ORIGIN (buffer) = read_tree (DECL_ABSTRACT_ORIGIN (buffer));
+ DECL_SECTION_NAME (buffer) = read_tree (DECL_SECTION_NAME (buffer));
+ DECL_MACHINE_ATTRIBUTES (buffer) =
+ read_tree (DECL_MACHINE_ATTRIBUTES (buffer));
+ DECL_VINDEX (buffer) = read_tree (DECL_VINDEX (buffer));
+ if (TREE_CODE (buffer) == FIELD_DECL)
+ buffer->decl.u2.t = read_tree (buffer->decl.u2.t);
+ /*FIXME: if it's PARM_DECL, u2 is an RTL */
+ /*FIXME: Handle lang specific */
+ break;
+ case 't':
+ TYPE_VALUES (buffer) = read_tree (TYPE_VALUES (buffer));
+ TYPE_SIZE (buffer) = read_tree (TYPE_SIZE (buffer));
+ TYPE_SIZE_UNIT (buffer) = read_tree (TYPE_SIZE_UNIT (buffer));
+ TYPE_ATTRIBUTES (buffer) = read_tree (TYPE_ATTRIBUTES (buffer));
+ TYPE_POINTER_TO (buffer) = read_tree (TYPE_POINTER_TO (buffer));
+ TYPE_REFERENCE_TO (buffer) = read_tree (TYPE_REFERENCE_TO (buffer));
+ TYPE_NAME (buffer) = read_tree (TYPE_NAME (buffer));
+ TYPE_MIN_VALUE (buffer) = read_tree (TYPE_MIN_VALUE (buffer));
+ TYPE_MAX_VALUE (buffer) = read_tree (TYPE_MAX_VALUE (buffer));
+ TYPE_NEXT_VARIANT (buffer) = read_tree (TYPE_NEXT_VARIANT (buffer));
+ TYPE_MAIN_VARIANT (buffer) = read_tree (TYPE_MAIN_VARIANT (buffer));
+ TYPE_BINFO (buffer) = read_tree (TYPE_BINFO (buffer));
+ TYPE_NONCOPIED_PARTS (buffer) =
+ read_tree (TYPE_NONCOPIED_PARTS (buffer));
+ TYPE_CONTEXT (buffer) = read_tree (TYPE_CONTEXT (buffer));
+ /* FIXME: Handle lang_specific */
+ break;
+ case 'b':
+ {
+ BLOCK_VARS (buffer) = read_tree (BLOCK_VARS (buffer));
+ BLOCK_SUBBLOCKS (buffer) = read_tree (BLOCK_SUBBLOCKS (buffer));
+ BLOCK_SUPERCONTEXT (buffer) =
+ read_tree (BLOCK_SUPERCONTEXT (buffer));
+ BLOCK_ABSTRACT_ORIGIN (buffer) =
+ read_tree (BLOCK_ABSTRACT_ORIGIN (buffer));
+ BLOCK_FRAGMENT_ORIGIN (buffer) =
+ read_tree (BLOCK_FRAGMENT_ORIGIN (buffer));
+ BLOCK_FRAGMENT_CHAIN (buffer) =
+ read_tree (BLOCK_FRAGMENT_CHAIN (buffer));
+ }
+ break;
+ case 'r':
+ case 's':
+ case '<':
+ case '1':
+ case '2':
+ case 'e':
+ {
+ int i;
+ for (i = 0; i < TREE_CODE_LENGTH (TREE_CODE (buffer)); i++)
+ TREE_OPERAND (buffer, i) = read_tree (TREE_OPERAND (buffer, i));
+ }
+ break;
+ default:
+ break;
+ }
+ return buffer;
+}
+
+static char *
+pickle_tree_varray (v)
+ varray_type v;
+{
+ int i;
+ varray_type buffer = xmalloc (VARRAY_BYTES (v));
+ memcpy (buffer, v, VARRAY_BYTES (v));
+ buffer->name = (const char *) pickle_string (buffer->name);
+ for (i = buffer->num_elements - 1; i >= 0; --i)
+ VARRAY_TREE (buffer, i) = (tree) write_tree (&VARRAY_TREE (buffer, i));
+ return (char *) buffer;
+}
+static char *
+pickle_tree (t)
+ tree t;
+{
+ tree buffer = xmalloc (tree_size (t));
+ memcpy (buffer, t, tree_size (t));
+ TREE_CHAIN (buffer) = (tree)write_tree (&TREE_CHAIN (buffer));
+ TREE_TYPE (buffer) = (tree)write_tree (&TREE_TYPE (buffer));
+ if (TREE_CODE (buffer) == IDENTIFIER_NODE)
+ {
+ IDENTIFIER_POINTER (buffer) = (const char *)pickle_string (IDENTIFIER_POINTER (buffer));
+ return (char *)buffer;
+ }
+ else if (TREE_CODE (buffer) == TREE_LIST)
+ {
+ TREE_PURPOSE (buffer) = (tree) write_tree (&TREE_PURPOSE (buffer));
+ TREE_VALUE (buffer) = (tree) write_tree (&TREE_VALUE (buffer));
+ return (char *)buffer;
+ }
+ else if (TREE_CODE (buffer) == TREE_VEC)
+ {
+ int i;
+ for (i = 0; i < TREE_VEC_LENGTH (buffer); i++)
+ TREE_VEC_ELT (buffer, i) =
+ (tree) write_tree (&TREE_VEC_ELT (buffer, i));
+ return (char *) buffer;
+ }
+ switch (TREE_CODE_CLASS (TREE_CODE (buffer)))
+ {
+ case 'c':
+ if (TREE_CODE (buffer) == STRING_CST)
+ TREE_STRING_POINTER (buffer) = (const char *)
+ pickle_string (TREE_STRING_POINTER (buffer));
+ else if (TREE_CODE (buffer) == COMPLEX_CST)
+ {
+ TREE_REALPART (buffer) = (tree) write_tree (&TREE_REALPART (buffer));
+ TREE_IMAGPART (buffer) = (tree) write_tree (&TREE_IMAGPART (buffer));
+ }
+ break;
+ case 'x':
+ lang_pickle_tree (buffer, t);
+ break;
+ case 'd':
+ DECL_SOURCE_FILE (buffer) =
+ (const char *)pickle_string (DECL_SOURCE_FILE (buffer));
+ DECL_SIZE (buffer) = (tree)write_tree(&DECL_SIZE (buffer));
+ DECL_SIZE_UNIT (buffer) = (tree) write_tree(&DECL_SIZE_UNIT (buffer));
+ DECL_NAME (buffer) = (tree) write_tree (&DECL_NAME (buffer));
+ DECL_CONTEXT (buffer) = (tree) write_tree (&DECL_CONTEXT (buffer));
+ DECL_ARGUMENTS (buffer) = (tree) write_tree (&DECL_ARGUMENTS (buffer));
+ DECL_RESULT_FLD (buffer) = (tree) write_tree (&DECL_RESULT_FLD (buffer));
+ DECL_INITIAL (buffer) = (tree) write_tree (&DECL_INITIAL (buffer));
+ DECL_ABSTRACT_ORIGIN (buffer) =
+ (tree) write_tree (&DECL_ABSTRACT_ORIGIN (buffer));
+ DECL_SECTION_NAME (buffer) =
+ (tree) write_tree (&DECL_SECTION_NAME (buffer));
+ DECL_MACHINE_ATTRIBUTES (buffer) =
+ (tree) write_tree (&DECL_MACHINE_ATTRIBUTES (buffer));
+ DECL_VINDEX (buffer) = (tree) write_tree (&DECL_VINDEX (buffer));
+ if (DECL_ASSEMBLER_NAME_SET_P (t))
+ DECL_ASSEMBLER_NAME (buffer) = (tree) write_tree (&DECL_ASSEMBLER_NAME (buffer));
+ if (TREE_CODE (buffer) == FIELD_DECL)
+ buffer->decl.u2.t = (tree) write_tree (&buffer->decl.u2.t);
+ lang_pickle_tree (buffer, t);
+ break;
+ case 't':
+ TYPE_VALUES (buffer) = (tree) write_tree (&TYPE_VALUES (buffer));
+ TYPE_SIZE (buffer) = (tree) write_tree (&TYPE_SIZE (buffer));
+ TYPE_SIZE_UNIT (buffer) = (tree) write_tree (&TYPE_SIZE_UNIT (buffer));
+ TYPE_ATTRIBUTES (buffer) = (tree) write_tree (&TYPE_ATTRIBUTES (buffer));
+ TYPE_POINTER_TO (buffer) = (tree) write_tree (&TYPE_POINTER_TO (buffer));
+ TYPE_REFERENCE_TO (buffer) =
+ (tree) write_tree (&TYPE_REFERENCE_TO (buffer));
+ TYPE_NAME (buffer) = (tree) write_tree (&TYPE_NAME (buffer));
+ TYPE_MIN_VALUE (buffer) = (tree) write_tree (&TYPE_MIN_VALUE (buffer));
+ TYPE_MAX_VALUE (buffer) = (tree) write_tree (&TYPE_MAX_VALUE (buffer));
+ TYPE_NEXT_VARIANT (buffer) =
+ (tree) write_tree (&TYPE_NEXT_VARIANT (buffer));
+ TYPE_MAIN_VARIANT (buffer) =
+ (tree) write_tree (&TYPE_MAIN_VARIANT (buffer));
+ TYPE_BINFO (buffer) = (tree) write_tree (&TYPE_BINFO (buffer));
+ TYPE_NONCOPIED_PARTS (buffer) =
+ (tree) write_tree (&TYPE_NONCOPIED_PARTS (buffer));
+ TYPE_CONTEXT (buffer) = (tree) write_tree (&TYPE_CONTEXT (buffer));
+ lang_pickle_tree (buffer, t);
+ break;
+ case 'b':
+ BLOCK_VARS (buffer) = (tree) write_tree (&BLOCK_VARS (buffer));
+ BLOCK_SUBBLOCKS (buffer) =
+ (tree) write_tree (&BLOCK_SUBBLOCKS (buffer));
+ BLOCK_SUPERCONTEXT (buffer) =
+ (tree) write_tree (&BLOCK_SUPERCONTEXT (buffer));
+ BLOCK_ABSTRACT_ORIGIN (buffer) =
+ (tree) write_tree (&BLOCK_ABSTRACT_ORIGIN (buffer));
+ break;
+ case 'r':
+ case 's':
+ case '<':
+ case '1':
+ case '2':
+ case 'e':
+ {
+ int i;
+ for (i = 0; i < first_rtl_op (TREE_CODE (buffer)); i++)
+ TREE_OPERAND (buffer, i) = (tree)
+ write_tree (&TREE_OPERAND (buffer, i));
+ }
+ break;
+ default:
+ break;
+ }
+ return (char *)buffer;
+}
+void
+store_to_db (key1, keylen, data1, datalen)
+ void *key1;
+ size_t keylen;
+ void *data1;
+ size_t datalen;
+{
+ datum key, data;
+ key.dptr = (char *)key1;
+ key.dsize = keylen;
+ data.dptr = (char *)data1;
+ data.dsize = datalen;
+ dbm_store (datafile, key, data, DBM_REPLACE);
+}
+
+int
+write_tree_varray (v)
+ varray_type v;
+{
+ int id;
+ splay_tree_node result;
+ char *buffer;
+ if (!v)
+ return 0;
+ if (ggc_set_mark (v))
+ {
+ result = splay_tree_lookup (written_trees, (splay_tree_key) v);
+ if (result)
+ return result->value;
+ }
+ id = current_id++;
+ splay_tree_insert (written_trees, (splay_tree_key)v, id);
+ buffer = pickle_tree_varray (v);
+ store_to_db (&id, sizeof (int), buffer, VARRAY_BYTES (v));
+ free (buffer);
+ return id;
+}
+
+int
+write_tree (tp)
+ tree *tp;
+{
+ int id;
+ splay_tree_node result;
+ char *buffer;
+ if (written_trees == NULL)
+ written_trees = splay_tree_new (splay_tree_compare_pointers, NULL, NULL);
+ if (datafile == NULL)
+ datafile = dbm_open ((char *)datafilename, O_RDWR | O_CREAT, 0666);
+ if (datafile == NULL)
+ abort();
+ /* Skip empty subtrees. */
+ if (!*tp)
+ return 0;
+ if (ggc_set_mark (*tp))
+ {
+ result = splay_tree_lookup (written_trees, (splay_tree_key)*tp);
+ if (result)
+ return result->value;
+ }
+ id = current_id++;
+ splay_tree_insert (written_trees, (splay_tree_key)*tp, id);
+ buffer = pickle_tree (*tp);
+ store_to_db (&id, sizeof (int), buffer, tree_size (*tp));
+ free (buffer);
+ return id;
+}
diff --git a/gcc/treepch.h b/gcc/treepch.h
new file mode 100644
index 00000000000..be031de7bc4
--- /dev/null
+++ b/gcc/treepch.h
@@ -0,0 +1,19 @@
+#include "splay-tree.h"
+#ifdef HAVE_SDBM_H
+#include "sdbm.h"
+#elif HAVE_GDBM_H
+#include "gdbm.h"
+#endif
+#include "varray.h"
+extern int write_tree PARAMS ((tree *));
+extern int write_tree_varray PARAMS ((varray_type));
+extern tree read_tree PARAMS ((tree));
+extern varray_type read_tree_varray PARAMS ((varray_type));
+extern void lang_pickle_tree PARAMS ((tree, tree));
+extern void lang_unpickle_tree PARAMS ((tree));
+extern splay_tree read_trees;
+extern splay_tree written_trees;
+extern size_t current_id;
+extern const char *datafilename;
+extern DBM *datafile;
+extern void store_to_db PARAMS ((void *, size_t, void *, size_t));