From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 0EE3E3858422; Tue, 20 Jun 2023 11:26:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0EE3E3858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687260384; bh=8a/kOkBN4OvlLnqRIA8doeT+5gyUWCPBszKg+mC65j8=; h=From:To:Subject:Date:From; b=hDUj9+Bst3DEyPUYWB/ZowbjJCw8mZdnyBJufHIuPS9HHVdVeNEtuQ7/+8Qs+58a+ hYMgG3DyM2LPZ2L9rByTwUjmcgwrLilqGYDbcycEukEp16gFTkerEFAXqX7g8523oR QFNXfA4qEgHmMAaxPCizLJnarH+AqItNwlBkcFkU= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1987] ada: Minor tweaks X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: c11ef75cb2cd60b0c4408aa8ed1898b69b8c946a X-Git-Newrev: 6f695bfd736c8cc4dd7a93f42f3574aa9f459163 Message-Id: <20230620112624.0EE3E3858422@sourceware.org> Date: Tue, 20 Jun 2023 11:26:24 +0000 (GMT) List-Id: https://gcc.gnu.org/g:6f695bfd736c8cc4dd7a93f42f3574aa9f459163 commit r14-1987-g6f695bfd736c8cc4dd7a93f42f3574aa9f459163 Author: Eric Botcazou Date: Fri Jun 9 20:24:41 2023 +0200 ada: Minor tweaks gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) : Pass the NULL_TREE explicitly and test imported_p in lieu of Is_Imported. : Remove public_flag local variable and make extern_flag local variable a constant. Diff: --- gcc/ada/gcc-interface/decl.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index b2b77787bc0..494b24e2111 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -1162,7 +1162,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) gnu_expr = build_unary_op (ADDR_EXPR, gnu_type, gnu_expr); - create_var_decl (gnu_entity_name, gnu_ext_name, + create_var_decl (gnu_entity_name, NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr, const_flag, Is_Public (gnat_entity), imported_p, static_flag, volatile_flag, @@ -1533,7 +1533,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* If this name is external or a name was specified, use it, but don't use the Interface_Name with an address clause (see cd30005). */ - if ((Is_Public (gnat_entity) && !Is_Imported (gnat_entity)) + if ((Is_Public (gnat_entity) && !imported_p) || (Present (Interface_Name (gnat_entity)) && No (Address_Clause (gnat_entity)))) gnu_ext_name = create_concat_name (gnat_entity, NULL); @@ -3977,10 +3977,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) = gnu_ext_name_for_subprog (gnat_entity, gnu_entity_name); const enum inline_status_t inline_status = inline_status_for_subprog (gnat_entity); - bool public_flag = Is_Public (gnat_entity) || imported_p; /* Subprograms marked both Intrinsic and Always_Inline need not have a body of their own. */ - bool extern_flag + const bool extern_flag = ((Is_Public (gnat_entity) && !definition) || imported_p || (Is_Intrinsic_Subprogram (gnat_entity) @@ -4135,10 +4134,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) else gnu_decl = create_subprog_decl (gnu_entity_name, gnu_ext_name, - gnu_type, gnu_param_list, - inline_status, public_flag, - extern_flag, artificial_p, - debug_info_p, + gnu_type, gnu_param_list, inline_status, + Is_Public (gnat_entity) || imported_p, + extern_flag, artificial_p, debug_info_p, definition && imported_p, attr_list, gnat_entity); }