Commit 6bcedb4e by Mark Mitchell Committed by Mark Mitchell

c-common.h (flag_no_builtin): Declare.

	* c-common.h (flag_no_builtin): Declare.
	(flag_no_nonansi_builtin): Likewise.
	(c_common_nodes_and_builtins): Change prototype.
	* c-common.c (flag_no_builtin): New variable.
	(flag_no_nonansi_builtin): Likewise.
	(c_common_nodes_and_builtins): Remove parameters.  Adjust
	accordingly.
	* c-decl.c (flag_no_builtin): Remove.
	(flag_no_nonansi_builtin): Likewise.
	(init_decl_processing): Adjust call to
	c_common_nodes_and_builtins.

	* cp-tree.h (cp_tree_index): Add CPTI_FAKE_STD.
	(fake_std_node): New macro.
	* decl.c (in_std): Rename to ...
	(in_fake_std): ... this.
	(flag_no_builtin): Remove.
	(flag_no_nonansi_builtin): Likewise.
	(walk_namespaces_r): Use fake_std_node.
	(push_namespace): Use std_identifier.
	(pop_namespace): Use in_fake_std.
	(lookup_name_real): Use fake_std_node.
	(init_decl_processing): When -fhonor-std, create the `std'
	namespace.  Don't create a dummy fake_std_node in that case.
	Adjust call to c_common_nodes_and_builtins.  Use std_identifier.
	(builtin_function): Put builtins whose names don't begin
	with `_' in the std namespace.
	* decl2.c (flag_no_builtin): Remove.
	(flag_no_nonansi_builtin): Likewise.
	(set_decl_namespace): Use fake_std_node.
	(validate_nonmember_using_decl): Likewise.
	(do_using_directive): Likewise.
	(handle_class_head): Likewise.
	* dump.c (dequeue_and_dump): Likewise.
	* except.c (init_exception_processing): Use std_identifier.
	* init.c (build_member_call): Use fake_std_node.
	* rtti.c (init_rtti_processing): Use std_identifier.

