From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: ARC-Seal: i=1; a=rsa-sha256; t=1520107250; cv=none; d=google.com; s=arc-20160816; b=zW95p4Ff5g4hxwvS5aGVG/vpLXbiVx2lKS7ZnsEe2agDvP0nkaziOGVuMavDl+HjZC onlfIxUdS4rHnThTm2Y3ZSrPlH86cgvxF8ukXtGxsYCK7rQF82mMi7slaLA7e44SOphE 8Qpho2Ward3ltZyD+P7CkPyt3OxJA7ekIgWEFoRMLlOO96nZoL4o/dJVKzP8F7tdr5DO TquTmMOwOboU4oIevOesUVmS8D5WxTyuNLZtjnZT3Q4IyhzS2csv1XADEmNLjQQ1XiRF lTWLZ3SwM/uNDvwNh/wX4LeRA84SAqJCR3ErUWmRffWMU1ycIuQmCT9tsZmi61dghPYv fAdQ== 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=k8x4qDYIu4cRDWHnSZas+34MqZ4WQK/OI4WOFFhKF++sC77Jym0Q2AJVqNCxE1Hq5w Lj2XEUzmL4FrLEprKiiXdpyUF2ETqdN2QKcuU4EAFDa6qBlzg9Uuak4cJATuJdgsdgtK LA7SaaqEAigpYp698GFwEP9Vs1NDOPctaRyyuGOhg8kchX2DvFw12UCZbIZIFunWB23v nEWOKjmPqWaRAn6TtwUyQmoIgf/dDfS/pgd2DeEVO7IkOVpED9WON+CvE9VjecoYN+nF TOUjBSi4XUMu5pSnA8RkFO1+4XPNHonhjcODRSYmV2yRj5gjxJC3gh0mAtlKGvaNXoTw muSg== 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: AG47ELuJnS0rVehGyv4xuLyEHt+3uhr/JKr1sh1r7uKJyFEd7lyTtFHyRSN+QpAa5z0vmw0/yL9U8g== 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 , Greg Kroah-Hartman , Dan Williams , Dave Hansen , Mathias Krause , Vikas Shivappa , Kyle Huey , Dmitry Safonov , Will Deacon , Arnd Bergmann , x86@kernel.org, linux-kernel@vger.kernel.org, alex.popov@linux.com Subject: [PATCH RFC v9 1/7] gcc-plugins: Clean up the cgraph_create_edge* macros Date: Sat, 3 Mar 2018 23:00:26 +0300 Message-Id: <1520107232-14111-2-git-send-email-alex.popov@linux.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520107232-14111-1-git-send-email-alex.popov@linux.com> References: <1520107232-14111-1-git-send-email-alex.popov@linux.com> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1593947980930866304?= X-GMAIL-MSGID: =?utf-8?q?1593947980930866304?= 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