From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: ARC-Seal: i=1; a=rsa-sha256; t=1526488121; cv=none; d=google.com; s=arc-20160816; b=luLpH5IyppztUOk12IeGYRNPKJhgwYBXto1knPsfNndG/Vkd91eoC7sGqVYNFHbMd6 ZT85ACjOURFkmApUEHu0ar2QHU3VJOvEjI7osB7Ul4O7F1eYQHEFlRmKZJjzDxFyMY1C A0pPhB5ObmvKFRkt8mPVf9x9EjMy/EPuZ4lQTGwTazIvV+t2+0bWlcr9KSuD10AaQaPq YIiw18sSYQOtUX1G62Q8oXgLw/F68o5PIMpTiepHw4h4FmKD8uzbRFRNNqFkNliA6pQb AyQ5SnyxmA0V++MWTheJ3WdUsU0jp9QjCwoCYLjPmUdpXOrlKihvod0kWjqzQmygRUEV 1Vow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :arc-authentication-results; bh=EDnRyEkUWY+17yuV5p5k1NrPfVvSW7u12r4hjFpZ8tM=; b=G2EQmCo/XHE6BYhUGEG5n1NvH+fUb8jIwPZ0C4MegenYjB8j70ALVd7l/ITfYaSeA0 LSHSJJ13+FW7+0ZMdP1Ai+CuWgiZSZrXkuU4EXGv5qkzOcY+FKExcJUNbFnT0NE+P90e QbrlCva7w2ODSQF2vSnfqlJJC6xttV3QgOZCZc0ou357pEw9i1ANx4l5hYzjrg0wrLsg RDwAUjKYBNZTiZ/xqnNUQ/Da+mY7z8ZGhOjbi/XnIqdroARjumG6hUR2qZTy5S0l0xlE OKx5rutWeek1AXPoL0OdzoFNGEvU901fdR48fE6kEMMAsHHmhTvAoiVyEctKcF2qvhMh NWlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of a13xp0p0v88@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=a13xp0p0v88@gmail.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of a13xp0p0v88@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=a13xp0p0v88@gmail.com X-Google-Smtp-Source: AB8JxZqQLXTIYtXYRKgO7oKUE0PiRdTbneZv85+33O3opAeEG+XuyL4XtuGHDQrdnCbHjKp86+zYWA== From: Alexander Popov To: kernel-hardening@lists.openwall.com, Kees Cook , PaX Team , Brad Spengler , Ingo Molnar , Andy Lutomirski , Tycho Andersen , Laura Abbott , Mark Rutland , Ard Biesheuvel , Borislav Petkov , Richard Sandiford , Thomas Gleixner , "H . Peter Anvin" , Peter Zijlstra , "Dmitry V . Levin" , Emese Revfy , Jonathan Corbet , Andrey Ryabinin , "Kirill A . Shutemov" , Thomas Garnier , Andrew Morton , Alexei Starovoitov , Josef Bacik , Masami Hiramatsu , Nicholas Piggin , Al Viro , "David S . Miller" , Ding Tianhong , David Woodhouse , Josh Poimboeuf , Steven Rostedt , Dominik Brodowski , Juergen Gross , Linus Torvalds , Greg Kroah-Hartman , Dan Williams , Dave Hansen , Mathias Krause , Vikas Shivappa , Kyle Huey , Dmitry Safonov , Will Deacon , Arnd Bergmann , Florian Weimer , Boris Lukashev , Andrey Konovalov , x86@kernel.org, linux-kernel@vger.kernel.org, alex.popov@linux.com Subject: [PATCH v12 1/6] gcc-plugins: Clean up the cgraph_create_edge* macros Date: Wed, 16 May 2018 19:28:12 +0300 Message-Id: <1526488097-20611-2-git-send-email-alex.popov@linux.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526488097-20611-1-git-send-email-alex.popov@linux.com> References: <1526488097-20611-1-git-send-email-alex.popov@linux.com> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1600638808528304883?= X-GMAIL-MSGID: =?utf-8?q?1600638808528304883?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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 --- scripts/gcc-plugins/gcc-common.h | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h index f467500..552d5ef 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) } #endif -#if BUILDING_GCC_VERSION >= 4007 && BUILDING_GCC_VERSION <= 4009 -#define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \ - cgraph_create_edge((caller), (callee), (call_stmt), (count), (freq)) -#define cgraph_create_edge_including_clones(caller, callee, old_call_stmt, call_stmt, count, freq, nest, reason) \ - cgraph_create_edge_including_clones((caller), (callee), (old_call_stmt), (call_stmt), (count), (freq), (reason)) -#endif - #if BUILDING_GCC_VERSION <= 4008 #define ENTRY_BLOCK_PTR_FOR_FN(FN) ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) #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) #define varpool_get_node(decl) varpool_node::get(decl) #define dump_varpool_node(file, node) (node)->dump(file) -#define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \ +#if BUILDING_GCC_VERSION >= 8000 +#define cgraph_create_edge(caller, callee, call_stmt, count, freq) \ + (caller)->create_edge((callee), (call_stmt), (count)) + +#define cgraph_create_edge_including_clones(caller, callee, \ + old_call_stmt, call_stmt, count, freq, reason) \ + (caller)->create_edge_including_clones((callee), \ + (old_call_stmt), (call_stmt), (count), (reason)) +#else +#define cgraph_create_edge(caller, callee, call_stmt, count, freq) \ (caller)->create_edge((callee), (call_stmt), (count), (freq)) -#define cgraph_create_edge_including_clones(caller, callee, old_call_stmt, call_stmt, count, freq, nest, reason) \ - (caller)->create_edge_including_clones((callee), (old_call_stmt), (call_stmt), (count), (freq), (reason)) + +#define cgraph_create_edge_including_clones(caller, callee, \ + old_call_stmt, call_stmt, count, freq, reason) \ + (caller)->create_edge_including_clones((callee), \ + (old_call_stmt), (call_stmt), (count), (freq), (reason)) +#endif typedef struct cgraph_node *cgraph_node_ptr; typedef struct cgraph_edge *cgraph_edge_p; -- 2.7.4