diff options
author | Joseph Myers <jsm28@cam.ac.uk> | 2000-12-01 22:25:43 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2000-12-01 22:25:43 +0000 |
commit | 5fd8e53691af618b8ff21f8abdaefbb234ab8dc6 (patch) | |
tree | 129bd88e5e40aaabb1457a5c0c01dbdb748db7d1 /gcc/c-common.c | |
parent | 239b8e589de7bd00ecfaba044dfed56f123278fb (diff) | |
download | gcc-5fd8e53691af618b8ff21f8abdaefbb234ab8dc6.zip gcc-5fd8e53691af618b8ff21f8abdaefbb234ab8dc6.tar.gz gcc-5fd8e53691af618b8ff21f8abdaefbb234ab8dc6.tar.bz2 |
c-common.c: Include "defaults.h".
* 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
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index cb6b78f..0a605f8 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -30,6 +30,7 @@ Boston, MA 02111-1307, USA. */ #include "ggc.h" #include "expr.h" #include "c-common.h" +#include "defaults.h" #include "tm_p.h" #include "intl.h" #include "diagnostic.h" @@ -40,6 +41,26 @@ cpp_reader parse_in; #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. @@ -4899,6 +4920,23 @@ c_common_nodes_and_builtins () 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)); |