From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BD51E384B824; Wed, 28 Jul 2021 11:57:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD51E384B824 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug d/101127] d: Compile-time reflection for supported built-ins Date: Wed, 28 Jul 2021 11:57:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: d X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ibuclaw at gdcproject dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2021 11:57:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101127 --- Comment #5 from CVS Commits --- The releases/gcc-9 branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:58cae53cb1cf8971a9c9611680f373a43e7547b7 commit r9-9648-g58cae53cb1cf8971a9c9611680f373a43e7547b7 Author: Iain Buclaw Date: Sun Jul 25 23:19:36 2021 +0200 d: Compile-time reflection for supported built-ins (PR101127) In order to allow user-code to determine whether a back-end builtin is available without error, LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE has been defined to delay putting back-end builtin functions until the ISA that defines them has been declared. However in D, there is no global namespace. All builtins get pushed into the `gcc.builtins' module, which is constructed during the semantic analysis pass, which has already finished by the time target attributes are evaluated. So builtins are not pushed by the new langhook because they would be ultimately ignored. Builtins exposed to D code then can now only be altered by the command-line. PR d/101127 gcc/d/ChangeLog: * d-builtins.cc (d_builtin_function_ext_scope): New function. * d-lang.cc (LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE): Define. * d-tree.h (d_builtin_function_ext_scope): Declare. gcc/testsuite/ChangeLog: * gdc.dg/pr101127a.d: New test. * gdc.dg/pr101127b.d: New test. (cherry picked from commit b2f6e1de242fff5713763cd3146dcf3f9dee51ca)=