From patchwork Tue Oct 2 16:19:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 147989 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5355503lji; Tue, 2 Oct 2018 09:20:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV61+G7wsLJIpDdPvt5t5sM4KECVAS5XjgJtqnAnGEDk/adr+3FBCLlNpZEO6WA2D4eF3G+DW X-Received: by 2002:a63:3c46:: with SMTP id i6-v6mr15183896pgn.286.1538497257034; Tue, 02 Oct 2018 09:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538497257; cv=none; d=google.com; s=arc-20160816; b=atHX/PzErwxGsZniiNOBFiDSVgpIY1CVLoJe+rXqrU2axG12TL7z65O89gYxZPq5cL g20c79zrxVhMGY+U85xODIiqwrrhMOxRAWjACT57iVXRb2YnhFR3qrBqQVhQ/BZwwYvh KZ+n0smOUfUEoYsUgwLaA8PTn8q6RUolj+78jP8gGsIahRWHNmsgSnVoS5QJiCKKj1lx IijWDskPz35g93KhuPu6mW0gV7ZfVG1X/SzEtRu8R1ok1AToLk7NAWjGLQl/wI1TvBEv ludhCs3lkogq7wSiYca5/YmTAMKSUc/J9GTtg4NgsDb7PO8NllfVgqX/SuxpL1L+pNAG oLyg== 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:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=/98QaPCqynGJZv2MFh4kaB/t90szcMgzhLvjDA/RHRU=; b=sEAnI+DczbU8dyraoWpU/62b/FR+YP84SBCzFifup32Aw3IgY7U2q7MF33yrwGHNWm TM5Q7dVdo2dUST6m7cLIgXgp7uNQAcnQ3sjdBr4htNXebumnRxsttajiOSTk90gjorL7 xvzeQlffn5vcFf9Bfz6m2rAH2P2/qNmCi45Bl5yOCuJRYqWE3b8bzPdInNsDMH7g1L/t s/JEFgFuJM2XITi1KQ+9R7ci/KuphjQbspr+jkK5BZAeWyLqMJkZawa7lJZ1psLnNY2D KLb59BD+0gJILgHgi1D/pld/eBqxK0JStLQxF5EvgKfPgb0d5vhfZZYFhpIP4TivS1EA wX4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=i1O3vCVx; dkim=pass header.i=@linaro.org header.s=google header.b=cy4Jqj+n; spf=pass (google.com: domain of gcc-patches-return-486821-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-486821-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id a64-v6si17112969pfb.224.2018.10.02.09.20.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 09:20:57 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-486821-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=i1O3vCVx; dkim=pass header.i=@linaro.org header.s=google header.b=cy4Jqj+n; spf=pass (google.com: domain of gcc-patches-return-486821-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-486821-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=r+DpKJmr5qNXuvMqiG/ov7CSf0gC2+o8iHvnrr3fGTx0+9qshhKiZ hCadxvseoagKM2E7jj9RzZ7PGHgbxBKXN/IvUUBIKspJ5jzOoHL5eMINYZ56ouf1 R29ihym/J+rQ/LgSibNtF/Ml6A5axRtCdq1OI0LJaY8DNV8bwG1gi4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=zDuCiOcm/fX5obuVi5jE2GqUBpE=; b=i1O3vCVxHRUTk25GHNMF 5JOSi5XrMdCHSKi17OINEqTrhOUEbuSvvlH83euDOCVbLuXGYWEEr3NLYXW/Wrfy FGFl1xyGuiIAMlX46D88yA2Wy8LCkocIJxWEfQp4uaP5nFXdN/od3AtfhK49QaW2 qBJREMMDNuIKbnaU2LjFH60= Received: (qmail 67457 invoked by alias); 2 Oct 2018 16:19:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 67305 invoked by uid 89); 2 Oct 2018 16:19:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi1-f194.google.com Received: from mail-oi1-f194.google.com (HELO mail-oi1-f194.google.com) (209.85.167.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Oct 2018 16:19:32 +0000 Received: by mail-oi1-f194.google.com with SMTP id e17-v6so1963977oig.12 for ; Tue, 02 Oct 2018 09:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/98QaPCqynGJZv2MFh4kaB/t90szcMgzhLvjDA/RHRU=; b=cy4Jqj+nTIXsoOpeVXRJh9Gmbr/bvf5J1PzmutcjDJM0NnKOpOCWdVjiHXZcPIPQqU XMrpmV3GRtWfMhWF0XfH6QYF5RNN4SHsgEy1OYo+FQaPUzJf3ScWzY6NscUdgGhyjVFu FRvq43HkY/5cZZjO1Ue1MWquqBLdiSV2gKLDo= Return-Path: Received: from cloudburst.twiddle.net ([187.217.227.243]) by smtp.gmail.com with ESMTPSA id j15-v6sm145987oth.27.2018.10.02.09.19.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Oct 2018 09:19:29 -0700 (PDT) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: ramana.radhakrishnan@arm.com, agraf@suse.de, marcus.shawcroft@arm.com, james.greenhalgh@arm.com, richard.earnshaw@arm.com Subject: [PATCH, AArch64 v2 06/11] Add visibility to libfunc constructors Date: Tue, 2 Oct 2018 11:19:10 -0500 Message-Id: <20181002161915.18843-7-richard.henderson@linaro.org> In-Reply-To: <20181002161915.18843-1-richard.henderson@linaro.org> References: <20181002161915.18843-1-richard.henderson@linaro.org> * optabs-libfuncs.c (build_libfunc_function_visibility): New, split out from... (build_libfunc_function): ... here. (init_one_libfunc_visibility): New, split out from ... (init_one_libfunc): ... here. --- gcc/optabs-libfuncs.h | 2 ++ gcc/optabs-libfuncs.c | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/gcc/optabs-libfuncs.h b/gcc/optabs-libfuncs.h index 0669ea1fdd7..cf39da36887 100644 --- a/gcc/optabs-libfuncs.h +++ b/gcc/optabs-libfuncs.h @@ -63,7 +63,9 @@ void gen_satfract_conv_libfunc (convert_optab, const char *, void gen_satfractuns_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode); +tree build_libfunc_function_visibility (const char *, symbol_visibility); tree build_libfunc_function (const char *); +rtx init_one_libfunc_visibility (const char *, symbol_visibility); rtx init_one_libfunc (const char *); rtx set_user_assembler_libfunc (const char *, const char *); diff --git a/gcc/optabs-libfuncs.c b/gcc/optabs-libfuncs.c index bd0df8baa37..73a28e9ca7a 100644 --- a/gcc/optabs-libfuncs.c +++ b/gcc/optabs-libfuncs.c @@ -719,10 +719,10 @@ struct libfunc_decl_hasher : ggc_ptr_hash /* A table of previously-created libfuncs, hashed by name. */ static GTY (()) hash_table *libfunc_decls; -/* Build a decl for a libfunc named NAME. */ +/* Build a decl for a libfunc named NAME with visibility VIS. */ tree -build_libfunc_function (const char *name) +build_libfunc_function_visibility (const char *name, symbol_visibility vis) { /* ??? We don't have any type information; pretend this is "int foo ()". */ tree decl = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL, @@ -731,7 +731,7 @@ build_libfunc_function (const char *name) DECL_EXTERNAL (decl) = 1; TREE_PUBLIC (decl) = 1; DECL_ARTIFICIAL (decl) = 1; - DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + DECL_VISIBILITY (decl) = vis; DECL_VISIBILITY_SPECIFIED (decl) = 1; gcc_assert (DECL_ASSEMBLER_NAME (decl)); @@ -742,11 +742,19 @@ build_libfunc_function (const char *name) return decl; } +/* Build a decl for a libfunc named NAME. */ + +tree +build_libfunc_function (const char *name) +{ + return build_libfunc_function_visibility (name, VISIBILITY_DEFAULT); +} + /* Return a libfunc for NAME, creating one if we don't already have one. - The returned rtx is a SYMBOL_REF. */ + The decl is given visibility VIS. The returned rtx is a SYMBOL_REF. */ rtx -init_one_libfunc (const char *name) +init_one_libfunc_visibility (const char *name, symbol_visibility vis) { tree id, decl; hashval_t hash; @@ -763,12 +771,18 @@ init_one_libfunc (const char *name) { /* Create a new decl, so that it can be passed to targetm.encode_section_info. */ - decl = build_libfunc_function (name); + decl = build_libfunc_function_visibility (name, vis); *slot = decl; } return XEXP (DECL_RTL (decl), 0); } +rtx +init_one_libfunc (const char *name) +{ + return init_one_libfunc_visibility (name, VISIBILITY_DEFAULT); +} + /* Adjust the assembler name of libfunc NAME to ASMSPEC. */ rtx