diff options
Diffstat (limited to 'scripts/gcc-plugins')
| -rw-r--r-- | scripts/gcc-plugins/gcc-common.h | 55 |
1 files changed, 44 insertions, 11 deletions
diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h index 12262c0cc691..b232ab15624c 100644 --- a/scripts/gcc-plugins/gcc-common.h +++ b/scripts/gcc-plugins/gcc-common.h | |||
| @@ -26,6 +26,9 @@ | |||
| 26 | #include "except.h" | 26 | #include "except.h" |
| 27 | #include "function.h" | 27 | #include "function.h" |
| 28 | #include "toplev.h" | 28 | #include "toplev.h" |
| 29 | #if BUILDING_GCC_VERSION >= 5000 | ||
| 30 | #include "expr.h" | ||
| 31 | #endif | ||
| 29 | #include "basic-block.h" | 32 | #include "basic-block.h" |
| 30 | #include "intl.h" | 33 | #include "intl.h" |
| 31 | #include "ggc.h" | 34 | #include "ggc.h" |
| @@ -80,6 +83,9 @@ | |||
| 80 | #include "diagnostic.h" | 83 | #include "diagnostic.h" |
| 81 | #include "tree-dump.h" | 84 | #include "tree-dump.h" |
| 82 | #include "tree-pass.h" | 85 | #include "tree-pass.h" |
| 86 | #if BUILDING_GCC_VERSION >= 4009 | ||
| 87 | #include "pass_manager.h" | ||
| 88 | #endif | ||
| 83 | #include "predict.h" | 89 | #include "predict.h" |
| 84 | #include "ipa-utils.h" | 90 | #include "ipa-utils.h" |
| 85 | 91 | ||
| @@ -119,20 +125,17 @@ | |||
| 119 | #include "builtins.h" | 125 | #include "builtins.h" |
| 120 | #endif | 126 | #endif |
| 121 | 127 | ||
| 122 | /* #include "expr.h" where are you... */ | ||
| 123 | extern rtx emit_move_insn(rtx x, rtx y); | ||
| 124 | |||
| 125 | /* missing from basic_block.h... */ | 128 | /* missing from basic_block.h... */ |
| 126 | extern void debug_dominance_info(enum cdi_direction dir); | 129 | void debug_dominance_info(enum cdi_direction dir); |
| 127 | extern void debug_dominance_tree(enum cdi_direction dir, basic_block root); | 130 | void debug_dominance_tree(enum cdi_direction dir, basic_block root); |
| 128 | 131 | ||
| 129 | #if BUILDING_GCC_VERSION == 4006 | 132 | #if BUILDING_GCC_VERSION == 4006 |
| 130 | extern void debug_gimple_stmt(gimple); | 133 | void debug_gimple_stmt(gimple); |
| 131 | extern void debug_gimple_seq(gimple_seq); | 134 | void debug_gimple_seq(gimple_seq); |
| 132 | extern void print_gimple_seq(FILE *, gimple_seq, int, int); | 135 | void print_gimple_seq(FILE *, gimple_seq, int, int); |
| 133 | extern void print_gimple_stmt(FILE *, gimple, int, int); | 136 | void print_gimple_stmt(FILE *, gimple, int, int); |
| 134 | extern void print_gimple_expr(FILE *, gimple, int, int); | 137 | void print_gimple_expr(FILE *, gimple, int, int); |
| 135 | extern void dump_gimple_stmt(pretty_printer *, gimple, int, int); | 138 | void dump_gimple_stmt(pretty_printer *, gimple, int, int); |
| 136 | #endif | 139 | #endif |
| 137 | 140 | ||
| 138 | #define __unused __attribute__((__unused__)) | 141 | #define __unused __attribute__((__unused__)) |
| @@ -146,6 +149,29 @@ extern void dump_gimple_stmt(pretty_printer *, gimple, int, int); | |||
| 146 | /* should come from c-tree.h if only it were installed for gcc 4.5... */ | 149 | /* should come from c-tree.h if only it were installed for gcc 4.5... */ |
| 147 | #define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1(TYPE) | 150 | #define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1(TYPE) |
| 148 | 151 | ||
| 152 | static inline tree build_const_char_string(int len, const char *str) | ||
| 153 | { | ||
| 154 | tree cstr, elem, index, type; | ||
| 155 | |||
| 156 | cstr = build_string(len, str); | ||
| 157 | elem = build_type_variant(char_type_node, 1, 0); | ||
| 158 | index = build_index_type(size_int(len - 1)); | ||
| 159 | type = build_array_type(elem, index); | ||
| 160 | TREE_TYPE(cstr) = type; | ||
| 161 | TREE_CONSTANT(cstr) = 1; | ||
| 162 | TREE_READONLY(cstr) = 1; | ||
| 163 | TREE_STATIC(cstr) = 1; | ||
| 164 | return cstr; | ||
| 165 | } | ||
| 166 | |||
| 167 | #define PASS_INFO(NAME, REF, ID, POS) \ | ||
| 168 | struct register_pass_info NAME##_pass_info = { \ | ||
| 169 | .pass = make_##NAME##_pass(), \ | ||
| 170 | .reference_pass_name = REF, \ | ||
| 171 | .ref_pass_instance_number = ID, \ | ||
| 172 | .pos_op = POS, \ | ||
| 173 | } | ||
| 174 | |||
| 149 | #if BUILDING_GCC_VERSION == 4005 | 175 | #if BUILDING_GCC_VERSION == 4005 |
| 150 | #define FOR_EACH_LOCAL_DECL(FUN, I, D) \ | 176 | #define FOR_EACH_LOCAL_DECL(FUN, I, D) \ |
| 151 | for (tree vars = (FUN)->local_decls, (I) = 0; \ | 177 | for (tree vars = (FUN)->local_decls, (I) = 0; \ |
| @@ -527,6 +553,8 @@ static inline const greturn *as_a_const_greturn(const_gimple stmt) | |||
| 527 | #define section_name_prefix LTO_SECTION_NAME_PREFIX | 553 | #define section_name_prefix LTO_SECTION_NAME_PREFIX |
| 528 | #define fatal_error(loc, gmsgid, ...) fatal_error((gmsgid), __VA_ARGS__) | 554 | #define fatal_error(loc, gmsgid, ...) fatal_error((gmsgid), __VA_ARGS__) |
| 529 | 555 | ||
| 556 | rtx emit_move_insn(rtx x, rtx y); | ||
| 557 | |||
| 530 | typedef struct rtx_def rtx_insn; | 558 | typedef struct rtx_def rtx_insn; |
| 531 | 559 | ||
| 532 | static inline const char *get_decl_section_name(const_tree decl) | 560 | static inline const char *get_decl_section_name(const_tree decl) |
| @@ -643,6 +671,11 @@ static inline const greturn *as_a_const_greturn(const_gimple stmt) | |||
| 643 | #define NODE_DECL(node) (node)->decl | 671 | #define NODE_DECL(node) (node)->decl |
| 644 | #define cgraph_node_name(node) (node)->name() | 672 | #define cgraph_node_name(node) (node)->name() |
| 645 | #define NODE_IMPLICIT_ALIAS(node) (node)->cpp_implicit_alias | 673 | #define NODE_IMPLICIT_ALIAS(node) (node)->cpp_implicit_alias |
| 674 | |||
| 675 | static inline opt_pass *get_pass_for_id(int id) | ||
| 676 | { | ||
| 677 | return g->get_passes()->get_pass_for_id(id); | ||
| 678 | } | ||
| 646 | #endif | 679 | #endif |
| 647 | 680 | ||
| 648 | #if BUILDING_GCC_VERSION >= 5000 && BUILDING_GCC_VERSION < 6000 | 681 | #if BUILDING_GCC_VERSION >= 5000 && BUILDING_GCC_VERSION < 6000 |
