aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gcc-plugins/gcc-common.h
diff options
context:
space:
mode:
authorAlexander Popov <alex.popov@linux.com>2018-07-11 16:36:35 -0400
committerKees Cook <keescook@chromium.org>2018-07-24 19:14:06 -0400
commit45d9a1e3cc45efee6c0ef82b77269d6944d9d8a5 (patch)
treeb8be38ebf0972c63bca184794d57375892eeff09 /scripts/gcc-plugins/gcc-common.h
parent7ccb95e8fe9131b8fa14b947c60dfb30044fa002 (diff)
gcc-plugins: Clean up the cgraph_create_edge* macros
Drop useless redefinitions of cgraph_create_edge* macros. Drop the unused nest argument. Also support gcc-8, which doesn't have freq argument. Signed-off-by: Alexander Popov <alex.popov@linux.com> Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'scripts/gcc-plugins/gcc-common.h')
-rw-r--r--scripts/gcc-plugins/gcc-common.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
index f46750053377..552d5efd7cb7 100644
--- a/scripts/gcc-plugins/gcc-common.h
+++ b/scripts/gcc-plugins/gcc-common.h
@@ -392,13 +392,6 @@ static inline struct cgraph_node *cgraph_alias_target(struct cgraph_node *n)
392} 392}
393#endif 393#endif
394 394
395#if BUILDING_GCC_VERSION >= 4007 && BUILDING_GCC_VERSION <= 4009
396#define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \
397 cgraph_create_edge((caller), (callee), (call_stmt), (count), (freq))
398#define cgraph_create_edge_including_clones(caller, callee, old_call_stmt, call_stmt, count, freq, nest, reason) \
399 cgraph_create_edge_including_clones((caller), (callee), (old_call_stmt), (call_stmt), (count), (freq), (reason))
400#endif
401
402#if BUILDING_GCC_VERSION <= 4008 395#if BUILDING_GCC_VERSION <= 4008
403#define ENTRY_BLOCK_PTR_FOR_FN(FN) ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) 396#define ENTRY_BLOCK_PTR_FOR_FN(FN) ENTRY_BLOCK_PTR_FOR_FUNCTION(FN)
404#define EXIT_BLOCK_PTR_FOR_FN(FN) EXIT_BLOCK_PTR_FOR_FUNCTION(FN) 397#define EXIT_BLOCK_PTR_FOR_FN(FN) EXIT_BLOCK_PTR_FOR_FUNCTION(FN)
@@ -723,10 +716,23 @@ static inline const char *get_decl_section_name(const_tree decl)
723#define varpool_get_node(decl) varpool_node::get(decl) 716#define varpool_get_node(decl) varpool_node::get(decl)
724#define dump_varpool_node(file, node) (node)->dump(file) 717#define dump_varpool_node(file, node) (node)->dump(file)
725 718
726#define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \ 719#if BUILDING_GCC_VERSION >= 8000
720#define cgraph_create_edge(caller, callee, call_stmt, count, freq) \
721 (caller)->create_edge((callee), (call_stmt), (count))
722
723#define cgraph_create_edge_including_clones(caller, callee, \
724 old_call_stmt, call_stmt, count, freq, reason) \
725 (caller)->create_edge_including_clones((callee), \
726 (old_call_stmt), (call_stmt), (count), (reason))
727#else
728#define cgraph_create_edge(caller, callee, call_stmt, count, freq) \
727 (caller)->create_edge((callee), (call_stmt), (count), (freq)) 729 (caller)->create_edge((callee), (call_stmt), (count), (freq))
728#define cgraph_create_edge_including_clones(caller, callee, old_call_stmt, call_stmt, count, freq, nest, reason) \ 730
729 (caller)->create_edge_including_clones((callee), (old_call_stmt), (call_stmt), (count), (freq), (reason)) 731#define cgraph_create_edge_including_clones(caller, callee, \
732 old_call_stmt, call_stmt, count, freq, reason) \
733 (caller)->create_edge_including_clones((callee), \
734 (old_call_stmt), (call_stmt), (count), (freq), (reason))
735#endif
730 736
731typedef struct cgraph_node *cgraph_node_ptr; 737typedef struct cgraph_node *cgraph_node_ptr;
732typedef struct cgraph_edge *cgraph_edge_p; 738typedef struct cgraph_edge *cgraph_edge_p;