* c-common.c: Include "defaults.h".
(WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Define.
(c_common_nodes_and_builtins): Create string_type_node,
const_string_type_node, wint_type_node, intmax_type_node,
uintmax_type_node, default_function_type, ptrdiff_type_node and
unsigned_ptrdiff_type_node.
* c-common.h (identifier_global_value): Declare.
* c-decl.c (WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Don't define.
(init_decl_processing): Don't create string_type_node,
const_string_type_node, wint_type_node, intmax_type_node,
uintmax_type_node, default_function_type, ptrdiff_type_node and
unsigned_ptrdiff_type_node.
(identifier_global_value): New function.
cp:
* decl.c (WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Don't define.
(init_decl_processing): Don't create string_type_node,
const_string_type_node, wint_type_node, intmax_type_node,
uintmax_type_node, default_function_type, ptrdiff_type_node and
unsigned_ptrdiff_type_node. Adjust position of call to
c_common_nodes_and_builtins.
(identifier_global_value): New function.
From-SVN: r37931
+2000-12-01 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-common.c: Include "defaults.h".
+ (WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Define.
+ (c_common_nodes_and_builtins): Create string_type_node,
+ const_string_type_node, wint_type_node, intmax_type_node,
+ uintmax_type_node, default_function_type, ptrdiff_type_node and
+ unsigned_ptrdiff_type_node.
+ * c-common.h (identifier_global_value): Declare.
+ * c-decl.c (WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Don't define.
+ (init_decl_processing): Don't create string_type_node,
+ const_string_type_node, wint_type_node, intmax_type_node,
+ uintmax_type_node, default_function_type, ptrdiff_type_node and
+ unsigned_ptrdiff_type_node.
+ (identifier_global_value): New function.
+
2000-12-01 Neil Booth <neilb@earthling.net>
* cppinit.c (initialize): Forgotten prototype.
#include "ggc.h"
#include "expr.h"
#include "c-common.h"
+#include "defaults.h"
#include "tm_p.h"
#include "intl.h"
#include "diagnostic.h"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE TYPE_PRECISION (wchar_type_node)
+#ifndef WINT_TYPE
+#define WINT_TYPE "unsigned int"
+#endif
+
+#ifndef INTMAX_TYPE
+#define INTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
+ ? "int" \
+ : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
+ ? "long int" \
+ : "long long int"))
+#endif
+
+#ifndef UINTMAX_TYPE
+#define UINTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
+ ? "unsigned int" \
+ : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
+ ? "long unsigned int" \
+ : "long long unsigned int"))
+#endif
+
/* The following symbols are subsumed in the c_global_trees array, and
listed here individually for documentation purposes.
tree va_list_ref_type_node;
tree va_list_arg_type_node;
+ string_type_node = build_pointer_type (char_type_node);
+ const_string_type_node
+ = build_pointer_type (build_type_variant (char_type_node, 1, 0));
+
+ wint_type_node =
+ TREE_TYPE (identifier_global_value (get_identifier (WINT_TYPE)));
+
+ intmax_type_node =
+ TREE_TYPE (identifier_global_value (get_identifier (INTMAX_TYPE)));
+ uintmax_type_node =
+ TREE_TYPE (identifier_global_value (get_identifier (UINTMAX_TYPE)));
+
+ default_function_type = build_function_type (integer_type_node, NULL_TREE);
+ ptrdiff_type_node
+ = TREE_TYPE (identifier_global_value (get_identifier (PTRDIFF_TYPE)));
+ unsigned_ptrdiff_type_node = unsigned_type (ptrdiff_type_node);
+
pushdecl (build_decl (TYPE_DECL, get_identifier ("__builtin_va_list"),
va_list_type_node));
extern tree (*make_fname_decl) PARAMS ((tree, const char *, int));
+extern tree identifier_global_value PARAMS ((tree));
+
extern void declare_function_name PARAMS ((void));
extern void decl_attributes PARAMS ((tree, tree, tree));
extern void init_function_format_info PARAMS ((void));
#define WCHAR_TYPE "int"
#endif
-#ifndef WINT_TYPE
-#define WINT_TYPE "unsigned int"
-#endif
-
-#ifndef INTMAX_TYPE
-#define INTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
- ? "int" \
- : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
- ? "long int" \
- : "long long int"))
-#endif
-
-#ifndef UINTMAX_TYPE
-#define UINTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
- ? "unsigned int" \
- : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
- ? "long unsigned int" \
- : "long long unsigned int"))
-#endif
\f
/* Nonzero if we have seen an invalid cross reference
to a struct, union, or enum, but not yet printed the message. */
signed_wchar_type_node = signed_type (wchar_type_node);
unsigned_wchar_type_node = unsigned_type (wchar_type_node);
- wint_type_node =
- TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (WINT_TYPE)));
-
- intmax_type_node =
- TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (INTMAX_TYPE)));
- uintmax_type_node =
- TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (UINTMAX_TYPE)));
-
boolean_type_node = integer_type_node;
boolean_true_node = integer_one_node;
boolean_false_node = integer_zero_node;
c_bool_true_node = build_int_2 (1, 0);
TREE_TYPE (c_bool_true_node) = c_bool_type_node;
- string_type_node = build_pointer_type (char_type_node);
- const_string_type_node
- = build_pointer_type (build_type_variant (char_type_node, 1, 0));
-
/* Make a type to be the domain of a few array types
whose domains don't really matter.
200 is small enough that it always fits in size_t
void_list_node = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
- default_function_type = build_function_type (integer_type_node, NULL_TREE);
- ptrdiff_type_node
- = TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (PTRDIFF_TYPE)));
- unsigned_ptrdiff_type_node = unsigned_type (ptrdiff_type_node);
-
c_common_nodes_and_builtins ();
endlink = void_list_node;
&& DECL_SAVED_TREE (decl))
c_expand_body (decl, /*nested_p=*/1);
}
+
+/* Return the IDENTIFIER_GLOBAL_VALUE of T, for use in common code, since
+ the definition of IDENTIFIER_GLOBAL_VALUE is different for C and C++. */
+
+tree
+identifier_global_value (t)
+ tree t;
+{
+ return IDENTIFIER_GLOBAL_VALUE (t);
+}
+2000-12-01 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * decl.c (WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Don't define.
+ (init_decl_processing): Don't create string_type_node,
+ const_string_type_node, wint_type_node, intmax_type_node,
+ uintmax_type_node, default_function_type, ptrdiff_type_node and
+ unsigned_ptrdiff_type_node. Adjust position of call to
+ c_common_nodes_and_builtins.
+ (identifier_global_value): New function.
+
2000-12-01 Nathan Sidwell <nathan@codesourcery.com>
* call.c (standard_conversion): Reject pointer to member
#define WCHAR_TYPE "int"
#endif
-#ifndef WINT_TYPE
-#define WINT_TYPE "unsigned int"
-#endif
-
-#ifndef INTMAX_TYPE
-#define INTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
- ? "int" \
- : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
- ? "long int" \
- : "long long int"))
-#endif
-
-#ifndef UINTMAX_TYPE
-#define UINTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
- ? "unsigned int" \
- : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
- ? "long unsigned int" \
- : "long long unsigned int"))
-#endif
-
static tree grokparms PARAMS ((tree));
static const char *redeclaration_error_message PARAMS ((tree, tree));
record_builtin_type (RID_MAX, "unsigned short",
short_unsigned_type_node);
- ptrdiff_type_node
- = TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (PTRDIFF_TYPE)));
- unsigned_ptrdiff_type_node = unsigned_type (ptrdiff_type_node);
-
/* Define both `signed char' and `unsigned char'. */
record_builtin_type (RID_MAX, "signed char", signed_char_type_node);
record_builtin_type (RID_MAX, "unsigned char", unsigned_char_type_node);
void_list_node = build_tree_list (NULL_TREE, void_type_node);
TREE_PARMLIST (void_list_node) = 1;
- string_type_node = build_pointer_type (char_type_node);
- const_string_type_node
- = build_pointer_type (build_qualified_type (char_type_node,
- TYPE_QUAL_CONST));
empty_except_spec = build_tree_list (NULL_TREE, NULL_TREE);
-#if 0
- record_builtin_type (RID_MAX, NULL_PTR, string_type_node);
-#endif
-
/* Make a type to be the domain of a few array types
whose domains don't really matter.
200 is small enough that it always fits in size_t. */
int_array_type_node
= build_array_type (integer_type_node, array_domain_type);
+ c_common_nodes_and_builtins ();
+
+#if 0
+ record_builtin_type (RID_MAX, NULL_PTR, string_type_node);
+#endif
+
if (flag_new_abi)
delta_type_node = ptrdiff_type_node;
else if (flag_huge_objects)
else
vtable_index_type = delta_type_node;
- default_function_type
- = build_function_type (integer_type_node, NULL_TREE);
-
- ptr_type_node = build_pointer_type (void_type_node);
- const_ptr_type_node
- = build_pointer_type (build_qualified_type (void_type_node,
- TYPE_QUAL_CONST));
vtt_parm_type = build_pointer_type (const_ptr_type_node);
- c_common_nodes_and_builtins ();
lang_type_promotes_to = convert_type_from_ellipsis;
void_ftype_ptr
wchar_array_type_node
= build_array_type (wchar_type_node, array_domain_type);
- wint_type_node =
- TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (WINT_TYPE)));
-
- intmax_type_node =
- TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (INTMAX_TYPE)));
- uintmax_type_node =
- TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (UINTMAX_TYPE)));
-
if (flag_vtable_thunks)
{
/* Make sure we get a unique function type, so we can give
ggc_mark_tree ((tree) lt);
}
}
+
+/* Return the IDENTIFIER_GLOBAL_VALUE of T, for use in common code, since
+ the definition of IDENTIFIER_GLOBAL_VALUE is different for C and C++. */
+
+tree
+identifier_global_value (t)
+ tree t;
+{
+ return IDENTIFIER_GLOBAL_VALUE (t);
+}