From-SVN: r36940
parent 989b26a7
2000-10-18 Mark Mitchell <mark@codesourcery.com>
* c-common.h (flag_no_builtin): Declare.
(flag_no_nonansi_builtin): Likewise.
(c_common_nodes_and_builtins): Change prototype.
* c-common.c (flag_no_builtin): New variable.
(flag_no_nonansi_builtin): Likewise.
(c_common_nodes_and_builtins): Remove parameters. Adjust
accordingly.
* c-decl.c (flag_no_builtin): Remove.
(flag_no_nonansi_builtin): Likewise.
(init_decl_processing): Adjust call to
c_common_nodes_and_builtins.
2000-10-18 Marc Espie <espie@openbsd.org> 2000-10-18 Marc Espie <espie@openbsd.org>
* tm.texi (LIBGCC_SPEC): Synch with reality. * tm.texi (LIBGCC_SPEC): Synch with reality.
......
...@@ -140,6 +140,15 @@ cpp_reader parse_in; ...@@ -140,6 +140,15 @@ cpp_reader parse_in;
tree c_global_trees[CTI_MAX]; tree c_global_trees[CTI_MAX];
/* Nonzero means don't recognize the non-ANSI builtin functions. */
int flag_no_builtin;
/* Nonzero means don't recognize the non-ANSI builtin functions.
-ansi sets this. */
int flag_no_nonansi_builtin;
/* Nonzero means warn about possible violations of sequence point rules. */ /* Nonzero means warn about possible violations of sequence point rules. */
int warn_sequence_point; int warn_sequence_point;
...@@ -4767,16 +4776,10 @@ lang_get_alias_set (t) ...@@ -4767,16 +4776,10 @@ lang_get_alias_set (t)
} }
/* Build tree nodes and builtin functions common to both C and C++ language /* Build tree nodes and builtin functions common to both C and C++ language
frontends. frontends. */
CPLUS_MODE is nonzero if we are called from the C++ frontend, we generate
some stricter prototypes in that case.
NO_BUILTINS and NO_NONANSI_BUILTINS contain the respective values of
the language frontend flags flag_no_builtin and
flag_no_nonansi_builtin. */
void void
c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) c_common_nodes_and_builtins ()
int cplus_mode, no_builtins, no_nonansi_builtins;
{ {
tree temp; tree temp;
tree memcpy_ftype, memset_ftype, strlen_ftype; tree memcpy_ftype, memset_ftype, strlen_ftype;
...@@ -4889,7 +4892,8 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) ...@@ -4889,7 +4892,8 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
const_string_type_node, const_string_type_node,
endlink))); endlink)));
traditional_len_type_node = (flag_traditional && ! cplus_mode traditional_len_type_node = ((flag_traditional &&
c_language != clk_cplusplus)
? integer_type_node : sizetype); ? integer_type_node : sizetype);
traditional_len_endlink = tree_cons (NULL_TREE, traditional_len_type_node, traditional_len_endlink = tree_cons (NULL_TREE, traditional_len_type_node,
endlink); endlink);
...@@ -4908,9 +4912,11 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) ...@@ -4908,9 +4912,11 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
tree_cons (NULL_TREE, const_string_type_node, tree_cons (NULL_TREE, const_string_type_node,
endlink)); endlink));
traditional_ptr_type_node = (flag_traditional && ! cplus_mode traditional_ptr_type_node = ((flag_traditional &&
c_language != clk_cplusplus)
? string_type_node : ptr_type_node); ? string_type_node : ptr_type_node);
traditional_cptr_type_node = (flag_traditional && ! cplus_mode traditional_cptr_type_node = ((flag_traditional &&
c_language != clk_cplusplus)
? const_string_type_node : const_ptr_type_node); ? const_string_type_node : const_ptr_type_node);
/* Prototype for memcpy. */ /* Prototype for memcpy. */
...@@ -4970,7 +4976,7 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) ...@@ -4970,7 +4976,7 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
BUILT_IN_NORMAL, NULL_PTR); BUILT_IN_NORMAL, NULL_PTR);
/* Define alloca, ffs as builtins. /* Define alloca, ffs as builtins.
Declare _exit just to mark it as volatile. */ Declare _exit just to mark it as volatile. */
if (! no_builtins && ! no_nonansi_builtins) if (! flag_no_builtin && ! flag_no_nonansi_builtin)
{ {
#ifndef SMALL_STACK #ifndef SMALL_STACK
temp = builtin_function ("alloca", ptr_ftype_sizetype, temp = builtin_function ("alloca", ptr_ftype_sizetype,
...@@ -5166,7 +5172,7 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) ...@@ -5166,7 +5172,7 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
builtin_function ("__builtin_fputs", int_ftype_any, builtin_function ("__builtin_fputs", int_ftype_any,
BUILT_IN_FPUTS, BUILT_IN_NORMAL, "fputs"); BUILT_IN_FPUTS, BUILT_IN_NORMAL, "fputs");
if (! no_builtins) if (! flag_no_builtin)
{ {
builtin_function ("abs", int_ftype_int, BUILT_IN_ABS, builtin_function ("abs", int_ftype_int, BUILT_IN_ABS,
BUILT_IN_NORMAL, NULL_PTR); BUILT_IN_NORMAL, NULL_PTR);
...@@ -5178,7 +5184,7 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) ...@@ -5178,7 +5184,7 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
BUILT_IN_NORMAL, NULL_PTR); BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("labs", long_ftype_long, BUILT_IN_LABS, builtin_function ("labs", long_ftype_long, BUILT_IN_LABS,
BUILT_IN_NORMAL, NULL_PTR); BUILT_IN_NORMAL, NULL_PTR);
if (flag_isoc99 || ! no_nonansi_builtins) if (flag_isoc99 || ! flag_no_nonansi_builtin)
builtin_function ("llabs", longlong_ftype_longlong, BUILT_IN_LLABS, builtin_function ("llabs", longlong_ftype_longlong, BUILT_IN_LLABS,
BUILT_IN_NORMAL, NULL_PTR); BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("memcpy", memcpy_ftype, BUILT_IN_MEMCPY, builtin_function ("memcpy", memcpy_ftype, BUILT_IN_MEMCPY,
...@@ -5225,27 +5231,19 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) ...@@ -5225,27 +5231,19 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
/* Declare these functions volatile /* Declare these functions volatile
to avoid spurious "control drops through" warnings. */ to avoid spurious "control drops through" warnings. */
temp = builtin_function ("abort", cplus_mode ? void_ftype : void_ftype_any, temp = builtin_function ("abort",
((c_language == clk_cplusplus)
? void_ftype : void_ftype_any),
0, NOT_BUILT_IN, NULL_PTR); 0, NOT_BUILT_IN, NULL_PTR);
TREE_THIS_VOLATILE (temp) = 1; TREE_THIS_VOLATILE (temp) = 1;
TREE_SIDE_EFFECTS (temp) = 1; TREE_SIDE_EFFECTS (temp) = 1;
#if 0 /* ??? The C++ frontend used to do this. */
/* Well, these are actually ANSI, but we can't set DECL_BUILT_IN on
them... */
DECL_BUILT_IN_NONANSI (temp) = 1;
#endif
temp = builtin_function ("exit", temp = builtin_function ("exit",
cplus_mode ? void_ftype_int : void_ftype_any, ((c_language == clk_cplusplus)
? void_ftype_int : void_ftype_any),
0, NOT_BUILT_IN, NULL_PTR); 0, NOT_BUILT_IN, NULL_PTR);
TREE_THIS_VOLATILE (temp) = 1; TREE_THIS_VOLATILE (temp) = 1;
TREE_SIDE_EFFECTS (temp) = 1; TREE_SIDE_EFFECTS (temp) = 1;
#if 0 /* ??? The C++ frontend used to do this. */
/* Well, these are actually ANSI, but we can't set DECL_BUILT_IN on
them... */
DECL_BUILT_IN_NONANSI (temp) = 1;
#endif
} }
#if 0 #if 0
......
...@@ -370,6 +370,15 @@ extern int flag_hosted; ...@@ -370,6 +370,15 @@ extern int flag_hosted;
extern int flag_noniso_default_format_attributes; extern int flag_noniso_default_format_attributes;
/* Nonzero means don't recognize any builtin functions. */
extern int flag_no_builtin;
/* Nonzero means don't recognize the non-ANSI builtin functions.
-ansi sets this. */
extern int flag_no_nonansi_builtin;
/* Nonzero means warn about suggesting putting in ()'s. */ /* Nonzero means warn about suggesting putting in ()'s. */
extern int warn_parentheses; extern int warn_parentheses;
...@@ -454,7 +463,7 @@ extern tree c_build_qualified_type PARAMS ((tree, int)); ...@@ -454,7 +463,7 @@ extern tree c_build_qualified_type PARAMS ((tree, int));
/* Build tree nodes and builtin functions common to both C and C++ language /* Build tree nodes and builtin functions common to both C and C++ language
frontends. */ frontends. */
extern void c_common_nodes_and_builtins PARAMS ((int, int, int)); extern void c_common_nodes_and_builtins PARAMS ((void));
extern tree build_va_arg PARAMS ((tree, tree)); extern tree build_va_arg PARAMS ((tree, tree));
......
...@@ -343,15 +343,6 @@ int flag_short_wchar; ...@@ -343,15 +343,6 @@ int flag_short_wchar;
int flag_no_asm; int flag_no_asm;
/* Nonzero means don't recognize any builtin functions. */
int flag_no_builtin;
/* Nonzero means don't recognize the non-ANSI builtin functions.
-ansi sets this. */
int flag_no_nonansi_builtin;
/* Nonzero means do some things the same way PCC does. */ /* Nonzero means do some things the same way PCC does. */
int flag_traditional; int flag_traditional;
...@@ -3144,7 +3135,7 @@ init_decl_processing () ...@@ -3144,7 +3135,7 @@ init_decl_processing ()
= TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (PTRDIFF_TYPE))); = TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (PTRDIFF_TYPE)));
unsigned_ptrdiff_type_node = unsigned_type (ptrdiff_type_node); unsigned_ptrdiff_type_node = unsigned_type (ptrdiff_type_node);
c_common_nodes_and_builtins (0, flag_no_builtin, flag_no_nonansi_builtin); c_common_nodes_and_builtins ();
endlink = void_list_node; endlink = void_list_node;
ptr_ftype_void = build_function_type (ptr_type_node, endlink); ptr_ftype_void = build_function_type (ptr_type_node, endlink);
......
2000-10-18 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (cp_tree_index): Add CPTI_FAKE_STD.
(fake_std_node): New macro.
* decl.c (in_std): Rename to ...
(in_fake_std): ... this.
(flag_no_builtin): Remove.
(flag_no_nonansi_builtin): Likewise.
(walk_namespaces_r): Use fake_std_node.
(push_namespace): Use std_identifier.
(pop_namespace): Use in_fake_std.
(lookup_name_real): Use fake_std_node.
(init_decl_processing): When -fhonor-std, create the `std'
namespace. Don't create a dummy fake_std_node in that case.
Adjust call to c_common_nodes_and_builtins. Use std_identifier.
(builtin_function): Put builtins whose names don't begin
with `_' in the std namespace.
* decl2.c (flag_no_builtin): Remove.
(flag_no_nonansi_builtin): Likewise.
(set_decl_namespace): Use fake_std_node.
(validate_nonmember_using_decl): Likewise.
(do_using_directive): Likewise.
(handle_class_head): Likewise.
* dump.c (dequeue_and_dump): Likewise.
* except.c (init_exception_processing): Use std_identifier.
* init.c (build_member_call): Use fake_std_node.
* rtti.c (init_rtti_processing): Use std_identifier.
2000-10-17 Mark Mitchell <mark@codesourcery.com> 2000-10-17 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (back_end_hook): Remove declaration. * cp-tree.h (back_end_hook): Remove declaration.
......
...@@ -586,6 +586,7 @@ enum cp_tree_index ...@@ -586,6 +586,7 @@ enum cp_tree_index
CPTI_VTBL_TYPE, CPTI_VTBL_TYPE,
CPTI_VTBL_PTR_TYPE, CPTI_VTBL_PTR_TYPE,
CPTI_STD, CPTI_STD,
CPTI_FAKE_STD,
CPTI_ABI, CPTI_ABI,
CPTI_TYPE_INFO_TYPE, CPTI_TYPE_INFO_TYPE,
CPTI_TINFO_DECL_ID, CPTI_TINFO_DECL_ID,
...@@ -679,7 +680,14 @@ extern tree cp_global_trees[CPTI_MAX]; ...@@ -679,7 +680,14 @@ extern tree cp_global_trees[CPTI_MAX];
#define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE] #define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE]
#define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE] #define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE]
#define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE] #define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE]
/* When the `std' namespace is a real namespace, this is the
corresponding NAMESPACE_DECL. When the `std' namespace is an alias
for the global namespace, this is NULL_TREE. */
#define std_node cp_global_trees[CPTI_STD] #define std_node cp_global_trees[CPTI_STD]
/* When the `std' namespace is a real namespace, this is the
ERROR_MARK_NODE. Otherwise, this is a dummy NAMESPACE_DECL that
should be treated like the global namespace. */
#define fake_std_node cp_global_trees[CPTI_FAKE_STD]
#define abi_node cp_global_trees[CPTI_ABI] #define abi_node cp_global_trees[CPTI_ABI]
#define type_info_type_node cp_global_trees[CPTI_TYPE_INFO_TYPE] #define type_info_type_node cp_global_trees[CPTI_TYPE_INFO_TYPE]
#define tinfo_decl_id cp_global_trees[CPTI_TINFO_DECL_ID] #define tinfo_decl_id cp_global_trees[CPTI_TINFO_DECL_ID]
...@@ -744,7 +752,6 @@ extern tree cp_global_trees[CPTI_MAX]; ...@@ -744,7 +752,6 @@ extern tree cp_global_trees[CPTI_MAX];
#define cp_push_exception_identifier cp_global_trees[CPTI_PUSH_EXCEPTION_IDENTIFIER] #define cp_push_exception_identifier cp_global_trees[CPTI_PUSH_EXCEPTION_IDENTIFIER]
/* The name of the std namespace. */ /* The name of the std namespace. */
#define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER] #define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER]
#define lang_name_c cp_global_trees[CPTI_LANG_NAME_C] #define lang_name_c cp_global_trees[CPTI_LANG_NAME_C]
#define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS] #define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS]
#define lang_name_java cp_global_trees[CPTI_LANG_NAME_JAVA] #define lang_name_java cp_global_trees[CPTI_LANG_NAME_JAVA]
......
...@@ -267,8 +267,10 @@ tree cp_global_trees[CPTI_MAX]; ...@@ -267,8 +267,10 @@ tree cp_global_trees[CPTI_MAX];
static tree global_type_node; static tree global_type_node;
/* Namespace std. */ /* If non-zero, this is the number of times we have entered the `std'
int in_std; namespace when we are treating that namespace as an alias for the
global namespace. */
static int in_fake_std;
/* Expect only namespace names now. */ /* Expect only namespace names now. */
static int only_namespace_names; static int only_namespace_names;
...@@ -354,15 +356,6 @@ int flag_noniso_default_format_attributes = 1; ...@@ -354,15 +356,6 @@ int flag_noniso_default_format_attributes = 1;
extern int flag_short_double; extern int flag_short_double;
/* Nonzero means don't recognize any builtin functions. */
extern int flag_no_builtin;
/* Nonzero means don't recognize the non-ANSI builtin functions.
-ansi sets this. */
extern int flag_no_nonansi_builtin;
/* Nonzero if we want to conserve space in the .o files. We do this /* Nonzero if we want to conserve space in the .o files. We do this
by putting uninitialized data and runtime initialized data into by putting uninitialized data and runtime initialized data into
.common instead of .data at the expense of not flagging multiple .common instead of .data at the expense of not flagging multiple
...@@ -1829,7 +1822,7 @@ walk_namespaces_r (namespace, f, data) ...@@ -1829,7 +1822,7 @@ walk_namespaces_r (namespace, f, data)
if (!DECL_LANG_SPECIFIC (current)) if (!DECL_LANG_SPECIFIC (current))
{ {
/* Hmm. std. */ /* Hmm. std. */
my_friendly_assert (current == std_node, 393); my_friendly_assert (current == fake_std_node, 393);
continue; continue;
} }
...@@ -2324,9 +2317,10 @@ push_namespace (name) ...@@ -2324,9 +2317,10 @@ push_namespace (name)
implicit_use = 1; implicit_use = 1;
} }
else if (current_namespace == global_namespace else if (current_namespace == global_namespace
&& name == DECL_NAME (std_node)) && !flag_honor_std
&& name == std_identifier)
{ {
in_std++; in_fake_std++;
return; return;
} }
else else
...@@ -2376,8 +2370,8 @@ pop_namespace () ...@@ -2376,8 +2370,8 @@ pop_namespace ()
{ {
if (current_namespace == global_namespace) if (current_namespace == global_namespace)
{ {
my_friendly_assert (in_std>0, 980421); my_friendly_assert (in_fake_std > 0, 980421);
in_std--; in_fake_std--;
return; return;
} }
current_namespace = CP_DECL_CONTEXT (current_namespace); current_namespace = CP_DECL_CONTEXT (current_namespace);
...@@ -5888,7 +5882,7 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only) ...@@ -5888,7 +5882,7 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only)
flags |= LOOKUP_TEMPLATES_EXPECTED; flags |= LOOKUP_TEMPLATES_EXPECTED;
/* std:: becomes :: for now. */ /* std:: becomes :: for now. */
if (got_scope == std_node) if (got_scope && got_scope == fake_std_node)
got_scope = void_type_node; got_scope = void_type_node;
if (got_scope) if (got_scope)
...@@ -6364,6 +6358,22 @@ init_decl_processing () ...@@ -6364,6 +6358,22 @@ init_decl_processing ()
NAMESPACE_LEVEL (global_namespace) = global_binding_level; NAMESPACE_LEVEL (global_namespace) = global_binding_level;
declare_namespace_level (); declare_namespace_level ();
/* Create the `std' namespace. */
if (flag_honor_std)
{
push_namespace (std_identifier);
std_node = current_namespace;
pop_namespace ();
fake_std_node = error_mark_node;
}
else
{
fake_std_node = build_decl (NAMESPACE_DECL,
std_identifier,
void_type_node);
pushdecl (fake_std_node);
}
/* Define `int' and `char' first so that dbx will output them first. */ /* Define `int' and `char' first so that dbx will output them first. */
record_builtin_type (RID_INT, NULL_PTR, integer_type_node); record_builtin_type (RID_INT, NULL_PTR, integer_type_node);
record_builtin_type (RID_CHAR, "char", char_type_node); record_builtin_type (RID_CHAR, "char", char_type_node);
...@@ -6519,7 +6529,7 @@ init_decl_processing () ...@@ -6519,7 +6529,7 @@ init_decl_processing ()
= build_pointer_type (build_qualified_type (void_type_node, = build_pointer_type (build_qualified_type (void_type_node,
TYPE_QUAL_CONST)); TYPE_QUAL_CONST));
vtt_parm_type = build_pointer_type (const_ptr_type_node); vtt_parm_type = build_pointer_type (const_ptr_type_node);
c_common_nodes_and_builtins (1, flag_no_builtin, flag_no_nonansi_builtin); c_common_nodes_and_builtins ();
lang_type_promotes_to = convert_type_from_ellipsis; lang_type_promotes_to = convert_type_from_ellipsis;
void_ftype_ptr void_ftype_ptr
...@@ -6615,12 +6625,6 @@ init_decl_processing () ...@@ -6615,12 +6625,6 @@ init_decl_processing ()
layout_type (vtbl_ptr_type_node); layout_type (vtbl_ptr_type_node);
record_builtin_type (RID_MAX, NULL_PTR, vtbl_ptr_type_node); record_builtin_type (RID_MAX, NULL_PTR, vtbl_ptr_type_node);
std_node = build_decl (NAMESPACE_DECL,
flag_honor_std
? get_identifier ("fake std") : std_identifier,
void_type_node);
pushdecl (std_node);
if (flag_new_abi) if (flag_new_abi)
{ {
push_namespace (get_identifier ("__cxxabiv1")); push_namespace (get_identifier ("__cxxabiv1"));
...@@ -6637,7 +6641,7 @@ init_decl_processing () ...@@ -6637,7 +6641,7 @@ init_decl_processing ()
{ {
tree bad_alloc_type_node, newtype, deltype; tree bad_alloc_type_node, newtype, deltype;
if (flag_honor_std) if (flag_honor_std)
push_namespace (get_identifier ("std")); push_namespace (std_identifier);
bad_alloc_type_node = xref_tag bad_alloc_type_node = xref_tag
(class_type_node, get_identifier ("bad_alloc"), 1); (class_type_node, get_identifier ("bad_alloc"), 1);
if (flag_honor_std) if (flag_honor_std)
...@@ -6801,10 +6805,20 @@ builtin_function (name, type, code, class, libname) ...@@ -6801,10 +6805,20 @@ builtin_function (name, type, code, class, libname)
my_friendly_assert (DECL_CONTEXT (decl) == NULL_TREE, 392); my_friendly_assert (DECL_CONTEXT (decl) == NULL_TREE, 392);
/* All builtins that don't begin with an `_' should go in the `std'
namespace. */
if (flag_honor_std && name[0] != '_')
{
push_namespace (std_identifier);
DECL_CONTEXT (decl) = std_node;
}
pushdecl (decl);
if (flag_honor_std && name[0] != '_')
pop_namespace ();
/* Since `pushdecl' relies on DECL_ASSEMBLER_NAME instead of DECL_NAME, /* Since `pushdecl' relies on DECL_ASSEMBLER_NAME instead of DECL_NAME,
we cannot change DECL_ASSEMBLER_NAME until we have installed this we cannot change DECL_ASSEMBLER_NAME until we have installed this
function in the namespace. */ function in the namespace. */
pushdecl (decl);
if (libname) if (libname)
DECL_ASSEMBLER_NAME (decl) = get_identifier (libname); DECL_ASSEMBLER_NAME (decl) = get_identifier (libname);
make_function_rtl (decl); make_function_rtl (decl);
......
...@@ -159,15 +159,6 @@ int flag_no_asm; ...@@ -159,15 +159,6 @@ int flag_no_asm;
int flag_no_gnu_keywords; int flag_no_gnu_keywords;
/* Nonzero means don't recognize the non-ANSI builtin functions. */
int flag_no_builtin;
/* Nonzero means don't recognize the non-ANSI builtin functions.
-ansi sets this. */
int flag_no_nonansi_builtin;
/* Nonzero means do some things the same way PCC does. Only provided so /* Nonzero means do some things the same way PCC does. Only provided so
the compiler will link. */ the compiler will link. */
...@@ -4600,7 +4591,7 @@ set_decl_namespace (decl, scope, friendp) ...@@ -4600,7 +4591,7 @@ set_decl_namespace (decl, scope, friendp)
int friendp; int friendp;
{ {
tree old; tree old;
if (scope == std_node) if (scope == fake_std_node)
scope = global_namespace; scope = global_namespace;
/* Get rid of namespace aliases. */ /* Get rid of namespace aliases. */
scope = ORIGINAL_NAMESPACE (scope); scope = ORIGINAL_NAMESPACE (scope);
...@@ -5107,7 +5098,7 @@ validate_nonmember_using_decl (decl, scope, name) ...@@ -5107,7 +5098,7 @@ validate_nonmember_using_decl (decl, scope, name)
tree *name; tree *name;
{ {
if (TREE_CODE (decl) == SCOPE_REF if (TREE_CODE (decl) == SCOPE_REF
&& TREE_OPERAND (decl, 0) == std_node) && TREE_OPERAND (decl, 0) == fake_std_node)
{ {
if (namespace_bindings_p () if (namespace_bindings_p ()
&& current_namespace == global_namespace) && current_namespace == global_namespace)
...@@ -5353,7 +5344,7 @@ void ...@@ -5353,7 +5344,7 @@ void
do_using_directive (namespace) do_using_directive (namespace)
tree namespace; tree namespace;
{ {
if (namespace == std_node) if (namespace == fake_std_node)
return; return;
/* using namespace A::B::C; */ /* using namespace A::B::C; */
if (TREE_CODE (namespace) == SCOPE_REF) if (TREE_CODE (namespace) == SCOPE_REF)
...@@ -5452,7 +5443,7 @@ handle_class_head (aggr, scope, id) ...@@ -5452,7 +5443,7 @@ handle_class_head (aggr, scope, id)
if (current == NULL_TREE) if (current == NULL_TREE)
current = current_namespace; current = current_namespace;
if (scope == std_node) if (scope == fake_std_node)
scope = global_namespace; scope = global_namespace;
if (scope == NULL_TREE) if (scope == NULL_TREE)
scope = global_namespace; scope = global_namespace;
......
...@@ -606,7 +606,7 @@ dequeue_and_dump (di) ...@@ -606,7 +606,7 @@ dequeue_and_dump (di)
case NAMESPACE_DECL: case NAMESPACE_DECL:
/* The fake `::std' namespace does not have DECL_LANG_SPECIFIC, /* The fake `::std' namespace does not have DECL_LANG_SPECIFIC,
and therefore many other macros do not work on it. */ and therefore many other macros do not work on it. */
if (t == std_node) if (t == fake_std_node)
break; break;
if (DECL_NAMESPACE_ALIAS (t)) if (DECL_NAMESPACE_ALIAS (t))
dump_child ("alis", DECL_NAMESPACE_ALIAS (t)); dump_child ("alis", DECL_NAMESPACE_ALIAS (t));
......
...@@ -143,7 +143,7 @@ init_exception_processing () ...@@ -143,7 +143,7 @@ init_exception_processing ()
tree vtype = build_function_type (void_type_node, void_list_node); tree vtype = build_function_type (void_type_node, void_list_node);
if (flag_honor_std) if (flag_honor_std)
push_namespace (get_identifier ("std")); push_namespace (std_identifier);
terminate_node = build_cp_library_fn_ptr ("terminate", vtype); terminate_node = build_cp_library_fn_ptr ("terminate", vtype);
TREE_THIS_VOLATILE (terminate_node) = 1; TREE_THIS_VOLATILE (terminate_node) = 1;
TREE_NOTHROW (terminate_node) = 1; TREE_NOTHROW (terminate_node) = 1;
......
...@@ -1485,7 +1485,7 @@ build_member_call (type, name, parmlist) ...@@ -1485,7 +1485,7 @@ build_member_call (type, name, parmlist)
if (DECL_P (name)) if (DECL_P (name))
name = DECL_NAME (name); name = DECL_NAME (name);
if (type == std_node) if (type == fake_std_node)
return build_x_function_call (do_scoped_id (name, 0), parmlist, return build_x_function_call (do_scoped_id (name, 0), parmlist,
current_class_ref); current_class_ref);
if (TREE_CODE (type) == NAMESPACE_DECL) if (TREE_CODE (type) == NAMESPACE_DECL)
...@@ -1620,7 +1620,7 @@ build_offset_ref (type, name) ...@@ -1620,7 +1620,7 @@ build_offset_ref (type, name)
if (TREE_CODE (name) == TEMPLATE_DECL) if (TREE_CODE (name) == TEMPLATE_DECL)
return name; return name;
if (type == std_node) if (type == fake_std_node)
return do_scoped_id (name, 0); return do_scoped_id (name, 0);
if (processing_template_decl || uses_template_parms (type)) if (processing_template_decl || uses_template_parms (type))
......
...@@ -80,7 +80,7 @@ void ...@@ -80,7 +80,7 @@ void
init_rtti_processing () init_rtti_processing ()
{ {
if (flag_honor_std) if (flag_honor_std)
push_namespace (get_identifier ("std")); push_namespace (std_identifier);
type_info_type_node = xref_tag type_info_type_node = xref_tag
(class_type_node, get_identifier ("type_info"), 1); (class_type_node, get_identifier ("type_info"), 1);
if (flag_honor_std) if (flag_honor_std)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment