History

gcc-plugins: remove support for GCC 4.9 and older

The minimum GCC version has been bumped to 5.1, so we can get rid of all the compatibility code for anything older than that.

Ard Biesheuvel committed 5 years ago

Commit 4c78c721 parent f02003c6 files · +1 −208Browse files

Showing the changes to scripts (6 of 6 files). Show all

Unified · Split

6 files
  1. scripts/gcc-plugins/gcc-common.h +1 −130
  2. scripts/gcc-plugins/gcc-generate-gimple-pass.h +0 −19
  3. scripts/gcc-plugins/gcc-generate-ipa-pass.h +0 −19
  4. scripts/gcc-plugins/gcc-generate-rtl-pass.h +0 −19
  5. scripts/gcc-plugins/gcc-generate-simple_ipa-pass.h +0 −19
  6. scripts/gcc-plugins/structleak_plugin.c +0 −2
scripts/gcc-plugins/gcc-common.h+1−130
@@ -27,9 +27,7 @@ · 26 unmodified lines
27#include "except.h"27#include "except.h"
28#include "function.h"28#include "function.h"
29#include "toplev.h"29#include "toplev.h"
30#if BUILDING_GCC_VERSION >= 5000
31#include "expr.h"30#include "expr.h"
32#endif
33#include "basic-block.h"31#include "basic-block.h"
34#include "intl.h"32#include "intl.h"
35#include "ggc.h"33#include "ggc.h"
@@ -39,11 +37,7 @@ · 3 unmodified lines
39#include "params.h"37#include "params.h"
40#endif38#endif
41 39
42#if BUILDING_GCC_VERSION <= 4009
43#include "pointer-set.h"
44#else
45#include "hash-map.h"40#include "hash-map.h"
46#endif
47 41
48#if BUILDING_GCC_VERSION >= 700042#if BUILDING_GCC_VERSION >= 7000
49#include "memmodel.h"43#include "memmodel.h"
@@ -99,9 +93,7 @@ · 49 unmodified lines
99#include "gimple-ssa.h"93#include "gimple-ssa.h"
100#include "ssa-iterators.h"94#include "ssa-iterators.h"
101 95
102#if BUILDING_GCC_VERSION >= 5000
103#include "builtins.h"96#include "builtins.h"
104#endif
105 97
106/* missing from basic_block.h... */98/* missing from basic_block.h... */
107void debug_dominance_info(enum cdi_direction dir);99void debug_dominance_info(enum cdi_direction dir);
@@ -152,125 +144,6 @@ struct register_pass_info NAME##_pass_info = { \ · 44 unmodified lines
152#define TODO_dump_func 0144#define TODO_dump_func 0
153#define TODO_dump_cgraph 0145#define TODO_dump_cgraph 0
154 146
155#if BUILDING_GCC_VERSION <= 4009
156#define TODO_verify_il 0
157#define AVAIL_INTERPOSABLE AVAIL_OVERWRITABLE
158
159#define section_name_prefix LTO_SECTION_NAME_PREFIX
160#define fatal_error(loc, gmsgid, ...) fatal_error((gmsgid), __VA_ARGS__)
161
162rtx emit_move_insn(rtx x, rtx y);
163
164typedef struct rtx_def rtx_insn;
165
166static inline const char *get_decl_section_name(const_tree decl)
167{
168 if (DECL_SECTION_NAME(decl) == NULL_TREE)
169 return NULL;
170
171 return TREE_STRING_POINTER(DECL_SECTION_NAME(decl));
172}
173
174static inline void set_decl_section_name(tree node, const char *value)
175{
176 if (value)
177 DECL_SECTION_NAME(node) = build_string(strlen(value) + 1, value);
178 else
179 DECL_SECTION_NAME(node) = NULL;
180}
181#endif
182
183#if BUILDING_GCC_VERSION == 4009
184typedef struct gimple_statement_asm gasm;
185typedef struct gimple_statement_base gassign;
186typedef struct gimple_statement_call gcall;
187typedef struct gimple_statement_base gcond;
188typedef struct gimple_statement_base gdebug;
189typedef struct gimple_statement_base ggoto;
190typedef struct gimple_statement_phi gphi;
191typedef struct gimple_statement_base greturn;
192
193static inline gasm *as_a_gasm(gimple stmt)
194{
195 return as_a<gasm>(stmt);
196}
197
198static inline const gasm *as_a_const_gasm(const_gimple stmt)
199{
200 return as_a<const gasm>(stmt);
201}
202
203static inline gassign *as_a_gassign(gimple stmt)
204{
205 return stmt;
206}
207
208static inline const gassign *as_a_const_gassign(const_gimple stmt)
209{
210 return stmt;
211}
212
213static inline gcall *as_a_gcall(gimple stmt)
214{
215 return as_a<gcall>(stmt);
216}
217
218static inline const gcall *as_a_const_gcall(const_gimple stmt)
219{
220 return as_a<const gcall>(stmt);
221}
222
223static inline gcond *as_a_gcond(gimple stmt)
224{
225 return stmt;
226}
227
228static inline const gcond *as_a_const_gcond(const_gimple stmt)
229{
230 return stmt;
231}
232
233static inline gdebug *as_a_gdebug(gimple stmt)
234{
235 return stmt;
236}
237
238static inline const gdebug *as_a_const_gdebug(const_gimple stmt)
239{
240 return stmt;
241}
242
243static inline ggoto *as_a_ggoto(gimple stmt)
244{
245 return stmt;
246}
247
248static inline const ggoto *as_a_const_ggoto(const_gimple stmt)
249{
250 return stmt;
251}
252
253static inline gphi *as_a_gphi(gimple stmt)
254{
255 return as_a<gphi>(stmt);
256}
257
258static inline const gphi *as_a_const_gphi(const_gimple stmt)
259{
260 return as_a<const gphi>(stmt);
261}
262
263static inline greturn *as_a_greturn(gimple stmt)
264{
265 return stmt;
266}
267
268static inline const greturn *as_a_const_greturn(const_gimple stmt)
269{
270 return stmt;
271}
272#endif
273
274#define TODO_ggc_collect 0147#define TODO_ggc_collect 0
275#define NODE_SYMBOL(node) (node)148#define NODE_SYMBOL(node) (node)
276#define NODE_DECL(node) (node)->decl149#define NODE_DECL(node) (node)->decl
@@ -282,7 +155,7 @@ static inline opt_pass *get_pass_for_id(int id) · 5 unmodified lines
282 return g->get_passes()->get_pass_for_id(id);155 return g->get_passes()->get_pass_for_id(id);
283}156}
284 157
285#if BUILDING_GCC_VERSION >= 5000 && BUILDING_GCC_VERSION < 6000158#if BUILDING_GCC_VERSION < 6000
286/* gimple related */159/* gimple related */
287template <>160template <>
288template <>161template <>
@@ -292,7 +165,6 @@ inline bool is_a_helper<const gassign *>::test(const_gimple gs) · 3 unmodified lines
292}165}
293#endif166#endif
294 167
295#if BUILDING_GCC_VERSION >= 5000
296#define TODO_verify_ssa TODO_verify_il168#define TODO_verify_ssa TODO_verify_il
297#define TODO_verify_flow TODO_verify_il169#define TODO_verify_flow TODO_verify_il
298#define TODO_verify_stmts TODO_verify_il170#define TODO_verify_stmts TODO_verify_il
@@ -533,7 +405,6 @@ static inline void ipa_remove_stmt_references(symtab_node *referring_node, gimpl · 234 unmodified lines
533{405{
534 referring_node->remove_stmt_references(stmt);406 referring_node->remove_stmt_references(stmt);
535}407}
536#endif
537 408
538#if BUILDING_GCC_VERSION < 6000409#if BUILDING_GCC_VERSION < 6000
539#define get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep, keep_aligning) \410#define get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep, keep_aligning) \
scripts/gcc-plugins/gcc-generate-gimple-pass.h+0−19
@@ -78,17 +78,6 @@ static const pass_data _PASS_NAME_PASS_DATA = { · 77 unmodified lines
78 .type = GIMPLE_PASS,78 .type = GIMPLE_PASS,
79 .name = _PASS_NAME_NAME,79 .name = _PASS_NAME_NAME,
80 .optinfo_flags = OPTGROUP_NONE,80 .optinfo_flags = OPTGROUP_NONE,
81#if BUILDING_GCC_VERSION >= 5000
82#elif BUILDING_GCC_VERSION == 4009
83 .has_gate = _HAS_GATE,
84 .has_execute = _HAS_EXECUTE,
85#else
86 .gate = _GATE,
87 .execute = _EXECUTE,
88 .sub = NULL,
89 .next = NULL,
90 .static_pass_number = 0,
91#endif
92 .tv_id = TV_NONE,81 .tv_id = TV_NONE,
93 .properties_required = PROPERTIES_REQUIRED,82 .properties_required = PROPERTIES_REQUIRED,
94 .properties_provided = PROPERTIES_PROVIDED,83 .properties_provided = PROPERTIES_PROVIDED,
@@ -102,21 +91,13 @@ public: · 7 unmodified lines
102 _PASS_NAME_PASS() : gimple_opt_pass(_PASS_NAME_PASS_DATA, g) {}91 _PASS_NAME_PASS() : gimple_opt_pass(_PASS_NAME_PASS_DATA, g) {}
103 92
104#ifndef NO_GATE93#ifndef NO_GATE
105#if BUILDING_GCC_VERSION >= 5000
106 virtual bool gate(function *) { return _GATE(); }94 virtual bool gate(function *) { return _GATE(); }
107#else
108 virtual bool gate(void) { return _GATE(); }
109#endif
110#endif95#endif
111 96
112 virtual opt_pass * clone () { return new _PASS_NAME_PASS(); }97 virtual opt_pass * clone () { return new _PASS_NAME_PASS(); }
113 98
114#ifndef NO_EXECUTE99#ifndef NO_EXECUTE
115#if BUILDING_GCC_VERSION >= 5000
116 virtual unsigned int execute(function *) { return _EXECUTE(); }100 virtual unsigned int execute(function *) { return _EXECUTE(); }
117#else
118 virtual unsigned int execute(void) { return _EXECUTE(); }
119#endif
120};101};
121}102}
122 103
scripts/gcc-plugins/gcc-generate-ipa-pass.h+0−19
@@ -146,17 +146,6 @@ static const pass_data _PASS_NAME_PASS_DATA = { · 145 unmodified lines
146 .type = IPA_PASS,146 .type = IPA_PASS,
147 .name = _PASS_NAME_NAME,147 .name = _PASS_NAME_NAME,
148 .optinfo_flags = OPTGROUP_NONE,148 .optinfo_flags = OPTGROUP_NONE,
149#if BUILDING_GCC_VERSION >= 5000
150#elif BUILDING_GCC_VERSION == 4009
151 .has_gate = _HAS_GATE,
152 .has_execute = _HAS_EXECUTE,
153#else
154 .gate = _GATE,
155 .execute = _EXECUTE,
156 .sub = NULL,
157 .next = NULL,
158 .static_pass_number = 0,
159#endif
160 .tv_id = TV_NONE,149 .tv_id = TV_NONE,
161 .properties_required = PROPERTIES_REQUIRED,150 .properties_required = PROPERTIES_REQUIRED,
162 .properties_provided = PROPERTIES_PROVIDED,151 .properties_provided = PROPERTIES_PROVIDED,
@@ -180,20 +169,12 @@ public: · 17 unmodified lines
180 _VARIABLE_TRANSFORM) {}169 _VARIABLE_TRANSFORM) {}
181 170
182#ifndef NO_GATE171#ifndef NO_GATE
183#if BUILDING_GCC_VERSION >= 5000
184 virtual bool gate(function *) { return _GATE(); }172 virtual bool gate(function *) { return _GATE(); }
185#else
186 virtual bool gate(void) { return _GATE(); }
187#endif
188 173
189 virtual opt_pass *clone() { return new _PASS_NAME_PASS(); }174 virtual opt_pass *clone() { return new _PASS_NAME_PASS(); }
190 175
191#ifndef NO_EXECUTE176#ifndef NO_EXECUTE
192#if BUILDING_GCC_VERSION >= 5000
193 virtual unsigned int execute(function *) { return _EXECUTE(); }177 virtual unsigned int execute(function *) { return _EXECUTE(); }
194#else
195 virtual unsigned int execute(void) { return _EXECUTE(); }
196#endif
197#endif178#endif
198};179};
199}180}
scripts/gcc-plugins/gcc-generate-rtl-pass.h+0−19
@@ -78,17 +78,6 @@ static const pass_data _PASS_NAME_PASS_DATA = { · 77 unmodified lines
78 .type = RTL_PASS,78 .type = RTL_PASS,
79 .name = _PASS_NAME_NAME,79 .name = _PASS_NAME_NAME,
80 .optinfo_flags = OPTGROUP_NONE,80 .optinfo_flags = OPTGROUP_NONE,
81#if BUILDING_GCC_VERSION >= 5000
82#elif BUILDING_GCC_VERSION == 4009
83 .has_gate = _HAS_GATE,
84 .has_execute = _HAS_EXECUTE,
85#else
86 .gate = _GATE,
87 .execute = _EXECUTE,
88 .sub = NULL,
89 .next = NULL,
90 .static_pass_number = 0,
91#endif
92 .tv_id = TV_NONE,81 .tv_id = TV_NONE,
93 .properties_required = PROPERTIES_REQUIRED,82 .properties_required = PROPERTIES_REQUIRED,
94 .properties_provided = PROPERTIES_PROVIDED,83 .properties_provided = PROPERTIES_PROVIDED,
@@ -102,21 +91,13 @@ public: · 7 unmodified lines
102 _PASS_NAME_PASS() : rtl_opt_pass(_PASS_NAME_PASS_DATA, g) {}91 _PASS_NAME_PASS() : rtl_opt_pass(_PASS_NAME_PASS_DATA, g) {}
103 92
104#ifndef NO_GATE93#ifndef NO_GATE
105#if BUILDING_GCC_VERSION >= 5000
106 virtual bool gate(function *) { return _GATE(); }94 virtual bool gate(function *) { return _GATE(); }
107#else
108 virtual bool gate(void) { return _GATE(); }
109#endif
110#endif95#endif
111 96
112 virtual opt_pass *clone() { return new _PASS_NAME_PASS(); }97 virtual opt_pass *clone() { return new _PASS_NAME_PASS(); }
113 98
114#ifndef NO_EXECUTE99#ifndef NO_EXECUTE
115#if BUILDING_GCC_VERSION >= 5000
116 virtual unsigned int execute(function *) { return _EXECUTE(); }100 virtual unsigned int execute(function *) { return _EXECUTE(); }
117#else
118 virtual unsigned int execute(void) { return _EXECUTE(); }
119#endif
120#endif101#endif
121};102};
122}103}
scripts/gcc-plugins/gcc-generate-simple_ipa-pass.h+0−19
@@ -78,17 +78,6 @@ static const pass_data _PASS_NAME_PASS_DATA = { · 77 unmodified lines
78 .type = SIMPLE_IPA_PASS,78 .type = SIMPLE_IPA_PASS,
79 .name = _PASS_NAME_NAME,79 .name = _PASS_NAME_NAME,
80 .optinfo_flags = OPTGROUP_NONE,80 .optinfo_flags = OPTGROUP_NONE,
81#if BUILDING_GCC_VERSION >= 5000
82#elif BUILDING_GCC_VERSION == 4009
83 .has_gate = _HAS_GATE,
84 .has_execute = _HAS_EXECUTE,
85#else
86 .gate = _GATE,
87 .execute = _EXECUTE,
88 .sub = NULL,
89 .next = NULL,
90 .static_pass_number = 0,
91#endif
92 .tv_id = TV_NONE,81 .tv_id = TV_NONE,
93 .properties_required = PROPERTIES_REQUIRED,82 .properties_required = PROPERTIES_REQUIRED,
94 .properties_provided = PROPERTIES_PROVIDED,83 .properties_provided = PROPERTIES_PROVIDED,
@@ -102,21 +91,13 @@ public: · 7 unmodified lines
102 _PASS_NAME_PASS() : simple_ipa_opt_pass(_PASS_NAME_PASS_DATA, g) {}91 _PASS_NAME_PASS() : simple_ipa_opt_pass(_PASS_NAME_PASS_DATA, g) {}
103 92
104#ifndef NO_GATE93#ifndef NO_GATE
105#if BUILDING_GCC_VERSION >= 5000
106 virtual bool gate(function *) { return _GATE(); }94 virtual bool gate(function *) { return _GATE(); }
107#else
108 virtual bool gate(void) { return _GATE(); }
109#endif
110#endif95#endif
111 96
112 virtual opt_pass *clone() { return new _PASS_NAME_PASS(); }97 virtual opt_pass *clone() { return new _PASS_NAME_PASS(); }
113 98
114#ifndef NO_EXECUTE99#ifndef NO_EXECUTE
115#if BUILDING_GCC_VERSION >= 5000
116 virtual unsigned int execute(function *) { return _EXECUTE(); }100 virtual unsigned int execute(function *) { return _EXECUTE(); }
117#else
118 virtual unsigned int execute(void) { return _EXECUTE(); }
119#endif
120#endif101#endif
121};102};
122}103}
scripts/gcc-plugins/structleak_plugin.c+0−2
@@ -103,10 +103,8 @@ static void finish_type(void *event_data, void *data) · 102 unmodified lines
103 if (type == NULL_TREE || type == error_mark_node)103 if (type == NULL_TREE || type == error_mark_node)
104 return;104 return;
105 105
106#if BUILDING_GCC_VERSION >= 5000
107 if (TREE_CODE(type) == ENUMERAL_TYPE)106 if (TREE_CODE(type) == ENUMERAL_TYPE)
108 return;107 return;
109#endif
110 108
111 if (TYPE_USERSPACE(type))109 if (TYPE_USERSPACE(type))
112 return;110 return;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t