#include "tree-iterator.h"
#include "basic-block.h"
#include "tree-flow.h"
-#include "opts.h"
/* obstack.[ch] explicitly declined to prototype this. */
extern int _obstack_allocated_p (struct obstack *h, void *obj);
DECL_USER_ALIGN (t) = 0;
DECL_IN_SYSTEM_HEADER (t) = in_system_header;
DECL_SOURCE_LOCATION (t) = input_location;
- if (code == TRANSLATION_UNIT_DECL)
- DECL_UID (t) = cur_in_fname;
- else
- DECL_UID (t) = next_decl_uid++;
+ DECL_UID (t) = next_decl_uid++;
/* We have not yet computed the alias set for this declaration. */
DECL_POINTER_ALIAS_SET (t) = -1;
TREE_VISITED (t) = 0;
t->common.ann = 0;
- if (TREE_CODE_CLASS (code) == 'd' && code != TRANSLATION_UNIT_DECL)
+ if (TREE_CODE_CLASS (code) == 'd')
DECL_UID (t) = next_decl_uid++;
else if (TREE_CODE_CLASS (code) == 't')
{
return itype;
}
+/* Builds a signed or unsigned integer type of precision PRECISION.
+ Used for C bitfields whose precision does not match that of
+ built-in target types. */
+tree
+build_nonstandard_integer_type (unsigned HOST_WIDE_INT precision,
+ int unsignedp)
+{
+ tree itype = make_node (INTEGER_TYPE);
+
+ TYPE_PRECISION (itype) = precision;
+
+ if (unsignedp)
+ fixup_unsigned_type (itype);
+ else
+ fixup_signed_type (itype);
+
+ if (host_integerp (TYPE_MAX_VALUE (itype), 1))
+ return type_hash_canon (tree_low_cst (TYPE_MAX_VALUE (itype), 1), itype);
+
+ return itype;
+}
+
/* Create a range of some discrete type TYPE (an INTEGER_TYPE,
ENUMERAL_TYPE, BOOLEAN_TYPE, or CHAR_TYPE), with
low bound LOWVAL and high bound HIGHVAL.
void
build_common_tree_nodes (int signed_char)
{
- /* This function is called after command line parsing is complete,
- but before any DECL nodes should have been created. Therefore,
- now is the appropriate time to adjust next_decl_uid so that the
- range 0 .. num_in_fnames-1 is reserved for TRANSLATION_UNIT_DECLs. */
- if (next_decl_uid)
- abort ();
- next_decl_uid = num_in_fnames;
-
error_mark_node = make_node (ERROR_MARK);
TREE_TYPE (error_mark_node) = error_mark_node;