shebs 02/08/17 12:17:54
Modified: gcc c-decl.c
gcc/cp cp-lang.c decl.c except.c rtti.c
gcc/pfe cp-freeze-thaw.c pfe-header.h stub-pfe.c
Log:
Make PFE work for C++, and remove now-unused pfe_setdecls calls.
Revision Changes Path
1.115 +0 -8 gcc3/gcc/c-decl.c
Index: c-decl.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/c-decl.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -r1.114 -r1.115
--- c-decl.c 2002/08/17 06:29:03 1.114
+++ c-decl.c 2002/08/17 19:17:51 1.115
@@ -7545,14 +7545,6 @@
pfe_freeze_thaw_c_binding_level (NULL, &p->binding_level);
}
-/* Set the current_binding_level->names. */
-void
-pfe_setdecls (names)
- tree names;
-{
- current_binding_level->names = names;
-}
-
DEFINE_CHECK_STRUCT_FUNCTION (language_function)
DEFINE_CHECK_STRUCT_FUNCTION (binding_level)
/* APPLE LOCAL end PFE */
1.17 +0 -2 gcc3/gcc/cp/cp-lang.c
Index: cp-lang.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/cp/cp-lang.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- cp-lang.c 2002/08/11 19:22:06 1.16
+++ cp-lang.c 2002/08/17 19:17:52 1.17
@@ -115,7 +115,6 @@
#define LANG_HOOKS_ATTRIBUTE_TABLE cxx_attribute_table
/* APPLE LOCAL PFE */
-#ifdef PFE
#undef LANG_HOOKS_PFE_LANG_INIT
#define LANG_HOOKS_PFE_LANG_INIT cxx_pfe_lang_init
#undef LANG_HOOKS_PFE_FREEZE_THAW_COMPILER_STATE
@@ -130,7 +129,6 @@
#define LANG_HOOKS_PFE_CHECK_ALL_STRUCT_SIZES cxx_pfe_check_all_struct_sizes
#undef LANG_HOOKS_PFE_CHECK_SETTINGS
#define LANG_HOOKS_PFE_CHECK_SETTINGS cxx_pfe_check_settings
-#endif
/* APPLE LOCAL end PFE */
#undef LANG_HOOKS_TREE_INLINING_WALK_SUBTREES
1.111 +8 -61 gcc3/gcc/cp/decl.c
Index: decl.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/cp/decl.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- decl.c 2002/08/17 06:29:10 1.110
+++ decl.c 2002/08/17 19:17:52 1.111
@@ -6551,7 +6551,6 @@
/* Fill in back-end hooks. */
lang_missing_noreturn_ok_p = &cp_missing_noreturn_ok_p;
-
/* APPLE LOCAL begin PFE */
if (PFE_LOADING)
{
@@ -6560,6 +6559,7 @@
}
else {
/* APPLE LOCAL end PFE */
+
/* Create the global variables. */
push_to_top_level ();
@@ -6568,8 +6568,9 @@
push_namespace (get_identifier ("::"));
global_namespace = current_namespace;
current_lang_name = NULL_TREE;
+
/* APPLE LOCAL PFE */
- }
+ } /* end of !PFE_LOADING case */
/* Adjust various flags based on command-line settings. */
if (! flag_permissive && ! pedantic)
@@ -6585,45 +6586,19 @@
flag_inline_functions = 0;
}
-#if 1 /* APPLE MERGE check the need for all this carefully */
+ /* APPLE LOCAL begin PFE */
if (PFE_LOADING)
{
- /* In C++, we never create builtin functions whose name does not
- begin with `__'. Users should be using headers to get prototypes
- in C++. It would be nice if we could warn when `-fbuiltin' is
- used explicitly, but we do not have that information. */
- flag_no_builtin = 1;
-
/* Make the binding_level structure for global names. */
/* global_binding_level is already thawed from the PFE. */
current_function_decl = NULL_TREE;
free_binding_level = NULL_BINDING_LEVEL;
current_binding_level = global_binding_level;
- }
-#endif
- if (PFE_LOADING)
- {
- /* Process the global declarations received directly from the
- precompiled header. The aim to remove TREE_ASM_WRITTEN
- (decl) marker, if set. This enables the compiler to emit the
- globals again. */
- tree precompiled_decls = getdecls ();
- int len = list_length (precompiled_decls);
- int i;
- tree decl;
- /* Process the decls in reverse order--earliest first.
- Put them into VEC from back to front, then take out from front. */
-
- for (i = 0, decl = precompiled_decls; i < len; i++, decl = TREE_CHAIN (decl))
- {
- /* If TREE_ASM_WRITTEN is set then reset it.
- This will enable the emit during rest_of_compilation(). */
- if (TREE_ASM_WRITTEN (decl) == 1)
- TREE_ASM_WRITTEN (decl) = 0;
- }
+ pfe_c_common_nodes_and_builtins ();
}
else {
+ /* APPLE LOCAL end PFE */
/* Initially, C. */
current_lang_name = lang_name_c;
@@ -6691,7 +6666,6 @@
vtable_index_type = ptrdiff_type_node;
vtt_parm_type = build_pointer_type (const_ptr_type_node);
-
void_ftype = build_function_type (void_type_node, void_list_node);
void_ftype_ptr = build_function_type (void_type_node,
tree_cons (NULL_TREE,
@@ -6741,22 +6715,9 @@
global_type_node = make_node (LANG_TYPE);
record_unknown_type (global_type_node, "global type");
- /* APPLE LOCAL PFE */
- }
-
/* Now, C++. */
current_lang_name = lang_name_cplusplus;
- /* APPLE LOCAL PFE */
- if (PFE_LOADING)
- {
-#if 0 /* APPLE MERGE need this? */
- lang_attribute_table = cp_attribute_table;
-#endif
- pfe_c_common_nodes_and_builtins ();
- }
- else {
-
{
tree bad_alloc_type_node, newtype, deltype;
tree ptr_ftype_sizetype;
@@ -6785,7 +6746,7 @@
= build_library_fn_ptr ("__cxa_pure_virtual", void_ftype);
/* APPLE LOCAL PFE */
- }
+ } /* end of !PFE_LOADING case */
/* Perform other language dependent initializations. */
init_class_processing ();
@@ -6793,13 +6754,7 @@
init_rtti_processing ();
if (flag_exceptions)
- {
- /* APPLE LOCAL PFE */
- if (PFE_LOADING)
- pfe_init_exception_processing ();
- else
- init_exception_processing ();
- }
+ init_exception_processing ();
if (! supports_one_only ())
flag_weak = 0;
@@ -15375,14 +15330,6 @@
only_namespace_names = hdr->only_namespace_names;
}
-}
-
-/* Set the current_binding_level->names. */
-void
-pfe_setdecls (names)
- tree names;
-{
- current_binding_level->names = names;
}
/* anon_cnt is used to create anonymous type names. */
1.9 +9 -15 gcc3/gcc/cp/except.c
Index: except.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/cp/except.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- except.c 2002/08/07 03:13:25 1.8
+++ except.c 2002/08/17 19:17:52 1.9
@@ -37,6 +37,9 @@
#include "toplev.h"
#include "tree-inline.h"
+/* APPLE LOCAL PFE */
+#include "pfe/pfe.h"
+
static void push_eh_cleanup PARAMS ((tree));
static tree prepare_eh_type PARAMS ((tree));
static tree build_eh_type_type PARAMS ((tree));
@@ -63,6 +66,9 @@
{
tree tmp;
+ /* APPLE LOCAL PFE */
+ if (!PFE_LOADING) {
+
/* void std::terminate (); */
push_namespace (std_identifier);
tmp = build_function_type (void_type_node, void_list_node);
@@ -77,6 +83,9 @@
call_unexpected_node
= push_throw_library_fn (get_identifier ("__cxa_call_unexpected"), tmp);
+ /* APPLE LOCAL PFE */
+ }
+
eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
? "__gxx_personality_sj0"
: "__gxx_personality_v0");
@@ -974,18 +983,3 @@
}
lineno = save_line;
}
-
-/* APPLE LOCAL begin PFE */
-/* Subset of init_exception_processing() used only when loading a PFE
- file. */
-void
-pfe_init_exception_processing ()
-{
- eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
- ? "__gxx_personality_sj0"
- : "__gxx_personality_v0");
-
- lang_eh_runtime_type = build_eh_type_type;
- lang_protect_cleanup_actions = &cp_protect_cleanup_actions;
-}
-/* APPLE LOCAL end PFE */
1.11 +5 -0 gcc3/gcc/cp/rtti.c
Index: rtti.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/cp/rtti.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- rtti.c 2002/08/02 10:08:17 1.10
+++ rtti.c 2002/08/17 19:17:53 1.11
@@ -30,6 +30,9 @@
#include "assert.h"
#include "toplev.h"
+/* APPLE LOCAL PFE */
+#include "pfe/pfe.h"
+
/* C++ returns type information to the user in struct type_info
objects. We also use type information to implement dynamic_cast and
exception handlers. Type information for a particular type is
@@ -1321,6 +1324,8 @@
static void
create_tinfo_types ()
{
+ /* APPLE LOCAL PFE */
+ if (!PFE_LOADING) /* FIXME this is probably a bad idea */
my_friendly_assert (!ti_desc_type_node, 20020609);
push_nested_namespace (abi_node);
1.14 +3 -1 gcc3/gcc/pfe/cp-freeze-thaw.c
Index: cp-freeze-thaw.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/pfe/cp-freeze-thaw.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- cp-freeze-thaw.c 2002/08/17 06:29:15 1.13
+++ cp-freeze-thaw.c 2002/08/17 19:17:54 1.14
@@ -68,11 +68,13 @@
and since we know were only called once we don't need to use
PFE_FREEZE_THAW_PTR anyhow. */
- hdr = (struct pfe_lang_compiler_state *)pfe_freeze_thaw_ptr_fp (pp);
+ hdr = (struct pfe_lang_compiler_state *) pfe_freeze_thaw_ptr_fp (pp);
PFE_GLOBAL_TO_HDR_IF_FREEZING (global_namespace);
PFE_FREEZE_THAW_WALK (hdr->global_namespace);
PFE_HDR_TO_GLOBAL_IF_THAWING (global_namespace);
+
+ pfe_freeze_thaw_cp_binding_level (hdr, NULL);
PFE_FREEZE_THAW_GLOBAL_TREE_ARRAY (cp_global_trees, CPTI_MAX);
1.10 +0 -3 gcc3/gcc/pfe/pfe-header.h
Index: pfe-header.h
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/pfe/pfe-header.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- pfe-header.h 2002/08/17 06:29:15 1.9
+++ pfe-header.h 2002/08/17 19:17:54 1.10
@@ -255,9 +255,6 @@
/* cpplib.c - freeze/thaw machine_function as part of a struct function. */
extern void pfe_freeze_thaw_answer PARAMS ((struct answer **));
-/* c-decl.c, cp/decl.c - set current_binding_level->names. */
-extern void pfe_setdecls PARAMS ((tree));
-
/* emit-rtl.c - freeze/thaw all globals. */
extern void pfe_freeze_thaw_emitrtl PARAMS ((pfe_compiler_state *));
1.10 +0 -6 gcc3/gcc/pfe/stub-pfe.c
Index: stub-pfe.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/pfe/stub-pfe.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- stub-pfe.c 2002/08/07 03:13:33 1.9
+++ stub-pfe.c 2002/08/17 19:17:54 1.10
@@ -282,12 +282,6 @@
{
}
-void
-pfe_setdecls (names)
- tree names;
-{
-}
-
void
pfe_decode_dbgpfe_options (str)
const char *str;