33#define GCC_COMMON_H_INCLUDED
44
55#include " bversion.h"
6- #if BUILDING_GCC_VERSION >= 6000
76#include " gcc-plugin.h"
8- #else
9- #include " plugin.h"
10- #endif
117#include " plugin-version.h"
128#include " config.h"
139#include " system.h"
3935
4036#include " hash-map.h"
4137
42- #if BUILDING_GCC_VERSION >= 7000
4338#include " memmodel.h"
44- #endif
4539#include " emit-rtl.h"
4640#include " debug.h"
4741#include " target.h"
7468#include " context.h"
7569#include " tree-ssa-alias.h"
7670#include " tree-ssa.h"
77- #if BUILDING_GCC_VERSION >= 7000
7871#include " tree-vrp.h"
79- #endif
8072#include " tree-ssanames.h"
8173#include " print-tree.h"
8274#include " tree-eh.h"
@@ -149,16 +141,6 @@ static inline opt_pass *get_pass_for_id(int id)
149141 return g->get_passes ()->get_pass_for_id (id);
150142}
151143
152- #if BUILDING_GCC_VERSION < 6000
153- /* gimple related */
154- template <>
155- template <>
156- inline bool is_a_helper<const gassign *>::test(const_gimple gs)
157- {
158- return gs->code == GIMPLE_ASSIGN;
159- }
160- #endif
161-
162144#define TODO_verify_ssa TODO_verify_il
163145#define TODO_verify_flow TODO_verify_il
164146#define TODO_verify_stmts TODO_verify_il
@@ -181,23 +163,13 @@ static inline const char *get_decl_section_name(const_tree decl)
181163#define varpool_get_node (decl ) varpool_node::get(decl)
182164#define dump_varpool_node (file, node ) (node)->dump (file)
183165
184- #if BUILDING_GCC_VERSION >= 8000
185166#define cgraph_create_edge (caller, callee, call_stmt, count, freq ) \
186167 (caller)->create_edge ((callee), (call_stmt), (count))
187168
188169#define cgraph_create_edge_including_clones (caller, callee, \
189170 old_call_stmt, call_stmt, count, freq, reason) \
190171 (caller)->create_edge_including_clones ((callee), \
191172 (old_call_stmt), (call_stmt), (count), (reason))
192- #else
193- #define cgraph_create_edge (caller, callee, call_stmt, count, freq ) \
194- (caller)->create_edge ((callee), (call_stmt), (count), (freq))
195-
196- #define cgraph_create_edge_including_clones (caller, callee, \
197- old_call_stmt, call_stmt, count, freq, reason) \
198- (caller)->create_edge_including_clones ((callee), \
199- (old_call_stmt), (call_stmt), (count), (freq), (reason))
200- #endif
201173
202174typedef struct cgraph_node *cgraph_node_ptr;
203175typedef struct cgraph_edge *cgraph_edge_p;
@@ -293,14 +265,12 @@ static inline void cgraph_call_edge_duplication_hooks(cgraph_edge *cs1, cgraph_e
293265 symtab->call_edge_duplication_hooks (cs1, cs2);
294266}
295267
296- #if BUILDING_GCC_VERSION >= 6000
297268typedef gimple *gimple_ptr;
298269typedef const gimple *const_gimple_ptr;
299270#define gimple gimple_ptr
300271#define const_gimple const_gimple_ptr
301272#undef CONST_CAST_GIMPLE
302273#define CONST_CAST_GIMPLE (X ) CONST_CAST(gimple, (X))
303- #endif
304274
305275/* gimple related */
306276static inline gimple gimple_build_assign_with_ops (enum tree_code subcode, tree lhs, tree op1, tree op2 MEM_STAT_DECL)
@@ -400,15 +370,7 @@ static inline void ipa_remove_stmt_references(symtab_node *referring_node, gimpl
400370 referring_node->remove_stmt_references (stmt);
401371}
402372
403- #if BUILDING_GCC_VERSION < 6000
404- #define get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep, keep_aligning ) \
405- get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode, punsignedp, pvolatilep, keep_aligning)
406- #define gen_rtx_set (ARG0, ARG1 ) gen_rtx_SET(VOIDmode, (ARG0), (ARG1))
407- #endif
408-
409- #if BUILDING_GCC_VERSION >= 6000
410373#define gen_rtx_set (ARG0, ARG1 ) gen_rtx_SET((ARG0), (ARG1))
411- #endif
412374
413375#ifdef __cplusplus
414376static inline void debug_tree (const_tree t)
@@ -425,15 +387,8 @@ static inline void debug_gimple_stmt(const_gimple s)
425387#define debug_gimple_stmt (s ) debug_gimple_stmt(CONST_CAST_GIMPLE(s))
426388#endif
427389
428- #if BUILDING_GCC_VERSION >= 7000
429390#define get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep, keep_aligning ) \
430391 get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep)
431- #endif
432-
433- #if BUILDING_GCC_VERSION < 7000
434- #define SET_DECL_ALIGN (decl, align ) DECL_ALIGN(decl) = (align)
435- #define SET_DECL_MODE (decl, mode ) DECL_MODE(decl) = (mode)
436- #endif
437392
438393#if BUILDING_GCC_VERSION >= 14000
439394#define last_stmt (x ) last_nondebug_stmt(x)
0 commit comments