From patchwork Wed Sep 26 05:03:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 147534 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp262460lji; Tue, 25 Sep 2018 22:05:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV61mv14v4Jnt8lnLKaM2sfKtXXK+Q9XL7z3X94V2FMutqzMXuan8Eraef28vC/PT7OoUelTS X-Received: by 2002:a62:444d:: with SMTP id r74-v6mr4369758pfa.96.1537938316743; Tue, 25 Sep 2018 22:05:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537938316; cv=none; d=google.com; s=arc-20160816; b=ERkNpIpLgy8gLzlYDpAGs57AyWQDOh86YRSdyb8J8qrpDERspMWINBBfhmN6qpajlB 5iiGscTdNVMmZz60uw5pLRnD11sdNVqWVwRi17K2ouMwKj4B0R8jZSOj6IHG9TzldBuJ Q0h1VLDmA7tIfnkMHN2SFaork8BeCQsrijYLH1iOD4D8f2X3/iJ5hcFjWSQhVUam/IuS wXOqupWHSEG/Fqn1NnxnqAmbHR8PQaY/WdkCIpW/vGh5AMXL3SaYFcWQHLX85lVe1Hc3 xI+XsJ9Keo+x4odMzE0Z4HPOKEh3mZBjBTDm2CZZYvCidmtg2bRfdx2jkbOBKGyOaUxW AMuA== 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=+aniE3cxPr173z47rRklH5nqkrZcqXChbK/UZJeUGLE=; b=XxejmnzRD5sUHLYM5kqc2yllXi/ArGdwvdr7AbBq54tc82ywNMURdPjcF5OJatKoob dlRS9S8hQFtc2UU2NgtC3Iz/8RawdZSprsnX7ZuGoPSykGlzpPq/azCQhj/Pksyqd6tw HMBwEbqRe2YMuotPjJwmBZ/xYR8jBCeQYfuJyhaqg/pP9Q42xTePHTJ9Jv62gWWaL9T9 8hL0otjTUbfBqP3EmYe+5xDDxaYORM8he4OtFcE23qDz9RC8KoRl09xcfLty9H79k/E/ l/oGBruimAUtKUZ3AswcJNHs0+dKwDjYJ9IpjOGe0VnMDUlEuoxyftttxClyeLXAvDwv N+eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="M1/oflAb"; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G1UE2QFH; spf=pass (google.com: domain of gcc-patches-return-486387-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-486387-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s63-v6si4173587pfj.226.2018.09.25.22.05.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Sep 2018 22:05:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-486387-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="M1/oflAb"; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G1UE2QFH; spf=pass (google.com: domain of gcc-patches-return-486387-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-486387-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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=xRb9xRduwgPlEgdbqgY9sYN+REDyufGYoR+73kVBc1U8xABw+W0wf zYyU329u9stFZbp+VCGwITA2F8NrhcX8YtObJrtwyoIzQ0sYun3ljj4R0vhIeIU3 I/LSsK90qzHqenBZEpIHAdtfxiFeiUsZUV8C5Kczp0anVGBb9pnTmk= 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=ZbvsHm91uIWJx2KO9f7qo4Y2cvQ=; b=M1/oflAbMDk+UyRfUdFd +Mra3bBpgIikJjuYSTHwfUDIUqj8VxnQcMxglJKY+ANhWraHr+eNiTox3Wedex8B BmUGX5QxhHEkip0NEK26D6ZFXixB3y1EdHDhaiwzLKxCLVXYu+/6/MrRY/ADxMQG hDsMhOsB+ApMTaHIZRLwy4E= Received: (qmail 74084 invoked by alias); 26 Sep 2018 05:04:08 -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 73902 invoked by uid 89); 26 Sep 2018 05:04:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, 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=HX-Received:6c48, HX-Received:sk:h69-v6m, H*r:sk:y4-v6so, Hx-spam-relays-external:209.85.215.194 X-HELO: mail-pg1-f194.google.com Received: from mail-pg1-f194.google.com (HELO mail-pg1-f194.google.com) (209.85.215.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Sep 2018 05:04:05 +0000 Received: by mail-pg1-f194.google.com with SMTP id y4-v6so13213199pgp.9 for ; Tue, 25 Sep 2018 22:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+aniE3cxPr173z47rRklH5nqkrZcqXChbK/UZJeUGLE=; b=G1UE2QFHCA+V3Zi8MjCEnUK8D3Fqz36L/VdGoAWycunqlnGLSEgmmpS617weZbpIbh kz2b5f0HSg8aPdj5Xj3kajDLCXGMbsopRgsK28p+DYp341IuYUgdlnsgS8vDWpL1LnSZ Ru0lr/+QfYuQDrofq7W4RggygT7zleuQMQsPxizxQYqdlEktGoIWe7V+b4TVH+BKjDCb n0RdZM9TC64tD3dZc1fjxXzcDrWvOnlNI2K1UE8pgMqGbufQU4XisdGPH28MUwQJb+W3 /mkusq6zYEoRFzMyyry31nuVYZi02//GxlEWr3CTsxcOMvlzTBg1rUIpI7NORm47t9oY Nd+g== Return-Path: Received: from cloudburst.twiddle.net (97-113-8-179.tukw.qwest.net. [97.113.8.179]) by smtp.gmail.com with ESMTPSA id j22-v6sm4954650pfh.45.2018.09.25.22.04.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Sep 2018 22:04:02 -0700 (PDT) From: rth7680@gmail.com To: gcc-patches@gcc.gnu.org Cc: ramana.radhakrishnan@arm.com, agraf@suse.de, matz@suse.de, Richard Henderson Subject: [PATCH, AArch64 06/11] Add visibility to libfunc constructors Date: Tue, 25 Sep 2018 22:03:50 -0700 Message-Id: <20180926050355.32746-7-richard.henderson@linaro.org> In-Reply-To: <20180926050355.32746-1-richard.henderson@linaro.org> References: <20180926050355.32746-1-richard.henderson@linaro.org> From: Richard Henderson * 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