diff options
author | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-19 02:48:48 +0000 |
---|---|---|
committer | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-19 02:48:48 +0000 |
commit | 6dc50383e4de2ec2611fed610700f2e9de917555 (patch) | |
tree | f2dab2e9a051a54be5232b46ee4f1452e6db714b | |
parent | df8eb49017050558f1a9dfdff06561824ac545ff (diff) | |
download | gcc-6dc50383e4de2ec2611fed610700f2e9de917555.tar.gz |
remove more useless typedefs
gcc/c-family/ChangeLog:
2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
* c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h,
c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless
typedefs.
gcc/c/ChangeLog:
2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
* c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs.
gcc/cp/ChangeLog:
2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
* call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c,
method.c, name-lookup.h, parser.c, parser.h, rtti.c,
semantics.c, typeck2.c: Remove useless typedefs.
gcc/fortran/ChangeLog:
2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
* dependency.c, dependency.h, gfortran.h, io.c, module.c,
parse.h, resolve.c, trans-types.h, trans.h: remove useless
typedefs.
gcc/lto/ChangeLog:
2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
* lto.h: Remove useless typedefs.
gcc/objc/ChangeLog:
2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
* objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h:
Remove useless typedefs.
gcc/ChangeLog:
2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
* bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c,
dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h,
mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c,
signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c,
tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c,
tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c,
tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c,
tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless
typedefs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227001 138bc75d-0d04-0410-961f-82ee72b054a4
79 files changed, 420 insertions, 450 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index db23a0f07d4..32421c5dd30 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> + + * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, + dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, + mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, + signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, + tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, + tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, + tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, + tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, + tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless + 2015-08-18 trevor Saunders <tbsaunde@tbsaunde.org> * bt-load.c, cgraph.h, dwarf2out.c, dwarf2out.h, final.c, diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index e443d59dacc..2110bd2e0d8 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -142,7 +142,7 @@ typedef fibonacci_heap <long, basic_block_def> bb_heap_t; typedef fibonacci_node <long, basic_block_def> bb_heap_node_t; /* Structure to hold needed information for each basic block. */ -typedef struct bbro_basic_block_data_def +struct bbro_basic_block_data { /* Which trace is the bb start of (-1 means it is not a start of any). */ int start_of_trace; @@ -161,7 +161,7 @@ typedef struct bbro_basic_block_data_def /* Which heap node is BB in (if any)? */ bb_heap_node_t *node; -} bbro_basic_block_data; +}; /* The current size of the following dynamic array. */ static int array_size; diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 7a25c399e22..eb717a03878 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> + + * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, + c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless + 2015-08-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR middle-end/36757 diff --git a/gcc/c-family/c-ada-spec.h b/gcc/c-family/c-ada-spec.h index 08d268573c7..8eed0e27b17 100644 --- a/gcc/c-family/c-ada-spec.h +++ b/gcc/c-family/c-ada-spec.h @@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see /* In c-ada-spec.c */ -typedef enum { +enum cpp_operation { HAS_DEPENDENT_TEMPLATE_ARGS, IS_ABSTRACT, IS_CONSTRUCTOR, @@ -33,7 +33,7 @@ typedef enum { IS_MOVE_CONSTRUCTOR, IS_TEMPLATE, IS_TRIVIAL -} cpp_operation; +}; extern location_t decl_sloc (const_tree, bool); extern void collect_ada_nodes (tree, const char *); diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index f081dadd6b6..ff502e56dbb 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -6311,11 +6311,11 @@ build_va_arg (location_t loc, tree expr, tree type) /* Linked list of disabled built-in functions. */ -typedef struct disabled_builtin +struct disabled_builtin { const char *name; struct disabled_builtin *next; -} disabled_builtin; +}; static disabled_builtin *disabled_builtins = NULL; static bool builtin_function_disabled_p (const char *); diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index d1f6cba20e3..be63cd203d5 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -474,14 +474,13 @@ struct GTY(()) sorted_fields_type { These may be shadowed, and may be referenced from nested functions. */ #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label) -typedef enum c_language_kind +enum c_language_kind { clk_c = 0, /* C90, C94, C99 or C11 */ clk_objc = 1, /* clk_c with ObjC features. */ clk_cxx = 2, /* ANSI/ISO C++ */ clk_objcxx = 3 /* clk_cxx with ObjC features. */ -} -c_language_kind; +}; /* To test for a specific language use c_language, defined by each front end. For "ObjC features" or "not C++" use the macros. */ @@ -491,7 +490,7 @@ extern c_language_kind c_language; #define c_dialect_objc() ((c_language & clk_objc) != 0) /* The various name of operator that appears in error messages. */ -typedef enum ref_operator { +enum ref_operator { /* NULL */ RO_NULL, /* array indexing */ @@ -504,7 +503,7 @@ typedef enum ref_operator { RO_IMPLICIT_CONVERSION, /* ->* */ RO_ARROW_STAR -} ref_operator; +}; /* Information about a statement tree. */ diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index 4bc31476d5a..2940f92d7d8 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -46,12 +46,12 @@ enum format_type { printf_format_type, asm_fprintf_format_type, gcc_objc_string_format_type, format_type_error = -1}; -typedef struct function_format_info +struct function_format_info { int format_type; /* type of format (printf, scanf, etc.) */ unsigned HOST_WIDE_INT format_num; /* number of format argument */ unsigned HOST_WIDE_INT first_arg_num; /* number of first arg (zero for varargs) */ -} function_format_info; +}; static bool decode_format_attr (tree, function_format_info *, int); static int decode_format_type (const char *); @@ -425,7 +425,7 @@ static const char *kind_descriptions[] = { /* Structure describing details of a type expected in format checking, and the type to check against it. */ -typedef struct format_wanted_type +struct format_wanted_type { /* The type wanted. */ tree wanted_type; @@ -460,7 +460,7 @@ typedef struct format_wanted_type unsigned int offset_loc; /* The next type to check for this format conversion, or NULL if none. */ struct format_wanted_type *next; -} format_wanted_type; +}; /* Convenience macro for format_length_info meaning unused. */ #define NO_FMT NULL, FMT_LEN_none, STD_C89 @@ -965,7 +965,7 @@ static int n_format_types = ARRAY_SIZE (format_types_orig); /* Structure detailing the results of checking a format function call where the format expression may be a conditional expression with many leaves resulting from nested conditional expressions. */ -typedef struct +struct format_check_results { /* Number of leaves of the format argument that could not be checked as they were not string literals. */ @@ -990,14 +990,14 @@ typedef struct int number_other; /* Location of the format string. */ location_t format_string_loc; -} format_check_results; +}; -typedef struct +struct format_check_context { format_check_results *res; function_format_info *info; tree params; -} format_check_context; +}; /* Return the format name (as specified in the original table) for the format type indicated by format_num. */ diff --git a/gcc/c-family/c-format.h b/gcc/c-family/c-format.h index 956b23cba3f..c458791359a 100644 --- a/gcc/c-family/c-format.h +++ b/gcc/c-family/c-format.h @@ -84,7 +84,7 @@ enum /* Structure describing a length modifier supported in format checking, and possibly a doubled version such as "hh". */ -typedef struct +struct format_length_info { /* Name of the single-character length modifier. If prefixed by a zero character, it describes a multi character length @@ -102,12 +102,12 @@ typedef struct /* If this flag is set, just scalar width identity is checked, and not the type identity itself. */ int scalar_identity_flag; -} format_length_info; +}; /* Structure describing the combination of a conversion specifier (or a set of specifiers which act identically) and a length modifier. */ -typedef struct +struct format_type_detail { /* The standard version this combination of length and type appeared in. This is only relevant if greater than those for length and type @@ -118,7 +118,7 @@ typedef struct const char *name; /* The type itself. */ tree *type; -} format_type_detail; +}; /* Macros to fill out tables of these. */ @@ -129,7 +129,7 @@ typedef struct /* Structure describing a format conversion specifier (or a set of specifiers which act identically), and the length modifiers used with it. */ -typedef struct format_char_info +struct format_char_info { const char *format_chars; int pointer_count; @@ -158,11 +158,11 @@ typedef struct format_char_info arguments, only POINTER_COUNT, TYPES, and the "c", "R", and "W" flags in FLAGS2 are used. */ const struct format_char_info *chain; -} format_char_info; +}; /* Structure describing a flag accepted by some kind of format. */ -typedef struct +struct format_flag_spec { /* The flag character in question (0 for end of array). */ int flag_char; @@ -186,12 +186,12 @@ typedef struct const char *long_name; /* The standard version in which it appeared. */ enum format_std_version std; -} format_flag_spec; +}; /* Structure describing a combination of flags that is bad for some kind of format. */ -typedef struct +struct format_flag_pair { /* The first flag character in question (0 for end of array). */ int flag_char1; @@ -204,11 +204,11 @@ typedef struct a nonzero character from flags2 if it only applies in some circumstances (e.g. 'i' for printf formats ignoring 0 with precision). */ int predicate; -} format_flag_pair; +}; /* Structure describing a particular kind of format processed by GCC. */ -typedef struct +struct format_kind_info { /* The name of this kind of format, for use in diagnostics. Also the name of the attribute (without preceding and following __). */ @@ -251,7 +251,7 @@ typedef struct /* Pointer to type of argument expected if '*' is used for a precision, or NULL if '*' not used for precisions. */ tree *precision_type; -} format_kind_info; +}; #define T_I &integer_type_node #define T89_I { STD_C89, NULL, T_I } @@ -317,12 +317,12 @@ typedef struct interpreted as "gnu_printf" or "ms_printf" on a particular system. TARGET_OVERRIDES_FORMAT_ATTRIBUTES is used to specify target-specific defaults. */ -typedef struct +struct target_ovr_attr { /* The name of the to be copied format attribute. */ const char *named_attr_src; /* The name of the to be overridden format attribute. */ const char *named_attr_dst; -} target_ovr_attr; +}; #endif /* GCC_C_FORMAT_H */ diff --git a/gcc/c-family/c-objc.h b/gcc/c-family/c-objc.h index 656b6dee305..e9ec8f894a8 100644 --- a/gcc/c-family/c-objc.h +++ b/gcc/c-family/c-objc.h @@ -21,12 +21,12 @@ along with GCC; see the file COPYING3. If not see #define GCC_C_COMMON_OBJC_H /* ObjC ivar visibility types. */ -typedef enum objc_ivar_visibility_kind { +enum GTY(()) objc_ivar_visibility_kind { OBJC_IVAR_VIS_PROTECTED = 0, OBJC_IVAR_VIS_PUBLIC = 1, OBJC_IVAR_VIS_PRIVATE = 2, OBJC_IVAR_VIS_PACKAGE = 3 -} objc_ivar_visibility_kind; +}; /* Objective-C / Objective-C++ entry points. */ diff --git a/gcc/c-family/c-ppoutput.c b/gcc/c-family/c-ppoutput.c index 83ad4618b69..085555459eb 100644 --- a/gcc/c-family/c-ppoutput.c +++ b/gcc/c-family/c-ppoutput.c @@ -44,13 +44,13 @@ static struct /* Defined and undefined macros being queued for output with -dU at the next newline. */ -typedef struct macro_queue +struct macro_queue { struct macro_queue *next; /* Next macro in the list. */ char *macro; /* The name of the macro if not defined, the full definition if defined. */ -} macro_queue; +}; static macro_queue *define_queue, *undef_queue; /* General output routines. */ diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c index b85e7687b17..5fb1fc270eb 100644 --- a/gcc/c-family/c-pragma.c +++ b/gcc/c-family/c-pragma.c @@ -48,11 +48,11 @@ along with GCC; see the file COPYING3. If not see #define GCC_BAD2(gmsgid, arg) \ do { warning (OPT_Wpragmas, gmsgid, arg); return; } while (0) -typedef struct GTY(()) align_stack { +struct GTY(()) align_stack { int alignment; tree id; struct align_stack * prev; -} align_stack; +}; static GTY(()) struct align_stack * alignment_stack; @@ -236,11 +236,11 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) } } -typedef struct GTY(()) pending_weak_d +struct GTY(()) pending_weak { tree name; tree value; -} pending_weak; +}; static GTY(()) vec<pending_weak, va_gc> *pending_weaks; @@ -426,10 +426,10 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy)) if it appears afterward, we have no way of knowing whether a modified DECL_ASSEMBLER_NAME is due to #pragma extern_prefix.) */ -typedef struct GTY(()) pending_redefinition_d { +struct GTY(()) pending_redefinition { tree oldname; tree newname; -} pending_redefinition; +}; static GTY(()) vec<pending_redefinition, va_gc> *pending_redefine_extname; @@ -894,13 +894,13 @@ handle_pragma_optimize (cpp_reader *ARG_UNUSED(dummy)) /* Stack of the #pragma GCC options created with #pragma GCC push_option. Save both the binary representation of the options and the TREE_LIST of strings that will be added to the function's attribute list. */ -typedef struct GTY(()) opt_stack { +struct GTY(()) opt_stack { struct opt_stack *prev; tree target_binary; tree target_strings; tree optimize_binary; tree optimize_strings; -} opt_stack; +}; static GTY(()) struct opt_stack * options_stack; @@ -1165,11 +1165,11 @@ handle_pragma_float_const_decimal64 (cpp_reader *ARG_UNUSED (dummy)) static vec<internal_pragma_handler> registered_pragmas; -typedef struct +struct pragma_ns_name { const char *space; const char *name; -} pragma_ns_name; +}; static vec<pragma_ns_name> registered_pp_pragmas; diff --git a/gcc/c-family/c-pragma.h b/gcc/c-family/c-pragma.h index eff94c11483..aa2b4717572 100644 --- a/gcc/c-family/c-pragma.h +++ b/gcc/c-family/c-pragma.h @@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see /* Pragma identifiers built in to the front end parsers. Identifiers for ancillary handlers will follow these. */ -typedef enum pragma_kind { +enum pragma_kind { PRAGMA_NONE = 0, PRAGMA_OACC_CACHE, @@ -71,12 +71,12 @@ typedef enum pragma_kind { PRAGMA_IVDEP, PRAGMA_FIRST_EXTERNAL -} pragma_kind; +}; /* All clauses defined by OpenACC 2.0, and OpenMP 2.5, 3.0, 3.1, and 4.0. Used internally by both C and C++ parsers. */ -typedef enum pragma_omp_clause { +enum pragma_omp_clause { PRAGMA_OMP_CLAUSE_NONE = 0, PRAGMA_OMP_CLAUSE_ALIGNED, @@ -159,7 +159,7 @@ typedef enum pragma_omp_clause { PRAGMA_OACC_CLAUSE_IF = PRAGMA_OMP_CLAUSE_IF, PRAGMA_OACC_CLAUSE_PRIVATE = PRAGMA_OMP_CLAUSE_PRIVATE, PRAGMA_OACC_CLAUSE_REDUCTION = PRAGMA_OMP_CLAUSE_REDUCTION -} pragma_omp_clause; +}; extern struct cpp_reader* parse_in; @@ -183,7 +183,7 @@ union gen_pragma_handler { pragma_handler_2arg handler_2arg; }; /* Internally used to keep the data of the handler. */ -struct internal_pragma_handler_d { +struct internal_pragma_handler { union gen_pragma_handler handler; /* Permits to know if handler is a pragma_handler_1arg (extra_data is false) or a pragma_handler_2arg (extra_data is true). */ @@ -191,7 +191,6 @@ struct internal_pragma_handler_d { /* A data field which can be used when extra_data is true. */ void * data; }; -typedef struct internal_pragma_handler_d internal_pragma_handler; extern void c_register_pragma (const char *space, const char *name, pragma_handler_1arg handler); diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 275d7879fd6..1536b1bb872 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,7 @@ +2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> + + * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. + 2015-08-12 Marek Polacek <polacek@redhat.com> * c-decl.c (grokdeclarator): Call error_at instead of error and pass diff --git a/gcc/c/c-aux-info.c b/gcc/c/c-aux-info.c index 510f54139e1..d983e2ccf43 100644 --- a/gcc/c/c-aux-info.c +++ b/gcc/c/c-aux-info.c @@ -29,12 +29,11 @@ along with GCC; see the file COPYING3. If not see #include "alias.h" #include "c-tree.h" -enum formals_style_enum { +enum formals_style { ansi, k_and_r_names, k_and_r_decls }; -typedef enum formals_style_enum formals_style; static const char *data_type; diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 30b4302b09e..1a587986427 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -141,7 +141,7 @@ c_parse_init (void) lexer code, if desired. */ /* More information about the type of a CPP_NAME token. */ -typedef enum c_id_kind { +enum c_id_kind { /* An ordinary identifier. */ C_ID_ID, /* An identifier declared as a typedef name. */ @@ -152,11 +152,11 @@ typedef enum c_id_kind { C_ID_ADDRSPACE, /* Not an identifier. */ C_ID_NONE -} c_id_kind; +}; /* A single C token after string literal concatenation and conversion of preprocessing tokens to tokens. */ -typedef struct GTY (()) c_token { +struct GTY (()) c_token { /* The kind of token. */ ENUM_BITFIELD (cpp_ttype) type : 8; /* If this token is a CPP_NAME, this value indicates whether also @@ -172,12 +172,12 @@ typedef struct GTY (()) c_token { location_t location; /* The value associated with this token, if any. */ tree value; -} c_token; +}; /* A parser structure recording information about the state and context of parsing. Includes lexer information with up to two tokens of look-ahead; more are not needed for C. */ -typedef struct GTY(()) c_parser { +struct GTY(()) c_parser { /* The look-ahead tokens. */ c_token * GTY((skip)) tokens; /* Buffer for look-ahead tokens. */ @@ -224,7 +224,7 @@ typedef struct GTY(()) c_parser { /* Buffer to hold all the tokens from parsing the vector attribute for the SIMD-enabled functions (formerly known as elemental functions). */ vec <c_token, va_gc> *cilk_simd_fn_tokens; -} c_parser; +}; /* The actual parser and external interface. ??? Does this need to be @@ -1127,7 +1127,7 @@ restore_extension_diagnostics (int flags) } /* Possibly kinds of declarator to parse. */ -typedef enum c_dtr_syn { +enum c_dtr_syn { /* A normal declarator with an identifier. */ C_DTR_NORMAL, /* An abstract declarator (maybe empty). */ @@ -1143,7 +1143,7 @@ typedef enum c_dtr_syn { the same applies with attributes inside the parentheses before "T". */ C_DTR_PARM -} c_dtr_syn; +}; /* The binary operation precedence levels, where 0 is a dummy lowest level used for the bottom of the stack. */ diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h index 28b58c636e4..a3979dd9f37 100644 --- a/gcc/c/c-tree.h +++ b/gcc/c/c-tree.h @@ -355,12 +355,12 @@ enum c_declarator_kind { cdk_attrs }; -typedef struct c_arg_tag_d { +struct c_arg_tag { /* The argument name. */ tree id; /* The type of the argument. */ tree type; -} c_arg_tag; +}; /* Information about the parameters in a function declarator. */ diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index 96ce90d60f5..dd610d8b3dc 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -275,7 +275,7 @@ extern bool flow_loop_nested_p (const struct loop *, const struct loop *); extern bool flow_bb_inside_loop_p (const struct loop *, const_basic_block); extern struct loop * find_common_loop (struct loop *, struct loop *); struct loop *superloop_at_depth (struct loop *, unsigned); -struct eni_weights_d; +struct eni_weights; extern int num_loop_insns (const struct loop *); extern int average_num_loop_insns (const struct loop *); extern unsigned get_loop_level (const struct loop *); diff --git a/gcc/collect2.c b/gcc/collect2.c index b53e15189df..5a7e8747075 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -282,7 +282,7 @@ static struct lto_object_list lto_objects; /* Special kinds of symbols that a name may denote. */ -typedef enum { +enum symkind { SYM_REGULAR = 0, /* nothing special */ SYM_CTOR = 1, /* constructor */ @@ -292,7 +292,7 @@ typedef enum { SYM_DWEH = 5, /* DWARF exception handling table */ SYM_AIXI = 6, SYM_AIXD = 7 -} symkind; +}; const char tool_name[] = "collect2"; @@ -333,13 +333,13 @@ static void process_args (int *argcp, char **argv); /* Enumerations describing which pass this is for scanning the program file ... */ -typedef enum { +enum scanpass { PASS_FIRST, /* without constructors */ PASS_OBJ, /* individual objects */ PASS_LIB, /* looking for shared libraries */ PASS_SECOND, /* with constructors linked in */ PASS_LTOINFO /* looking for objects with LTO info */ -} scanpass; +}; /* ... and which kinds of symbols are to be considered. */ diff --git a/gcc/combine.c b/gcc/combine.c index 8f98cbb6bdf..fd3e19c1f40 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -154,7 +154,7 @@ static rtx i2mod_old_rhs; static rtx i2mod_new_rhs; -typedef struct reg_stat_struct { +struct reg_stat_type { /* Record last point of death of (hard or pseudo) register n. */ rtx_insn *last_death; @@ -261,7 +261,7 @@ typedef struct reg_stat_struct { value. */ ENUM_BITFIELD(machine_mode) truncated_to_mode : 8; -} reg_stat_type; +}; static vec<reg_stat_type> reg_stat; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2c2cb6d5535..e313e641061 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> + + * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, + method.c, name-lookup.h, parser.c, parser.h, rtti.c, + semantics.c, typeck2.c: Remove useless typedefs. + 2015-08-18 Jason Merrill <jason@redhat.com> DR 1155 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 909ac990189..8d4a9e23a0a 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see /* The various kinds of conversion. */ -typedef enum conversion_kind { +enum conversion_kind { ck_identity, ck_lvalue, ck_qual, @@ -62,12 +62,12 @@ typedef enum conversion_kind { ck_list, ck_aggr, ck_rvalue -} conversion_kind; +}; /* The rank of the conversion. Order of the enumerals matters; better conversions should come earlier in the list. */ -typedef enum conversion_rank { +enum conversion_rank { cr_identity, cr_exact, cr_promotion, @@ -76,13 +76,12 @@ typedef enum conversion_rank { cr_user, cr_ellipsis, cr_bad -} conversion_rank; +}; /* An implicit conversion sequence, in the sense of [over.best.ics]. The first conversion to be performed is at the end of the chain. That conversion is always a cr_identity conversion. */ -typedef struct conversion conversion; struct conversion { /* The kind of conversion represented by this step. */ conversion_kind kind; @@ -407,9 +406,8 @@ build_call_a (tree function, int n, tree *argarray) /* New overloading code. */ -typedef struct z_candidate z_candidate; +struct z_candidate; -typedef struct candidate_warning candidate_warning; struct candidate_warning { z_candidate *loser; candidate_warning *next; diff --git a/gcc/cp/class.c b/gcc/cp/class.c index bf7b5c4bab6..f8ba795ddcb 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -71,7 +71,7 @@ typedef struct class_stack_node { size_t hidden; }* class_stack_node_t; -typedef struct vtbl_init_data_s +struct vtbl_init_data { /* The base for which we're building initializers. */ tree binfo; @@ -100,7 +100,7 @@ typedef struct vtbl_init_data_s /* True when adding vcall offset entries to the vtable. False when merely computing the indices. */ bool generate_vcall_entries; -} vtbl_init_data; +}; /* The type of a function passed to walk_subobject_offsets. */ typedef int (*subobject_offset_fn) (tree, tree, splay_tree); @@ -2377,7 +2377,7 @@ base_derived_from (tree derived, tree base) return false; } -typedef struct find_final_overrider_data_s { +struct find_final_overrider_data { /* The function for which we are trying to find a final overrider. */ tree fn; /* The base class in which the function was declared. */ @@ -2386,7 +2386,7 @@ typedef struct find_final_overrider_data_s { tree candidates; /* Path to most derived. */ vec<tree> path; -} find_final_overrider_data; +}; /* Add the overrider along the current path to FFOD->CANDIDATES. Returns true if an overrider was found; false otherwise. */ @@ -8556,7 +8556,7 @@ binfo_ctor_vtable (tree binfo) } /* Data for secondary VTT initialization. */ -typedef struct secondary_vptr_vtt_init_data_s +struct secondary_vptr_vtt_init_data { /* Is this the primary VTT? */ bool top_level_p; @@ -8569,7 +8569,7 @@ typedef struct secondary_vptr_vtt_init_data_s /* The type being constructed by this secondary VTT. */ tree type_being_constructed; -} secondary_vptr_vtt_init_data; +}; /* Recursively build the VTT-initializer for BINFO (which is in the hierarchy dominated by T). INITS points to the end of the initializer diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index ab6b3ec6206..7cf5278f04a 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -283,14 +283,13 @@ identifier_p (tree t) #define LANG_IDENTIFIER_CAST(NODE) \ ((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE)) -struct GTY(()) template_parm_index_s { +struct GTY(()) template_parm_index { struct tree_common common; int index; int level; int orig_level; tree decl; }; -typedef struct template_parm_index_s template_parm_index; struct GTY(()) ptrmem_cst { struct tree_common common; @@ -417,7 +416,7 @@ struct GTY(()) tree_baselink { /* The different kinds of ids that we encounter. */ -typedef enum cp_id_kind +enum cp_id_kind { /* Not an id at all. */ CP_ID_KIND_NONE, @@ -429,12 +428,12 @@ typedef enum cp_id_kind CP_ID_KIND_TEMPLATE_ID, /* A qualified-id. */ CP_ID_KIND_QUALIFIED -} cp_id_kind; +}; /* The various kinds of C++0x warnings we encounter. */ -typedef enum cpp0x_warn_str +enum cpp0x_warn_str { /* extended initializer lists */ CPP0X_INITIALIZER_LISTS, @@ -466,11 +465,11 @@ typedef enum cpp0x_warn_str CPP0X_ATTRIBUTES, /* ref-qualified member functions */ CPP0X_REF_QUALIFIER -} cpp0x_warn_str; +}; /* The various kinds of operation used by composite_pointer_type. */ -typedef enum composite_pointer_operation +enum composite_pointer_operation { /* comparison */ CPO_COMPARISON, @@ -478,27 +477,27 @@ typedef enum composite_pointer_operation CPO_CONVERSION, /* conditional expression */ CPO_CONDITIONAL_EXPR -} composite_pointer_operation; +}; /* Possible cases of expression list used by build_x_compound_expr_from_list. */ -typedef enum expr_list_kind { +enum expr_list_kind { ELK_INIT, /* initializer */ ELK_MEM_INIT, /* member initializer */ ELK_FUNC_CAST /* functional cast */ -} expr_list_kind; +}; /* Possible cases of implicit bad rhs conversions. */ -typedef enum impl_conv_rhs { +enum impl_conv_rhs { ICR_DEFAULT_ARGUMENT, /* default argument */ ICR_CONVERTING, /* converting */ ICR_INIT, /* initialization */ ICR_ARGPASS, /* argument passing */ ICR_RETURN, /* return */ ICR_ASSIGN /* assignment */ -} impl_conv_rhs; +}; /* Possible cases of implicit or explicit bad conversions to void. */ -typedef enum impl_conv_void { +enum impl_conv_void { ICV_CAST, /* (explicit) conversion to void */ ICV_SECOND_OF_COND, /* second operand of conditional expression */ ICV_THIRD_OF_COND, /* third operand of conditional expression */ @@ -506,11 +505,11 @@ typedef enum impl_conv_void { ICV_LEFT_OF_COMMA, /* left operand of comma operator */ ICV_STATEMENT, /* statement */ ICV_THIRD_IN_FOR /* for increment expression */ -} impl_conv_void; +}; /* Possible invalid uses of an abstract class that might not have a specific associated declaration. */ -typedef enum abstract_class_use { +enum GTY(()) abstract_class_use { ACU_UNKNOWN, /* unknown or decl provided */ ACU_CAST, /* cast to abstract class */ ACU_NEW, /* new-expression of abstract class */ @@ -519,7 +518,7 @@ typedef enum abstract_class_use { ACU_ARRAY, /* array of abstract class */ ACU_RETURN, /* return type of abstract class */ ACU_PARM /* parameter type of abstract class */ -} abstract_class_use; +}; /* Macros for access to language-specific slots in an identifier. */ @@ -642,7 +641,7 @@ struct GTY (()) tree_argument_pack_select { /* The different kinds of traits that we encounter. */ -typedef enum cp_trait_kind +enum cp_trait_kind { CPTK_BASES, CPTK_DIRECT_BASES, @@ -671,7 +670,7 @@ typedef enum cp_trait_kind CPTK_IS_TRIVIALLY_COPYABLE, CPTK_IS_UNION, CPTK_UNDERLYING_TYPE -} cp_trait_kind; +}; /* The types that we are processing. */ #define TRAIT_EXPR_TYPE1(NODE) \ @@ -991,7 +990,7 @@ union GTY((desc ("cp_tree_node_structure (&%h)"), chain_next ("(union lang_tree_node *) c_tree_chain_next (&%h.generic)"))) lang_tree_node { union tree_node GTY ((tag ("TS_CP_GENERIC"), desc ("tree_node_structure (&%h)"))) generic; - struct template_parm_index_s GTY ((tag ("TS_CP_TPI"))) tpi; + struct template_parm_index GTY ((tag ("TS_CP_TPI"))) tpi; struct ptrmem_cst GTY ((tag ("TS_CP_PTRMEM"))) ptrmem; struct tree_overload GTY ((tag ("TS_CP_OVERLOAD"))) overload; struct tree_baselink GTY ((tag ("TS_CP_BASELINK"))) baselink; @@ -1584,10 +1583,10 @@ enum languages { lang_c, lang_cplusplus, lang_java }; #define CLASSTYPE_VISIBILITY_SPECIFIED(TYPE) \ DECL_VISIBILITY_SPECIFIED (TYPE_MAIN_DECL (TYPE)) -typedef struct GTY (()) tree_pair_s { +struct GTY (()) tree_pair_s { tree purpose; tree value; -} tree_pair_s; +}; typedef tree_pair_s *tree_pair_p; /* This is a few header flags for 'struct lang_type'. Actually, @@ -3333,11 +3332,11 @@ extern void decl_shadowed_for_var_insert (tree, tree); /* Abstract iterators for AGGR_INIT_EXPRs. */ /* Structure containing iterator state. */ -typedef struct aggr_init_expr_arg_iterator_d { +struct aggr_init_expr_arg_iterator { tree t; /* the aggr_init_expr */ int n; /* argument count */ int i; /* next argument index */ -} aggr_init_expr_arg_iterator; +}; /* Initialize the abstract argument list iterator object ITER with the arguments from AGGR_INIT_EXPR node EXP. */ @@ -4502,7 +4501,7 @@ enum cp_lvalue_kind_flags { typedef int cp_lvalue_kind; /* Various kinds of template specialization, instantiation, etc. */ -typedef enum tmpl_spec_kind { +enum tmpl_spec_kind { tsk_none, /* Not a template at all. */ tsk_invalid_member_spec, /* An explicit member template specialization, but the enclosing @@ -4517,22 +4516,22 @@ typedef enum tmpl_spec_kind { tsk_template, /* A template declaration. */ tsk_expl_spec, /* An explicit specialization. */ tsk_expl_inst /* An explicit instantiation. */ -} tmpl_spec_kind; +}; /* The various kinds of access. BINFO_ACCESS depends on these being two bit quantities. The numerical values are important; they are used to initialize RTTI data structures, so changing them changes the ABI. */ -typedef enum access_kind { +enum access_kind { ak_none = 0, /* Inaccessible. */ ak_public = 1, /* Accessible, as a `public' thing. */ ak_protected = 2, /* Accessible, as a `protected' thing. */ ak_private = 3 /* Accessible, as a `private' thing. */ -} access_kind; +}; /* The various kinds of special functions. If you add to this list, you should update special_function_p as well. */ -typedef enum special_function_kind { +enum special_function_kind { sfk_none = 0, /* Not a special function. This enumeral must have value zero; see special_function_p. */ @@ -4549,7 +4548,7 @@ typedef enum special_function_kind { destroyed. */ sfk_conversion, /* A conversion operator. */ sfk_inheriting_constructor /* An inheriting constructor */ -} special_function_kind; +}; /* The various kinds of linkage. From [basic.link], @@ -4568,18 +4567,18 @@ typedef enum special_function_kind { -- When a name has no linkage, the entity it denotes cannot be referred to by names from other scopes. */ -typedef enum linkage_kind { +enum linkage_kind { lk_none, /* No linkage. */ lk_internal, /* Internal linkage. */ lk_external /* External linkage. */ -} linkage_kind; +}; -typedef enum duration_kind { +enum duration_kind { dk_static, dk_thread, dk_auto, dk_dynamic -} duration_kind; +}; /* Bitmask flags to control type substitution. */ enum tsubst_flags { @@ -4625,15 +4624,15 @@ enum base_access_flags { typedef int base_access; /* The various kinds of access check during parsing. */ -typedef enum deferring_kind { +enum deferring_kind { dk_no_deferred = 0, /* Check access immediately */ dk_deferred = 1, /* Deferred check */ dk_no_check = 2 /* No access check */ -} deferring_kind; +}; /* The kind of base we can find, looking in a class hierarchy. Values <0 indicate we failed. */ -typedef enum base_kind { +enum base_kind { bk_inaccessible = -3, /* The base is inaccessible */ bk_ambig = -2, /* The base is ambiguous */ bk_not_base = -1, /* It is not a base */ @@ -4642,7 +4641,7 @@ typedef enum base_kind { bk_via_virtual = 2 /* It is a proper base, but via a virtual path. This might not be the canonical binfo. */ -} base_kind; +}; /* Node for "pointer to (virtual) function". This may be distinct from ptr_type_node so gdb can distinguish them. */ @@ -4684,11 +4683,11 @@ struct cp_unevaluated fn_type_unification. Their meanings are described with the documentation for fn_type_unification. */ -typedef enum unification_kind_t { +enum unification_kind_t { DEDUCE_CALL, DEDUCE_CONV, DEDUCE_EXACT -} unification_kind_t; +}; // An RAII class used to create a new pointer map for local // specializations. When the stack goes out of scope, the @@ -5121,7 +5120,7 @@ enum cp_ref_qualifier { /* A storage class. */ -typedef enum cp_storage_class { +enum cp_storage_class { /* sc_none must be zero so that zeroing a cp_decl_specifier_seq sets the storage_class field to sc_none. */ sc_none = 0, @@ -5130,13 +5129,13 @@ typedef enum cp_storage_class { sc_static, sc_extern, sc_mutable -} cp_storage_class; +}; /* An individual decl-specifier. This is used to index the array of locations for the declspecs in struct cp_decl_specifier_seq below. */ -typedef enum cp_decl_spec { +enum cp_decl_spec { ds_first, ds_signed = ds_first, ds_unsigned, @@ -5162,11 +5161,11 @@ typedef enum cp_decl_spec { ds_long_long, ds_concept, ds_last /* This enumerator must always be the last one. */ -} cp_decl_spec; +}; /* A decl-specifier-seq. */ -typedef struct cp_decl_specifier_seq { +struct cp_decl_specifier_seq { /* An array of locations for the declaration sepecifiers, indexed by enum cp_decl_spec_word. */ source_location locations[ds_last]; @@ -5210,11 +5209,11 @@ typedef struct cp_decl_specifier_seq { BOOL_BITFIELD gnu_thread_keyword_p : 1; /* True iff the type is a decltype. */ BOOL_BITFIELD decltype_p : 1; -} cp_decl_specifier_seq; +}; /* The various kinds of declarators. */ -typedef enum cp_declarator_kind { +enum cp_declarator_kind { cdk_id, cdk_function, cdk_array, @@ -5222,7 +5221,7 @@ typedef enum cp_declarator_kind { cdk_reference, cdk_ptrmem, cdk_error -} cp_declarator_kind; +}; /* A declarator. */ @@ -6096,7 +6095,7 @@ extern int shared_member_p (tree); /* The representation of a deferred access check. */ -typedef struct GTY(()) deferred_access_check { +struct GTY(()) deferred_access_check { /* The base class in which the declaration is referenced. */ tree binfo; /* The declaration whose access must be checked. */ @@ -6105,7 +6104,7 @@ typedef struct GTY(()) deferred_access_check { tree diag_decl; /* The location of this access. */ location_t loc; -} deferred_access_check; +}; /* in semantics.c */ extern void push_deferring_access_checks (deferring_kind); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index e8ed472293b..5c75972136a 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -254,10 +254,10 @@ enum deprecated_states deprecated_state = DEPRECATED_NORMAL; /* A list of VAR_DECLs whose type was incomplete at the time the variable was declared. */ -typedef struct GTY(()) incomplete_var_d { +struct GTY(()) incomplete_var { tree decl; tree incomplete_type; -} incomplete_var; +}; static GTY(()) vec<incomplete_var, va_gc> *incomplete_vars; @@ -3827,7 +3827,7 @@ record_unknown_type (tree type, const char* name) /* A string for which we should create an IDENTIFIER_NODE at startup. */ -typedef struct predefined_identifier +struct predefined_identifier { /* The name of the identifier. */ const char *const name; @@ -3835,7 +3835,7 @@ typedef struct predefined_identifier tree *const node; /* Nonzero if this is the name of a constructor or destructor. */ const int ctor_or_dtor_p; -} predefined_identifier; +}; /* Create all the predefined identifiers. */ @@ -5369,11 +5369,11 @@ check_for_uninitialized_const_var (tree decl) /* Structure holding the current initializer being processed by reshape_init. CUR is a pointer to the current element being processed, END is a pointer after the last element present in the initializer. */ -typedef struct reshape_iterator_t +struct reshape_iter { constructor_elt *cur; constructor_elt *end; -} reshape_iter; +}; static tree reshape_init_r (tree, reshape_iter *, bool, tsubst_flags_t); diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 4f06f52d1da..d2d1531e4c2 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -1186,10 +1186,10 @@ check_noexcept_r (tree *tp, int * /*walk_subtrees*/, void * /*data*/) /* If a function that causes a noexcept-expression to be false isn't defined yet, remember it and check it for TREE_NOTHROW again at EOF. */ -typedef struct GTY(()) pending_noexcept { +struct GTY(()) pending_noexcept { tree fn; location_t loc; -} pending_noexcept; +}; static GTY(()) vec<pending_noexcept, va_gc> *pending_noexcept_checks; /* FN is a FUNCTION_DECL that caused a noexcept-expr to be false. Warn if diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 4518f20cc8e..342cb93e68b 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -95,7 +95,7 @@ along with GCC; see the file COPYING3. If not see && (PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE)))))) /* Things we only need one of. This module is not reentrant. */ -typedef struct GTY(()) globals { +struct GTY(()) globals { /* An array of the current substitution candidates, in the order we've seen them. */ vec<tree, va_gc> *substitutions; @@ -109,7 +109,7 @@ typedef struct GTY(()) globals { /* True if the mangling will be different in a future version of the ABI. */ bool need_abi_warning; -} globals; +}; static GTY (()) globals G; diff --git a/gcc/cp/method.c b/gcc/cp/method.c index fdc76043e93..b3e247c5b1f 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -56,8 +56,6 @@ enum mangling_flags mf_use_underscores_around_value = 2 }; -typedef enum mangling_flags mangling_flags; - static void do_build_copy_assign (tree); static void do_build_copy_constructor (tree); static tree make_alias_for_thunk (tree); diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index 4d941fec746..4b9419282d1 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -77,13 +77,13 @@ struct GTY(()) cxx_binding { /* Datatype used to temporarily save C++ bindings (for implicit instantiations purposes and like). Implemented in decl.c. */ -typedef struct GTY(()) cxx_saved_binding { +struct GTY(()) cxx_saved_binding { /* The name of the current binding. */ tree identifier; /* The binding we're saving. */ cxx_binding *binding; tree real_type_value; -} cxx_saved_binding; +}; extern tree identifier_type_value (tree); @@ -94,7 +94,7 @@ extern tree constructor_name (tree); extern bool constructor_name_p (tree, tree); /* The kinds of scopes we recognize. */ -typedef enum scope_kind { +enum scope_kind { sk_block = 0, /* An ordinary block scope. This enumerator must have the value zero because "cp_binding_level" is initialized by using "memset" to set the @@ -121,10 +121,10 @@ typedef enum scope_kind { explicit specialization is introduced by "template <>", this scope is always empty. */ sk_omp /* An OpenMP structured block. */ -} scope_kind; +}; /* The scope where the class/struct/union/enum tag applies. */ -typedef enum tag_scope { +enum tag_scope { ts_current = 0, /* Current scope only. This is for the class-key identifier; case mentioned in [basic.lookup.elab]/2, @@ -138,21 +138,21 @@ typedef enum tag_scope { according to [namespace.memdef]/3 and [class.friend]/9. */ ts_lambda = 3 /* Declaring a lambda closure. */ -} tag_scope; +}; -typedef struct GTY(()) cp_class_binding { +struct GTY(()) cp_class_binding { cxx_binding *base; /* The bound name. */ tree identifier; -} cp_class_binding; +}; -typedef struct GTY(()) cp_label_binding { +struct GTY(()) cp_label_binding { /* The bound LABEL_DECL. */ tree label; /* The previous IDENTIFIER_LABEL_VALUE. */ tree prev_value; -} cp_label_binding; +}; /* For each binding contour we allocate a binding_level structure diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index a0b249bbf5b..67fbcda4426 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -62,7 +62,7 @@ static cp_token eof_token = }; /* The various kinds of non integral constant we encounter. */ -typedef enum non_integral_constant { +enum non_integral_constant { NIC_NONE, /* floating-point literal */ NIC_FLOAT, @@ -118,10 +118,10 @@ typedef enum non_integral_constant { NIC_CONSTRUCTOR, /* a transaction expression */ NIC_TRANSACTION -} non_integral_constant; +}; /* The various kinds of errors about name-lookup failing. */ -typedef enum name_lookup_error { +enum name_lookup_error { /* NULL */ NLE_NULL, /* is not a type */ @@ -130,10 +130,10 @@ typedef enum name_lookup_error { NLE_CXX98, /* is not a class, namespace, or enumeration */ NLE_NOT_CXX98 -} name_lookup_error; +}; /* The various kinds of required token */ -typedef enum required_token { +enum required_token { RT_NONE, RT_SEMICOLON, /* ';' */ RT_OPEN_PAREN, /* '(' */ @@ -186,7 +186,7 @@ typedef enum required_token { RT_TRANSACTION_ATOMIC, /* __transaction_atomic */ RT_TRANSACTION_RELAXED, /* __transaction_relaxed */ RT_TRANSACTION_CANCEL /* __transaction_cancel */ -} required_token; +}; /* Prototypes. */ @@ -1733,7 +1733,7 @@ typedef int cp_parser_flags; /* The different kinds of declarators we want to parse. */ -typedef enum cp_parser_declarator_kind +enum cp_parser_declarator_kind { /* We want an abstract declarator. */ CP_PARSER_DECLARATOR_ABSTRACT, @@ -1741,7 +1741,7 @@ typedef enum cp_parser_declarator_kind CP_PARSER_DECLARATOR_NAMED, /* We don't mind, but the name must be an unqualified-id. */ CP_PARSER_DECLARATOR_EITHER -} cp_parser_declarator_kind; +}; /* The precedence values used to parse binary expressions. The minimum value of PREC must be 1, because zero is reserved to quickly discriminate @@ -1767,7 +1767,7 @@ enum cp_parser_prec /* A mapping from a token type to a corresponding tree node type, with a precedence value. */ -typedef struct cp_parser_binary_operations_map_node +struct cp_parser_binary_operations_map_node { /* The token type. */ enum cpp_ttype token_type; @@ -1775,9 +1775,9 @@ typedef struct cp_parser_binary_operations_map_node enum tree_code tree_type; /* The precedence of this operator. */ enum cp_parser_prec prec; -} cp_parser_binary_operations_map_node; +}; -typedef struct cp_parser_expression_stack_entry +struct cp_parser_expression_stack_entry { /* Left hand side of the binary operation we are currently parsing. */ @@ -1791,7 +1791,7 @@ typedef struct cp_parser_expression_stack_entry enum cp_parser_prec prec; /* Location of the binary operation we are parsing. */ location_t loc; -} cp_parser_expression_stack_entry; +}; /* The stack for storing partial expressions. We only need NUM_PREC_VALUES entries because precedence levels on the stack are monotonically @@ -9003,11 +9003,11 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword) use the count for function and namespace scopes as well. */ static GTY(()) tree lambda_scope; static GTY(()) int lambda_count; -typedef struct GTY(()) tree_int +struct GTY(()) tree_int { tree t; int i; -} tree_int; +}; static GTY(()) vec<tree_int, va_gc> *lambda_scope_stack; static void diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h index c7091c8e8e0..760467c2eb0 100644 --- a/gcc/cp/parser.h +++ b/gcc/cp/parser.h @@ -39,7 +39,7 @@ struct GTY(()) tree_check { /* A C++ token. */ -typedef struct GTY (()) cp_token { +struct GTY (()) cp_token { /* The kind of token. */ ENUM_BITFIELD (cpp_ttype) type : 8; /* If this token is a keyword, this value indicates which keyword. @@ -68,7 +68,7 @@ typedef struct GTY (()) cp_token { /* Use for all other tokens. */ tree GTY((tag ("0"))) value; } GTY((desc ("(%1.type == CPP_TEMPLATE_ID) || (%1.type == CPP_NESTED_NAME_SPECIFIER)"))) u; -} cp_token; +}; /* We use a stack of token pointer for saving token sets. */ @@ -79,7 +79,7 @@ typedef struct cp_token *cp_token_position; it to the parser. Tokens are never added to the cp_lexer after it is created. */ -typedef struct GTY (()) cp_lexer { +struct GTY (()) cp_lexer { /* The memory allocated for the buffer. NULL if this lexer does not own the token buffer. */ vec<cp_token, va_gc> *buffer; @@ -107,7 +107,7 @@ typedef struct GTY (()) cp_lexer { /* True if we're in the context of parsing a pragma, and should not increment past the end-of-line marker. */ bool in_pragma; -} cp_lexer; +}; /* cp_token_cache is a range of tokens. There is no need to represent @@ -116,17 +116,17 @@ typedef struct GTY (()) cp_lexer { a cp_token_cache, since everything in here is referenced through a lexer. */ -typedef struct GTY(()) cp_token_cache { +struct GTY(()) cp_token_cache { /* The beginning of the token range. */ cp_token * GTY((skip)) first; /* Points immediately after the last token in the range. */ cp_token * GTY ((skip)) last; -} cp_token_cache; +}; typedef cp_token_cache *cp_token_cache_ptr; -struct cp_token_ident_d +struct cp_token_ident { unsigned int ident_len; const char *ident_str; @@ -136,22 +136,20 @@ struct cp_token_ident_d const char *after_str; }; -typedef struct cp_token_ident_d cp_token_ident; - /* An entry in a queue of function arguments that require post-processing. */ -typedef struct GTY(()) cp_default_arg_entry_d { +struct GTY(()) cp_default_arg_entry { /* The current_class_type when we parsed this arg. */ tree class_type; /* The function decl itself. */ tree decl; -} cp_default_arg_entry; +}; /* An entry in a stack for member functions defined within their classes. */ -typedef struct GTY(()) cp_unparsed_functions_entry_d { +struct GTY(()) cp_unparsed_functions_entry { /* Functions with default arguments that require post-processing. Functions appear in this list in declaration order. */ vec<cp_default_arg_entry, va_gc> *funs_with_default_args; @@ -167,12 +165,12 @@ typedef struct GTY(()) cp_unparsed_functions_entry_d { /* Nested classes go in this vector, so that we can do some final processing after parsing any NSDMIs. */ vec<tree, va_gc> *classes; -} cp_unparsed_functions_entry; +}; /* The status of a tentative parse. */ -typedef enum cp_parser_status_kind +enum cp_parser_status_kind { /* No errors have occurred. */ CP_PARSER_STATUS_KIND_NO_ERROR, @@ -181,11 +179,11 @@ typedef enum cp_parser_status_kind /* We are committed to this tentative parse, whether or not an error has occurred. */ CP_PARSER_STATUS_KIND_COMMITTED -} cp_parser_status_kind; +}; /* Context that is saved and restored when parsing tentatively. */ -typedef struct GTY (()) cp_parser_context { +struct GTY (()) cp_parser_context { /* If this is a tentative parsing context, the status of the tentative parse. */ enum cp_parser_status_kind status; @@ -197,7 +195,7 @@ typedef struct GTY (()) cp_parser_context { /* The next parsing context in the stack. */ struct cp_parser_context *next; -} cp_parser_context; +}; /* Control structure for #pragma omp declare simd parsing. */ @@ -210,7 +208,7 @@ struct cp_omp_declare_simd_data { /* The cp_parser structure represents the C++ parser. */ -typedef struct GTY(()) cp_parser { +struct GTY(()) cp_parser { /* The lexer from which we are obtaining tokens. */ cp_lexer *lexer; @@ -406,7 +404,7 @@ typedef struct GTY(()) cp_parser { context e.g., because they could never be deduced. */ int prevent_constrained_type_specifiers; -} cp_parser; +}; /* In parser.c */ extern void debug (cp_token &ref); diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index ed81322a577..e4b6e00e3b8 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see translation, when we are emitting the type info objects. */ /* Auxiliary data we hold for each type_info derived object we need. */ -typedef struct GTY (()) tinfo_s { +struct GTY (()) tinfo_s { tree type; /* The RECORD_TYPE for this type_info object */ tree vtable; /* The VAR_DECL of the vtable. Only filled at end of @@ -72,10 +72,10 @@ typedef struct GTY (()) tinfo_s { tree name; /* IDENTIFIER_NODE for the ABI specified name of the type_info derived type. */ -} tinfo_s; +}; -typedef enum tinfo_kind +enum tinfo_kind { TK_TYPE_INFO_TYPE, /* abi::__type_info_pseudo */ TK_BASE_TYPE, /* abi::__base_class_type_info */ @@ -89,7 +89,7 @@ typedef enum tinfo_kind TK_SI_CLASS_TYPE, /* abi::__si_class_type_info */ TK_FIXED /* end of fixed descriptors. */ /* ... abi::__vmi_type_info<I> */ -} tinfo_kind; +}; /* Helper macro to get maximum scalar-width of pointer or of the 'long'-type. This of interest for llp64 targets. */ diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 7bbae06f717..2a69ab0863f 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -115,7 +115,7 @@ static tree capture_decltype (tree); In case of parsing error, we simply call `pop_deferring_access_checks' without `perform_deferred_access_checks'. */ -typedef struct GTY(()) deferred_access { +struct GTY(()) deferred_access { /* A vector representing name-lookups for which we have deferred checking access controls. We cannot check the accessibility of names used in a decl-specifier-seq until we know what is being @@ -134,7 +134,7 @@ typedef struct GTY(()) deferred_access { /* The current mode of access checks. */ enum deferring_kind deferring_access_checks_kind; -} deferred_access; +}; /* Data for deferred access checking. */ static GTY(()) vec<deferred_access, va_gc> *deferred_access_stack; diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 8a3a53720a4..1d106c74995 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -145,7 +145,7 @@ struct GTY((chain_next ("%h.next"), for_user)) pending_abstract_type { tree type; /* Kind of use in an unnamed declarator. */ - abstract_class_use use; + enum abstract_class_use use; /* Position of the declaration. This is only needed for IDENTIFIER_NODEs, because DECLs already carry locus information. */ diff --git a/gcc/dse.c b/gcc/dse.c index ff26fc0cb05..780379a8175 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -808,12 +808,12 @@ free_store_info (insn_info_t insn_info) insn_info->store_rec = NULL; } -typedef struct +struct note_add_store_info { rtx_insn *first, *current; regset fixed_regs_live; bool failure; -} note_add_store_info; +}; /* Callback for emit_inc_dec_insn_before via note_stores. Check if a register is clobbered which is live afterwards. */ diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index 138bae045dc..ab18062852b 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see #define MAX_ARTIFICIAL_LABEL_BYTES 30 /* A collected description of an entire row of the abstract CFI table. */ -typedef struct GTY(()) dw_cfi_row_struct +struct GTY(()) dw_cfi_row { /* The expression that computes the CFA, expressed in two different ways. The CFA member for the simple cases, and the full CFI expression for @@ -78,13 +78,13 @@ typedef struct GTY(()) dw_cfi_row_struct /* The expressions for any register column that is saved. */ cfi_vec reg_save; -} dw_cfi_row; +}; /* The caller's ORIG_REG is saved in SAVED_IN_REG. */ -typedef struct GTY(()) reg_saved_in_data_struct { +struct GTY(()) reg_saved_in_data { rtx orig_reg; rtx saved_in_reg; -} reg_saved_in_data; +}; /* Since we no longer have a proper CFG, we're going to create a facsimile @@ -104,7 +104,7 @@ typedef struct GTY(()) reg_saved_in_data_struct { All save points are present in the TRACE_INDEX hash, mapping the insn starting a trace to the dw_trace_info describing the trace. */ -typedef struct +struct dw_trace_info { /* The insn that begins the trace. */ rtx_insn *head; @@ -157,7 +157,7 @@ typedef struct /* True if we've seen different values incoming to beg_true_args_size. */ bool args_size_undefined; -} dw_trace_info; +}; typedef dw_trace_info *dw_trace_info_ref; @@ -220,11 +220,11 @@ static dw_cfa_location *cur_cfa; of the prologue or (b) the register is clobbered. This clusters register saves so that there are fewer pc advances. */ -typedef struct { +struct queued_reg_save { rtx reg; rtx saved_reg; HOST_WIDE_INT cfa_offset; -} queued_reg_save; +}; static vec<queued_reg_save> queued_reg_saves; @@ -261,7 +261,7 @@ init_return_column_size (machine_mode mode, rtx mem, unsigned int c) init_one_dwarf_reg_size to communicate on what has been done by the latter. */ -typedef struct +struct init_one_dwarf_reg_state { /* Whether the dwarf return column was initialized. */ bool wrote_return_column; @@ -270,7 +270,7 @@ typedef struct was given REGNO to process already. */ bool processed_regno [FIRST_PSEUDO_REGISTER]; -} init_one_dwarf_reg_state; +}; /* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to initialize the dwarf register size table entry corresponding to register diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3a638751747..9cbaf6c6c0b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> + + * dependency.c, dependency.h, gfortran.h, io.c, module.c, + parse.h, resolve.c, trans-types.h, trans.h: remove useless + 2015-08-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/54656 diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c index 8b07f59586a..ca37c1a216e 100644 --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. If not see enum range {LHS, RHS, MID}; /* Dependency types. These must be in reverse order of priority. */ -typedef enum +enum gfc_dependency { GFC_DEP_ERROR, GFC_DEP_EQUAL, /* Identical Ranges. */ @@ -44,8 +44,7 @@ typedef enum GFC_DEP_BACKWARD, /* e.g. a(2:4) = a(1:3). */ GFC_DEP_OVERLAP, /* May overlap in some other way. */ GFC_DEP_NODEP /* Distinct ranges. */ -} -gfc_dependency; +}; /* Macros */ #define IS_ARRAY_EXPLICIT(as) ((as->type == AS_EXPLICIT ? 1 : 0)) diff --git a/gcc/fortran/dependency.h b/gcc/fortran/dependency.h index 48d9e6f17dc..08792edc254 100644 --- a/gcc/fortran/dependency.h +++ b/gcc/fortran/dependency.h @@ -19,14 +19,13 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ /****************************** Enums *********************************/ -typedef enum +enum gfc_dep_check { NOT_ELEMENTAL, /* Not elemental case: normal dependency check. */ ELEM_CHECK_VARIABLE, /* Test whether variables overlap. */ ELEM_DONT_CHECK_VARIABLE /* Test whether variables overlap only if used in an expression. */ -} -gfc_dep_check; +}; /*********************** Functions prototypes **************************/ diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 5a0c3695e7a..9c0084be77c 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -102,70 +102,61 @@ mstring; /* Used when matching and resolving data I/O transfer statements. */ -typedef enum -{ M_READ, M_WRITE, M_PRINT, M_INQUIRE } -io_kind; +enum io_kind +{ M_READ, M_WRITE, M_PRINT, M_INQUIRE }; /* These are flags for identifying whether we are reading a character literal between quotes or normal source code. */ -typedef enum -{ NONSTRING = 0, INSTRING_WARN, INSTRING_NOWARN } -gfc_instring; +enum gfc_instring +{ NONSTRING = 0, INSTRING_WARN, INSTRING_NOWARN }; /* This is returned by gfc_notification_std to know if, given the flags that were given (-std=, -pedantic) we should issue an error, a warning or nothing. */ -typedef enum -{ SILENT, WARNING, ERROR } -notification; +enum notification +{ SILENT, WARNING, ERROR }; /* Matchers return one of these three values. The difference between MATCH_NO and MATCH_ERROR is that MATCH_ERROR means that a match was successful, but that something non-syntactic is wrong and an error has already been issued. */ -typedef enum -{ MATCH_NO = 1, MATCH_YES, MATCH_ERROR } -match; +enum match +{ MATCH_NO = 1, MATCH_YES, MATCH_ERROR }; /* Used for different Fortran source forms in places like scanner.c. */ -typedef enum -{ FORM_FREE, FORM_FIXED, FORM_UNKNOWN } -gfc_source_form; +enum gfc_source_form +{ FORM_FREE, FORM_FIXED, FORM_UNKNOWN }; /* Expression node types. */ -typedef enum +enum expr_t { EXPR_OP = 1, EXPR_FUNCTION, EXPR_CONSTANT, EXPR_VARIABLE, EXPR_SUBSTRING, EXPR_STRUCTURE, EXPR_ARRAY, EXPR_NULL, EXPR_COMPCALL, EXPR_PPC -} -expr_t; +}; /* Array types. */ -typedef enum +enum array_type { AS_EXPLICIT = 1, AS_ASSUMED_SHAPE, AS_DEFERRED, AS_ASSUMED_SIZE, AS_IMPLIED_SHAPE, AS_ASSUMED_RANK, AS_UNKNOWN -} -array_type; +}; -typedef enum -{ AR_FULL = 1, AR_ELEMENT, AR_SECTION, AR_UNKNOWN } -ar_type; +enum ar_type +{ AR_FULL = 1, AR_ELEMENT, AR_SECTION, AR_UNKNOWN }; /* Statement label types. ST_LABEL_DO_TARGET is used for obsolescent warnings related to shared DO terminations and DO targets which are neither END DO nor CONTINUE; otherwise it is identical to ST_LABEL_TARGET. */ -typedef enum +enum gfc_sl_type { ST_LABEL_UNKNOWN = 1, ST_LABEL_TARGET, ST_LABEL_DO_TARGET, ST_LABEL_BAD_TARGET, ST_LABEL_FORMAT -} -gfc_sl_type; +}; /* Intrinsic operators. */ -typedef enum +enum gfc_intrinsic_op { GFC_INTRINSIC_BEGIN = 0, INTRINSIC_NONE = -1, INTRINSIC_UPLUS = GFC_INTRINSIC_BEGIN, INTRINSIC_UMINUS, INTRINSIC_PLUS, INTRINSIC_MINUS, INTRINSIC_TIMES, @@ -179,22 +170,20 @@ typedef enum INTRINSIC_LT_OS, INTRINSIC_LE_OS, INTRINSIC_NOT, INTRINSIC_USER, INTRINSIC_ASSIGN, INTRINSIC_PARENTHESES, GFC_INTRINSIC_END /* Sentinel */ -} -gfc_intrinsic_op; +}; /* This macro is the number of intrinsic operators that exist. Assumptions are made about the numbering of the interface_op enums. */ #define GFC_INTRINSIC_OPS GFC_INTRINSIC_END /* Arithmetic results. */ -typedef enum +enum arith { ARITH_OK = 1, ARITH_OVERFLOW, ARITH_UNDERFLOW, ARITH_NAN, ARITH_DIV0, ARITH_INCOMMENSURATE, ARITH_ASYMMETRIC, ARITH_PROHIBIT -} -arith; +}; /* Statements. */ -typedef enum +enum gfc_statement { ST_ARITHMETIC_IF, ST_ALLOCATE, ST_ATTR_DECL, ST_ASSOCIATE, ST_BACKSPACE, ST_BLOCK, ST_BLOCK_DATA, @@ -252,62 +241,54 @@ typedef enum ST_OMP_END_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD, ST_PROCEDURE, ST_GENERIC, ST_CRITICAL, ST_END_CRITICAL, ST_GET_FCN_CHARACTERISTICS, ST_LOCK, ST_UNLOCK, ST_NONE -} -gfc_statement; +}; /* Types of interfaces that we can have. Assignment interfaces are considered to be intrinsic operators. */ -typedef enum +enum interface_type { INTERFACE_NAMELESS = 1, INTERFACE_GENERIC, INTERFACE_INTRINSIC_OP, INTERFACE_USER_OP, INTERFACE_ABSTRACT -} -interface_type; +}; /* Symbol flavors: these are all mutually exclusive. 10 elements = 4 bits. */ -typedef enum sym_flavor +enum sym_flavor { FL_UNKNOWN = 0, FL_PROGRAM, FL_BLOCK_DATA, FL_MODULE, FL_VARIABLE, FL_PARAMETER, FL_LABEL, FL_PROCEDURE, FL_DERIVED, FL_NAMELIST, FL_VOID -} -sym_flavor; +}; /* Procedure types. 7 elements = 3 bits. */ -typedef enum procedure_type +enum procedure_type { PROC_UNKNOWN, PROC_MODULE, PROC_INTERNAL, PROC_DUMMY, PROC_INTRINSIC, PROC_ST_FUNCTION, PROC_EXTERNAL -} -procedure_type; +}; /* Intent types. */ -typedef enum sym_intent +enum sym_intent { INTENT_UNKNOWN = 0, INTENT_IN, INTENT_OUT, INTENT_INOUT -} -sym_intent; +}; /* Access types. */ -typedef enum gfc_access +enum gfc_access { ACCESS_UNKNOWN = 0, ACCESS_PUBLIC, ACCESS_PRIVATE -} -gfc_access; +}; /* Flags to keep track of where an interface came from. 3 elements = 2 bits. */ -typedef enum ifsrc +enum ifsrc { IFSRC_UNKNOWN = 0, /* Interface unknown, only return type may be known. */ IFSRC_DECL, /* FUNCTION or SUBROUTINE declaration. */ IFSRC_IFBODY /* INTERFACE statement or PROCEDURE statement with explicit interface. */ -} -ifsrc; +}; /* Whether a SAVE attribute was set explicitly or implicitly. */ -typedef enum save_state +enum save_state { SAVE_NONE = 0, SAVE_EXPLICIT, SAVE_IMPLICIT -} -save_state; +}; /* Strings for all symbol attributes. We use these for dumping the parse tree, in error messages, and also when reading and writing @@ -602,38 +583,33 @@ enum gfc_isym_id GFC_ISYM_YN, GFC_ISYM_YN2 }; -typedef enum gfc_isym_id gfc_isym_id; -typedef enum +enum init_local_logical { GFC_INIT_LOGICAL_OFF = 0, GFC_INIT_LOGICAL_FALSE, GFC_INIT_LOGICAL_TRUE -} -init_local_logical; +}; -typedef enum +enum init_local_character { GFC_INIT_CHARACTER_OFF = 0, GFC_INIT_CHARACTER_ON -} -init_local_character; +}; -typedef enum +enum init_local_integer { GFC_INIT_INTEGER_OFF = 0, GFC_INIT_INTEGER_ON -} -init_local_integer; +}; -typedef enum +enum gfc_reverse { GFC_ENABLE_REVERSE, GFC_FORWARD_SET, GFC_REVERSE_SET, GFC_INHIBIT_REVERSE -} -gfc_reverse; +}; /************************* Structures *****************************/ @@ -645,13 +621,12 @@ gfc_reverse; #define NAMED_FUNCTION(a,b,c,d) a, #define NAMED_SUBROUTINE(a,b,c,d) a, #define NAMED_DERIVED_TYPE(a,b,c,d) a, -typedef enum +enum iso_fortran_env_symbol { ISOFORTRANENV_INVALID = -1, #include "iso-fortran-env.def" ISOFORTRANENV_LAST, ISOFORTRANENV_NUMBER = ISOFORTRANENV_LAST -} -iso_fortran_env_symbol; +}; #undef NAMED_INTCST #undef NAMED_KINDARRAY #undef NAMED_FUNCTION @@ -667,14 +642,13 @@ iso_fortran_env_symbol; #define DERIVED_TYPE(a,b,c) a, #define NAMED_FUNCTION(a,b,c,d) a, #define NAMED_SUBROUTINE(a,b,c,d) a, -typedef enum +enum iso_c_binding_symbol { ISOCBINDING_INVALID = -1, #include "iso-c-binding.def" ISOCBINDING_LAST, ISOCBINDING_NUMBER = ISOCBINDING_LAST -} -iso_c_binding_symbol; +}; #undef NAMED_INTCST #undef NAMED_REALCST #undef NAMED_CMPXCST @@ -685,12 +659,11 @@ iso_c_binding_symbol; #undef NAMED_FUNCTION #undef NAMED_SUBROUTINE -typedef enum +enum intmod_id { INTMOD_NONE = 0, INTMOD_ISO_FORTRAN_ENV, INTMOD_ISO_C_BINDING, INTMOD_IEEE_FEATURES, INTMOD_IEEE_EXCEPTIONS, INTMOD_IEEE_ARITHMETIC -} -intmod_id; +}; typedef struct { @@ -1095,7 +1068,7 @@ gfc_expr_list; #define gfc_get_expr_list() XCNEW (gfc_expr_list) -typedef enum +enum gfc_omp_reduction_op { OMP_REDUCTION_NONE = -1, OMP_REDUCTION_PLUS = INTRINSIC_PLUS, @@ -1111,18 +1084,16 @@ typedef enum OMP_REDUCTION_IOR, OMP_REDUCTION_IEOR, OMP_REDUCTION_USER -} -gfc_omp_reduction_op; +}; -typedef enum +enum gfc_omp_depend_op { OMP_DEPEND_IN, OMP_DEPEND_OUT, OMP_DEPEND_INOUT -} -gfc_omp_depend_op; +}; -typedef enum +enum gfc_omp_map_op { OMP_MAP_ALLOC, OMP_MAP_TO, @@ -1135,8 +1106,7 @@ typedef enum OMP_MAP_FORCE_TOFROM, OMP_MAP_FORCE_PRESENT, OMP_MAP_FORCE_DEVICEPTR -} -gfc_omp_map_op; +}; /* For use in OpenMP clauses in case we need extra information (aligned clause alignment, linear clause step, etc.). */ @@ -1796,9 +1766,8 @@ gfc_array_ref; resolution. The array_ref component may be present and comes before the component component. */ -typedef enum - { REF_ARRAY, REF_COMPONENT, REF_SUBSTRING } -ref_type; +enum ref_type + { REF_ARRAY, REF_COMPONENT, REF_SUBSTRING }; typedef struct gfc_ref { @@ -2329,7 +2298,7 @@ gfc_association_list; /* Executable statements that fill gfc_code structures. */ -typedef enum +enum gfc_exec_op { EXEC_NOP = 1, EXEC_END_NESTED_BLOCK, EXEC_END_BLOCK, EXEC_ASSIGN, EXEC_LABEL_ASSIGN, EXEC_POINTER_ASSIGN, EXEC_CRITICAL, EXEC_ERROR_STOP, @@ -2366,10 +2335,9 @@ typedef enum EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD, EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD, EXEC_OMP_TARGET_UPDATE -} -gfc_exec_op; +}; -typedef enum +enum gfc_omp_atomic_op { GFC_OMP_ATOMIC_UPDATE = 0, GFC_OMP_ATOMIC_READ = 1, @@ -2378,8 +2346,7 @@ typedef enum GFC_OMP_ATOMIC_MASK = 3, GFC_OMP_ATOMIC_SEQ_CST = 4, GFC_OMP_ATOMIC_SWAP = 8 -} -gfc_omp_atomic_op; +}; typedef struct gfc_code { diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 436c09a1dee..cff2b689786 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -106,7 +106,7 @@ static gfc_dt *current_dt; /**************** Fortran 95 FORMAT parser *****************/ /* FORMAT tokens returned by format_lex(). */ -typedef enum +enum format_token { FMT_NONE, FMT_UNKNOWN, FMT_SIGNED_INT, FMT_ZERO, FMT_POSINT, FMT_PERIOD, FMT_COMMA, FMT_COLON, FMT_SLASH, FMT_DOLLAR, FMT_LPAREN, @@ -114,8 +114,7 @@ typedef enum FMT_E, FMT_EN, FMT_ES, FMT_G, FMT_L, FMT_A, FMT_D, FMT_H, FMT_END, FMT_ERROR, FMT_DC, FMT_DP, FMT_T, FMT_TR, FMT_TL, FMT_STAR, FMT_RC, FMT_RD, FMT_RN, FMT_RP, FMT_RU, FMT_RZ -} -format_token; +}; /* Local variables for checking format strings. The saved_token is used to back up by a single format token during the parsing diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 86dca1c5382..621ef36d170 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -1117,11 +1117,10 @@ gzopen_intrinsic_module (const char* name) } -typedef enum +enum atom_type { ATOM_NAME, ATOM_LPAREN, ATOM_RPAREN, ATOM_INTEGER, ATOM_STRING -} -atom_type; +}; static atom_type last_atom; @@ -1971,7 +1970,7 @@ mio_internal_string (char *string) } -typedef enum +enum ab_attribute { AB_ALLOCATABLE, AB_DIMENSION, AB_EXTERNAL, AB_INTRINSIC, AB_OPTIONAL, AB_POINTER, AB_TARGET, AB_DUMMY, AB_RESULT, AB_DATA, AB_IN_NAMELIST, AB_IN_COMMON, AB_FUNCTION, AB_SUBROUTINE, AB_SEQUENCE, @@ -1984,8 +1983,7 @@ typedef enum AB_COARRAY_COMP, AB_VTYPE, AB_VTAB, AB_CONTIGUOUS, AB_CLASS_POINTER, AB_IMPLICIT_PURE, AB_ARTIFICIAL, AB_UNLIMITED_POLY, AB_OMP_DECLARE_TARGET, AB_ARRAY_OUTER_DEPENDENCY, AB_MODULE_PROCEDURE -} -ab_attribute; +}; static const mstring attr_bits[] = { diff --git a/gcc/fortran/parse.h b/gcc/fortran/parse.h index dcac98aac69..bcd714d3bd2 100644 --- a/gcc/fortran/parse.h +++ b/gcc/fortran/parse.h @@ -23,15 +23,14 @@ along with GCC; see the file COPYING3. If not see #define GFC_PARSE_H /* Enum for what the compiler is currently doing. */ -typedef enum +enum gfc_compile_state { COMP_NONE, COMP_PROGRAM, COMP_MODULE, COMP_SUBMODULE, COMP_SUBROUTINE, COMP_FUNCTION, COMP_BLOCK_DATA, COMP_INTERFACE, COMP_DERIVED, COMP_DERIVED_CONTAINS, COMP_BLOCK, COMP_ASSOCIATE, COMP_IF, COMP_DO, COMP_SELECT, COMP_FORALL, COMP_WHERE, COMP_CONTAINS, COMP_ENUM, COMP_SELECT_TYPE, COMP_OMP_STRUCTURED_BLOCK, COMP_CRITICAL, COMP_DO_CONCURRENT -} -gfc_compile_state; +}; /* Stack element for the current compilation state. These structures are allocated as automatic variables. */ diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 641a3bdaa9a..a3041589df9 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -33,11 +33,10 @@ along with GCC; see the file COPYING3. If not see /* Types used in equivalence statements. */ -typedef enum seq_type +enum seq_type { SEQ_NONDEFAULT, SEQ_NUMERIC, SEQ_CHARACTER, SEQ_MIXED -} -seq_type; +}; /* Stack to keep track of the nesting of blocks as we move through the code. See resolve_branch() and gfc_resolve_code(). */ @@ -1438,9 +1437,8 @@ specific_sym (gfc_symbol *sym) /* Figure out if the procedure is specific, generic or unknown. */ -typedef enum -{ PTYPE_GENERIC = 1, PTYPE_SPECIFIC, PTYPE_UNKNOWN } -proc_type; +enum proc_type +{ PTYPE_GENERIC = 1, PTYPE_SPECIFIC, PTYPE_UNKNOWN }; static proc_type procedure_kind (gfc_symbol *sym) @@ -3850,9 +3848,8 @@ bad_op: /************** Array resolution subroutines **************/ -typedef enum -{ CMP_LT, CMP_EQ, CMP_GT, CMP_UNKNOWN } -compare_result; +enum compare_result +{ CMP_LT, CMP_EQ, CMP_GT, CMP_UNKNOWN }; /* Compare two integer expressions. */ diff --git a/gcc/fortran/trans-types.h b/gcc/fortran/trans-types.h index a08c912bd34..c1ea5542bf6 100644 --- a/gcc/fortran/trans-types.h +++ b/gcc/fortran/trans-types.h @@ -44,12 +44,12 @@ extern GTY(()) tree gfc_charlen_type_node; and __float128. */ extern bool gfc_real16_is_float128; -typedef enum { +enum gfc_packed { PACKED_NO = 0, PACKED_PARTIAL, PACKED_FULL, PACKED_STATIC -} gfc_packed; +}; /* be-function.c */ void gfc_convert_function_code (gfc_namespace *); diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 6a9ba602531..541640d1c03 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -107,15 +107,14 @@ gfc_se; /* Denotes different types of coarray. Please keep in sync with libgfortran/caf/libcaf.h. */ -typedef enum +enum gfc_coarray_type { GFC_CAF_COARRAY_STATIC, GFC_CAF_COARRAY_ALLOC, GFC_CAF_LOCK_STATIC, GFC_CAF_LOCK_ALLOC, GFC_CAF_CRITICAL -} -gfc_coarray_type; +}; /* The array-specific scalarization information. The array members of @@ -148,7 +147,7 @@ typedef struct gfc_array_info } gfc_array_info; -typedef enum +enum gfc_ss_type { /* A scalar value. This will be evaluated before entering the scalarization loop. */ @@ -190,8 +189,7 @@ typedef enum /* A component of a derived type. */ GFC_SS_COMPONENT -} -gfc_ss_type; +}; typedef struct gfc_ss_info diff --git a/gcc/gcse-common.h b/gcc/gcse-common.h index a6b1a0c3bde..43f762baa66 100644 --- a/gcc/gcse-common.h +++ b/gcc/gcse-common.h @@ -22,11 +22,11 @@ along with GCC; see the file COPYING3. If not see #define GCC_GCSE_COMMON_H typedef vec<rtx_insn *> vec_rtx_heap; -typedef struct modify_pair_s +struct modify_pair { rtx dest; /* A MEM. */ rtx dest_addr; /* The canonical address of `dest'. */ -} modify_pair; +}; typedef vec<modify_pair> vec_modify_pair_heap; diff --git a/gcc/genopinit.c b/gcc/genopinit.c index 3ff1894ec4f..77e81f5e4fb 100644 --- a/gcc/genopinit.c +++ b/gcc/genopinit.c @@ -104,7 +104,7 @@ typedef enum optab_tag { #define OPTAB_DC(o, p, c) { #o, p, NS, ZS, NS, o, c, c, 4 }, #define OPTAB_D(o, p) { #o, p, NS, ZS, NS, o, UNKNOWN, UNKNOWN, 4 }, -typedef struct optab_def_d +struct optab_def { const char *name; const char *pattern; @@ -115,7 +115,7 @@ typedef struct optab_def_d enum rtx_code fcode; enum rtx_code rcode; unsigned int kind; -} optab_def; +}; static optab_def optabs[] = { { "unknown_optab", NULL, NS, ZS, NS, unknown_optab, UNKNOWN, UNKNOWN, 0 }, @@ -136,13 +136,13 @@ static optab_def optabs[] = { /* Vector in which to collect insns that match. */ -typedef struct pattern_d +struct pattern { const char *name; unsigned int op; unsigned int m1, m2; unsigned int sort_num; -} pattern; +}; static vec<pattern> patterns; diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 4002845449c..58f19c0d24e 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -245,7 +245,7 @@ inverse_table[NUM_ORDERS]; /* A page_entry records the status of an allocation page. This structure is dynamically sized to fit the bitmap in_use_p. */ -typedef struct page_entry +struct page_entry { /* The next page-entry with objects of the same size, or NULL if this is the last page-entry. */ @@ -292,12 +292,12 @@ typedef struct page_entry Nth bit is one if the Nth object on this page is allocated. This array is dynamically sized. */ unsigned long in_use_p[1]; -} page_entry; +}; #ifdef USING_MALLOC_PAGE_GROUPS /* A page_group describes a large allocation from malloc, from which we parcel out aligned pages. */ -typedef struct page_group +struct page_group { /* A linked list of all extant page groups. */ struct page_group *next; @@ -310,7 +310,7 @@ typedef struct page_group /* A bitmask of pages in use. */ unsigned int in_use; -} page_group; +}; #endif #if HOST_BITS_PER_PTR <= 32 diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index bce03464fec..6f5ab78ca45 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,7 @@ +2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> + + * lto.h: Remove useless typedefs. + 2015-07-15 Andrew MacLeod <amacleod@redhat.com> * lto.c: Remove redundant includes. diff --git a/gcc/lto/lto.h b/gcc/lto/lto.h index 8f38ee8af6f..7b9f4f341f1 100644 --- a/gcc/lto/lto.h +++ b/gcc/lto/lto.h @@ -23,13 +23,13 @@ along with GCC; see the file COPYING3. If not see /* A file. */ -typedef struct lto_file_struct +struct lto_file { /* The name of the file. */ const char *filename; /* The offset for the object inside an ar archive file (or zero). */ off_t offset; -} lto_file; +}; /* In lto-lang.c */ extern const char *resolution_file_name; diff --git a/gcc/machmode.h b/gcc/machmode.h index 6575517d132..66ac7c0539d 100644 --- a/gcc/machmode.h +++ b/gcc/machmode.h @@ -340,12 +340,12 @@ extern void init_adjust_machine_modes (void); (SCALAR_INT_MODE_P (MODE) \ && GET_MODE_PRECISION (MODE) <= HOST_BITS_PER_WIDE_INT) -typedef struct { +struct int_n_data_t { /* These parts are initailized by genmodes output */ unsigned int bitsize; machine_mode m; /* RID_* is RID_INTN_BASE + index into this array */ -} int_n_data_t; +}; /* This is also in tree.h. genmodes.c guarantees the're sorted from smallest bitsize to largest bitsize. */ diff --git a/gcc/mcf.c b/gcc/mcf.c index 6c2b87b4e68..121a334b026 100644 --- a/gcc/mcf.c +++ b/gcc/mcf.c @@ -61,7 +61,7 @@ along with GCC; see the file COPYING3. If not see /* Limit the number of iterations for cancel_negative_cycles() to ensure reasonable compile time. */ #define MAX_ITER(n, e) 10 + (1000000 / ((n) * (e))) -typedef enum +enum edge_type { INVALID_EDGE, VERTEX_SPLIT_EDGE, /* Edge to represent vertex with w(e) = w(v). */ @@ -72,10 +72,10 @@ typedef enum BALANCE_EDGE, /* Edge connecting with source/sink: cp(e) = 0. */ REDIRECT_NORMALIZED_EDGE, /* Normalized edge for a redirect edge. */ REVERSE_NORMALIZED_EDGE /* Normalized edge for a reverse edge. */ -} edge_type; +}; /* Structure to represent an edge in the fixup graph. */ -typedef struct fixup_edge_d +struct fixup_edge_type { int src; int dest; @@ -91,21 +91,21 @@ typedef struct fixup_edge_d gcov_type weight; gcov_type cost; gcov_type max_capacity; -} fixup_edge_type; +}; typedef fixup_edge_type *fixup_edge_p; /* Structure to represent a vertex in the fixup graph. */ -typedef struct fixup_vertex_d +struct fixup_vertex_type { vec<fixup_edge_p> succ_edges; -} fixup_vertex_type; +}; typedef fixup_vertex_type *fixup_vertex_p; /* Fixup graph used in the MCF algorithm. */ -typedef struct fixup_graph_d +struct fixup_graph_type { /* Current number of vertices for the graph. */ int num_vertices; @@ -119,18 +119,18 @@ typedef struct fixup_graph_d fixup_vertex_p vertex_list; /* Fixup edge list. */ fixup_edge_p edge_list; -} fixup_graph_type; +}; -typedef struct queue_d +struct queue_type { int *queue; int head; int tail; int size; -} queue_type; +}; /* Structure used in the maximal flow routines to find augmenting path. */ -typedef struct augmenting_path_d +struct augmenting_path_type { /* Queue used to hold vertex indices. */ queue_type queue_list; @@ -138,7 +138,7 @@ typedef struct augmenting_path_d int *bb_pred; /* Vector that indicates if basic block i has been visited. */ int *is_visited; -} augmenting_path_type; +}; /* Function definitions. */ diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index d9596c33e10..5604ddefc18 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -171,8 +171,6 @@ struct ps_reg_move_info rtx_insn *insn; }; -typedef struct ps_reg_move_info ps_reg_move_info; - /* Holds the partial schedule as an array of II rows. Each entry of the array points to a linked list of PS_INSNs, which represents the instructions that are scheduled for that row. */ @@ -257,8 +255,6 @@ typedef struct node_sched_params u will precede v if column (u) < column (v). */ int column; } *node_sched_params_ptr; - -typedef struct node_sched_params node_sched_params; /* The following three functions are copied from the current scheduler code in order to use sched_analyze() for computing the dependencies. diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 62590fb5f39..e1c730ebeac 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,8 @@ +2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> + + * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: + Remove useless typedefs. + 2015-07-12 Aldy Hernandez <aldyh@redhat.com> * objc-map.h: Fix double word typos. diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h index 337f2510448..55afba417d4 100644 --- a/gcc/objc/objc-act.h +++ b/gcc/objc/objc-act.h @@ -95,11 +95,11 @@ void objc_common_init_ts (void); #define PROPERTY_NONATOMIC(DECL) \ DECL_LANG_FLAG_1 (PROPERTY_DECL_CHECK (DECL)) -typedef enum objc_property_assign_semantics { +enum objc_property_assign_semantics { OBJC_PROPERTY_ASSIGN = 1, OBJC_PROPERTY_RETAIN = 2, OBJC_PROPERTY_COPY = 3 -} objc_property_assign_semantics; +}; /* PROPERTY_ASSIGN_SEMANTICS can be OBJC_PROPERTY_ASSIGN, OBJC_PROPERTY_RETAIN or OBJC_PROPERTY_COPY. We need an integer to @@ -291,7 +291,7 @@ extern GTY(()) struct imp_entry *imp_list; extern GTY(()) int imp_count; /* `@implementation' */ extern GTY(()) int cat_count; /* `@category' */ -extern GTY(()) objc_ivar_visibility_kind objc_ivar_visibility; +extern GTY(()) enum objc_ivar_visibility_kind objc_ivar_visibility; /* Objective-C/Objective-C++ global tree enumeration. */ @@ -645,13 +645,13 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX]; #define TAG_ENUMERATION_MUTATION "objc_enumerationMutation" #define TAG_FAST_ENUMERATION_STATE "__objcFastEnumerationState" -typedef enum string_section +enum string_section { class_names, /* class, category, protocol, module names */ meth_var_names, /* method and variable names */ meth_var_types, /* method and variable type descriptors */ prop_names_attr /* property names and their attributes. */ -} string_section; +}; #define METHOD_DEF 0 #define METHOD_REF 1 diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c index 4f4aff92b48..73b591e830c 100644 --- a/gcc/objc/objc-next-runtime-abi-02.c +++ b/gcc/objc/objc-next-runtime-abi-02.c @@ -1014,10 +1014,10 @@ next_runtime_abi_02_string_decl (tree type, const char *name, string_section wh /* NOTE --- entry --- */ -typedef struct GTY(()) ident_data_tuple { +struct GTY(()) ident_data_tuple { tree ident; tree data; -} ident_data_tuple ; +}; /* This routine creates a file scope static variable of type 'Class' to hold the address of a class. */ @@ -1198,11 +1198,11 @@ build_v2_message_reference_decl (tree sel_name, tree message_func_ident) return decl; } -typedef struct GTY(()) msgref_entry { +struct GTY(()) msgref_entry { tree func; tree selname; tree refdecl; -} msgref_entry; +}; static GTY (()) vec<msgref_entry, va_gc> *msgrefs; @@ -1254,10 +1254,10 @@ build_v2_protocollist_ref_decl (tree protocol) return decl; } -typedef struct GTY(()) prot_list_entry { +struct GTY(()) prot_list_entry { tree id; tree refdecl; -} prot_list_entry; +}; static GTY (()) vec<prot_list_entry, va_gc> *protrefs; static tree @@ -2758,11 +2758,11 @@ generate_v2_category (struct imp_entry *impent) /* This routine declares a variable to hold the offset for ivar FIELD_DECL. Variable name is .objc_ivar.ClassName.IvarName. */ -typedef struct GTY(()) ivarref_entry +struct GTY(()) ivarref_entry { tree decl; tree offset; -} ivarref_entry; +}; static GTY (()) vec<ivarref_entry, va_gc> *ivar_offset_refs; diff --git a/gcc/objc/objc-runtime-hooks.h b/gcc/objc/objc-runtime-hooks.h index 5d7c02e29d1..a97aa016666 100644 --- a/gcc/objc/objc-runtime-hooks.h +++ b/gcc/objc/objc-runtime-hooks.h @@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see differences from the parser's perspective. */ /* TODO: Do we want the initial underscore ? */ -typedef struct _objc_runtime_hooks_r +struct objc_runtime_hooks { /* TODO: Expand comments in this file. */ @@ -97,7 +97,7 @@ typedef struct _objc_runtime_hooks_r during parsing. */ void (*generate_metadata) (void); -} objc_runtime_hooks; +}; /* For shared support that needs to access these. */ extern objc_runtime_hooks runtime; diff --git a/gcc/omp-low.c b/gcc/omp-low.c index c1dc9191c42..7cf51b3fade 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -142,7 +142,7 @@ struct omp_region /* Context structure. Used to store information about each parallel directive in the code. */ -typedef struct omp_context +struct omp_context { /* This field must be at the beginning, as we do "inheritance": Some callback functions for tree-inline.c (e.g., omp_copy_decl) @@ -204,7 +204,7 @@ typedef struct omp_context this level and above. For parallel and kernels clauses, a mask indicating which of num_gangs/num_workers/num_vectors was used. */ int gwv_this; -} omp_context; +}; /* A structure holding the elements of: for (V = N1; V cond N2; V += STEP) [...] */ diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c index 0f9e618879a..ff08505badc 100644 --- a/gcc/read-rtl.c +++ b/gcc/read-rtl.c @@ -80,9 +80,6 @@ struct iterator_use { void *ptr; }; -/* Vector definitions for the above. */ -typedef struct iterator_use iterator_use; - /* Records one use of an attribute (the "<[iterator:]attribute>" syntax) in a non-string rtx field. */ struct attribute_use { @@ -96,9 +93,6 @@ struct attribute_use { void *ptr; }; -/* Vector definitions for the above. */ -typedef struct attribute_use attribute_use; - /* This struct is used to link subst_attr named ATTR_NAME with corresponding define_subst named ITER_NAME. */ struct subst_attr_to_iter_mapping diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index ce2c1724fff..2ebb63567fe 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -140,22 +140,20 @@ static state_t *bb_state = NULL; while other blocks in the region from which insns can be moved to the target are called "source" blocks. The candidate structure holds info about such sources: are they valid? Speculative? Etc. */ -typedef struct +struct bblst { basic_block *first_member; int nr_members; -} -bblst; +}; -typedef struct +struct candidate { char is_valid; char is_speculative; int src_prob; bblst split_bbs; bblst update_bbs; -} -candidate; +}; static candidate *candidate_table; #define IS_VALID(src) (candidate_table[src].is_valid) @@ -168,12 +166,11 @@ static candidate *candidate_table; int target_bb; /* List of edges. */ -typedef struct +struct edgelst { edge *first_member; int nr_members; -} -edgelst; +}; static edge *edgelst_table; static int edgelst_last; diff --git a/gcc/signop.h b/gcc/signop.h index bc760eab5ef..94024d10395 100644 --- a/gcc/signop.h +++ b/gcc/signop.h @@ -25,11 +25,9 @@ along with GCC; see the file COPYING3. If not see unsigned types. The signedness of a tree type can be found by using the TYPE_SIGN macro. */ -enum signop_e { +enum signop { SIGNED, UNSIGNED }; -typedef enum signop_e signop; - #endif diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c index 6e9b14c6f1c..874d853d922 100644 --- a/gcc/tree-call-cdce.c +++ b/gcc/tree-call-cdce.c @@ -86,7 +86,7 @@ along with GCC; see the file COPYING3. If not see to indicate if lb and ub value are inclusive respectively. */ -typedef struct input_domain +struct inp_domain { int lb; int ub; @@ -94,7 +94,7 @@ typedef struct input_domain bool has_ub; bool is_lb_inclusive; bool is_ub_inclusive; -} inp_domain; +}; /* A helper function to construct and return an input domain object. LB is the lower bound, HAS_LB is diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 9fcc450f896..229fb2ff051 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -830,12 +830,11 @@ stmt_references_abnormal_ssa_name (gimple stmt) } /* Pair of tree and a sorting index, for dump_enumerated_decls. */ -struct GTY(()) numbered_tree_d +struct GTY(()) numbered_tree { tree t; int num; }; -typedef struct numbered_tree_d numbered_tree; /* Compare two declarations references by their DECL_UID / sequence number. diff --git a/gcc/tree-diagnostic.c b/gcc/tree-diagnostic.c index 79048c5efda..135f142d9ee 100644 --- a/gcc/tree-diagnostic.c +++ b/gcc/tree-diagnostic.c @@ -56,11 +56,11 @@ default_tree_diagnostic_starter (diagnostic_context *context, /* This is a pair made of a location and the line map it originated from. It's used in the maybe_unwind_expanded_macro_loc function below. */ -typedef struct +struct loc_map_pair { const line_map_macro *map; source_location where; -} loc_map_pair; +}; /* Unwind the different macro expansions that lead to the token which diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h index 58af9cdb7ba..3c53190c73f 100644 --- a/gcc/tree-inline.h +++ b/gcc/tree-inline.h @@ -152,7 +152,7 @@ struct copy_body_data /* Weights of constructions for estimate_num_insns. */ -typedef struct eni_weights_d +struct eni_weights { /* Cost per call. */ unsigned call_cost; @@ -179,7 +179,7 @@ typedef struct eni_weights_d cost of a switch statement is logarithmic rather than linear in number of cases. */ bool time_based; -} eni_weights; +}; /* Weights that estimate_num_insns uses for heuristics in inlining. */ diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 321916028bb..54fe223cf0d 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -895,11 +895,11 @@ get_loop_exit_condition (const struct loop *loop) /* Depth first search algorithm. */ -typedef enum t_bool { +enum t_bool { t_false, t_true, t_dont_know -} t_bool; +}; static t_bool follow_ssa_edge (struct loop *loop, gimple, gphi *, diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c index 910ee3c9889..042f9c9923b 100644 --- a/gcc/tree-ssa-address.c +++ b/gcc/tree-ssa-address.c @@ -85,13 +85,13 @@ along with GCC; see the file COPYING3. If not see /* A "template" for memory address, used to determine whether the address is valid for mode. */ -typedef struct GTY (()) mem_addr_template { +struct GTY (()) mem_addr_template { rtx ref; /* The template. */ rtx * GTY ((skip)) step_p; /* The point in template where the step should be filled in. */ rtx * GTY ((skip)) off_p; /* The point in template where the offset should be filled in. */ -} mem_addr_template; +}; /* The templates. Each of the low five bits of the index corresponds to one diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index d46e6c2a6ff..4e9a2acb19d 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -73,10 +73,10 @@ along with GCC; see the file COPYING3. If not see /* Bounds on some value, BELOW <= X <= UP. */ -typedef struct +struct bounds { mpz_t below, up; -} bounds; +}; /* Splits expression EXPR to a variable part VAR and constant OFFSET. */ diff --git a/gcc/tree-ssa-loop.h b/gcc/tree-ssa-loop.h index 0e637c916c1..fc7e67b89b3 100644 --- a/gcc/tree-ssa-loop.h +++ b/gcc/tree-ssa-loop.h @@ -65,7 +65,7 @@ struct tree_niter_desc extern bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *); extern char *get_lsm_tmp_name (tree ref, unsigned n, const char *suffix = NULL); -extern unsigned tree_num_loop_insns (struct loop *, struct eni_weights_d *); +extern unsigned tree_num_loop_insns (struct loop *, struct eni_weights *); /* Returns the loop of the statement STMT. */ diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 697958def0c..1bf8558a03d 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -184,13 +184,13 @@ enum pre_expr_kind CONSTANT }; -typedef union pre_expr_union_d +union pre_expr_union { tree name; tree constant; vn_nary_op_t nary; vn_reference_t reference; -} pre_expr_union; +}; typedef struct pre_expr_d : nofree_ptr_hash <pre_expr_d> { diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index efb813c3efa..45e7b611fa1 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -991,12 +991,12 @@ static void linearize_expr_tree (vec<operand_entry_t> *, gimple, bool, bool); /* Structure for tracking and counting operands. */ -typedef struct oecount_s { +struct oecount { int cnt; int id; enum tree_code oecode; tree op; -} oecount; +}; /* The heap for the oecount hashtable and the sorted list of operands. */ diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h index 717fc288d8a..41d14afdcba 100644 --- a/gcc/tree-ssa-sccvn.h +++ b/gcc/tree-ssa-sccvn.h @@ -188,7 +188,7 @@ typedef struct vn_ssa_aux unsigned needs_insertion : 1; } *vn_ssa_aux_t; -typedef enum { VN_NOWALK, VN_WALK, VN_WALKREWRITE } vn_lookup_kind; +enum vn_lookup_kind { VN_NOWALK, VN_WALK, VN_WALKREWRITE }; /* Return the value numbering info for an SSA_NAME. */ extern vn_ssa_aux_t VN_INFO (tree); diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index c1f3c32b526..44979193ca9 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -479,7 +479,7 @@ get_call_clobber_vi (gcall *call) } -typedef enum {SCALAR, DEREF, ADDRESSOF} constraint_expr_type; +enum constraint_expr_type {SCALAR, DEREF, ADDRESSOF}; /* An expression that appears in a constraint. */ diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c index 3f007b5d3b1..ec6d6f5a747 100644 --- a/gcc/tree-ssa-uninit.c +++ b/gcc/tree-ssa-uninit.c @@ -483,13 +483,13 @@ compute_control_dep_chain (basic_block bb, basic_block dep_bb, /* The type to represent a simple predicate */ -typedef struct use_def_pred_info +struct pred_info { tree pred_lhs; tree pred_rhs; enum tree_code cond_code; bool invert; -} pred_info; +}; /* The type to represent a sequence of predicates grouped with .AND. operation. */ diff --git a/gcc/tree-ssa.h b/gcc/tree-ssa.h index 8d598a6a1aa..d00db6a1b43 100644 --- a/gcc/tree-ssa.h +++ b/gcc/tree-ssa.h @@ -21,12 +21,11 @@ along with GCC; see the file COPYING3. If not see #define GCC_TREE_SSA_H /* Mapping for redirected edges. */ -struct _edge_var_map { +struct edge_var_map { tree result; /* PHI result. */ tree def; /* PHI arg definition. */ source_location locus; /* PHI arg location. */ }; -typedef struct _edge_var_map edge_var_map; /* A vector of var maps. */ typedef vec<edge_var_map, va_heap, vl_embed> edge_var_map_vector; diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index efcc4bb0336..4feab782bd2 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -118,11 +118,11 @@ rename_variables_in_bb (basic_block bb, bool rename_from_outer_loop) } -typedef struct +struct adjust_info { tree from, to; basic_block bb; -} adjust_info; +}; /* A stack of values to be adjusted in debug stmts. We have to process them LIFO, so that the closest substitution applies. If we diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 4b9837861a6..58e8f10a722 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -66,12 +66,12 @@ enum vect_def_type { /* Structure to encapsulate information about a group of like instructions to be presented to the target cost model. */ -typedef struct _stmt_info_for_cost { +struct stmt_info_for_cost { int count; enum vect_cost_for_stmt kind; gimple stmt; int misalign; -} stmt_info_for_cost; +}; typedef vec<stmt_info_for_cost> stmt_vector_for_cost; diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 685eb726a0d..21fbed08115 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -173,10 +173,10 @@ static bool values_propagated; node. */ static int *vr_phi_edge_counts; -typedef struct { +struct switch_update { gswitch *stmt; tree vec; -} switch_update; +}; static vec<edge> to_remove_edges; static vec<switch_update> to_update_switch_stmts; diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index a31a1376007..cd394a0c8ac 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -175,7 +175,7 @@ enum emit_note_where }; /* Structure holding information about micro operation. */ -typedef struct micro_operation_def +struct micro_operation { /* Type of micro operation. */ enum micro_operation_type type; @@ -199,7 +199,7 @@ typedef struct micro_operation_def /* Stack adjustment. */ HOST_WIDE_INT adjust; } u; -} micro_operation; +}; /* A declaration of a variable, or an RTL value being handled like a @@ -283,23 +283,23 @@ typedef struct location_chain_def DV on VALUEs, i.e., the VALUEs expanded so as to form the current location of DV. Each entry is also part of VALUE' s linked-list of backlinks back to DV. */ -typedef struct loc_exp_dep_s +struct loc_exp_dep { /* The dependent DV. */ decl_or_value dv; /* The dependency VALUE or DECL_DEBUG. */ rtx value; /* The next entry in VALUE's backlinks list. */ - struct loc_exp_dep_s *next; + struct loc_exp_dep *next; /* A pointer to the pointer to this entry (head or prev's next) in the doubly-linked list. */ - struct loc_exp_dep_s **pprev; -} loc_exp_dep; + struct loc_exp_dep **pprev; +}; /* This data structure holds information about the depth of a variable expansion. */ -typedef struct expand_depth_struct +struct expand_depth { /* This measures the complexity of the expanded expression. It grows by one for each level of expansion that adds more than one @@ -308,7 +308,7 @@ typedef struct expand_depth_struct /* This counts the number of ENTRY_VALUE expressions in an expansion. We want to minimize their use. */ int entryvals; -} expand_depth; +}; /* This data structure is allocated for one-part variables at the time of emitting notes. */ @@ -334,7 +334,7 @@ struct onepart_aux }; /* Structure describing one part of variable. */ -typedef struct variable_part_def +struct variable_part { /* Chain of locations of the part. */ location_chain loc_chain; @@ -350,7 +350,7 @@ typedef struct variable_part_def /* Pointer to auxiliary data, if var->onepart and emit_notes. */ struct onepart_aux *onepaux; } aux; -} variable_part; +}; /* Maximum number of location parts. */ #define MAX_VAR_PARTS 16 @@ -511,7 +511,7 @@ typedef variable_table_type::iterator variable_iterator_type; /* Structure for passing some other parameters to function emit_note_insn_var_location. */ -typedef struct emit_note_data_def +struct emit_note_data { /* The instruction which the note will be emitted before/after. */ rtx_insn *insn; @@ -521,7 +521,7 @@ typedef struct emit_note_data_def /* The variables and values active at this point. */ variable_table_type *vars; -} emit_note_data; +}; /* Structure holding a refcounted hash table. If refcount > 1, it must be first unshared before modified. */ @@ -535,7 +535,7 @@ typedef struct shared_hash_def } *shared_hash; /* Structure holding the IN or OUT set for a basic block. */ -typedef struct dataflow_set_def +struct dataflow_set { /* Adjustment of stack offset. */ HOST_WIDE_INT stack_adjust; @@ -548,7 +548,7 @@ typedef struct dataflow_set_def /* Vars that is being traversed. */ shared_hash traversed_vars; -} dataflow_set; +}; /* The structure (one for each basic block) containing the information needed for variable tracking. */ |