public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Suppress GNAT FE up-level reference transformation for GNAT-LLVM
@ 2019-09-19 13:29 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2019-09-19 13:29 UTC (permalink / raw)
  To: gcc-patches; +Cc: Gary Dismukes

[-- Attachment #1: Type: text/plain, Size: 592 bytes --]

In the case of GNAT-LLVM, the GNAT FE no longer does expansion of
up-level references identified by the subprogram unnesting machinery
into activation record references. This is now only done by the FE when
generating C code. This expansion is already taken care of by the
gnat-llvm middle phase, so there's no benefit to also doing it in the
front end.

Tested on x86_64-pc-linux-gnu, committed on trunk

2019-09-19  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

	* exp_unst.adb (Unnest_Subprogram): Bypass the transformation of
	up-level references unless Opt.Generate_C_Code is enabled.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 882 bytes --]

--- gcc/ada/exp_unst.adb
+++ gcc/ada/exp_unst.adb
@@ -2177,11 +2177,14 @@ package body Exp_Unst is
             --  not need rewriting (e.g. the appearence in a conversion).
             --  Also ignore if no reference was specified or if the rewriting
             --  has already been done (this can happen if the N_Identifier
-            --  occurs more than one time in the tree).
+            --  occurs more than one time in the tree). Also ignore references
+            --  when not generating C code (in particular for the case of LLVM,
+            --  since GNAT-LLVM will handle the processing for up-level refs).
 
             if No (UPJ.Ref)
               or else not Is_Entity_Name (UPJ.Ref)
               or else not Present (Entity (UPJ.Ref))
+              or else not Opt.Generate_C_Code
             then
                goto Continue;
             end if;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-19 13:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 13:29 [Ada] Suppress GNAT FE up-level reference transformation for GNAT-LLVM Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).