diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-09-08 12:11:07 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-09-08 12:11:07 +0200 |
commit | 72a266372b5f4ce60568c0741b8c99415cf9cb6e (patch) | |
tree | 8e1841fc53228fa10a28187f264d68109d26a652 /gcc/ada/exp_intr.adb | |
parent | db174c984559f8cc7f132a2aaae32b123051a38e (diff) | |
download | gcc-72a266372b5f4ce60568c0741b8c99415cf9cb6e.zip gcc-72a266372b5f4ce60568c0741b8c99415cf9cb6e.tar.gz gcc-72a266372b5f4ce60568c0741b8c99415cf9cb6e.tar.bz2 |
[multiple changes]
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* exp_intr.adb (Append_Entity_Name): Move to ...
* sem_util.ads, sem_util.adb: ... here to share it.
(Subprogram_Name): New subprogram, to compute the name of the enclosing
subprogram/entity.
* errutil.adb (Error_Msg): Fill new field Node.
* erroutc.ads (Subprogram_Name_Ptr): New.
(Error_Msg_Object): New field Node.
* erroutc.adb (dmsg, Output_Msg_Text): Take new field Node into account.
* errout.adb (Error_Msg): New variant with node id parameter.
Fill new parameter Node when emitting messages. Revert previous
changes for Include_Subprogram_In_Messages.
* sem_ch5.adb (Check_Unreachable_Code): Supply Node parameter when
generating warning message.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* par-ch4.adb (P_Iterated_Component_Association): Place construct
under -gnat2020 flag, given that it is a future feature of
the language.
* sem_aggr.adb (Resolve_Iterated_Component_Association): Mark
defining identifier as referenced to prevent spurious warnings:
corresponding loop is expanded into one or more loops whose
variable has the same name, and the expression uses those names
and not the original one.
From-SVN: r251883
Diffstat (limited to 'gcc/ada/exp_intr.adb')
-rw-r--r-- | gcc/ada/exp_intr.adb | 101 |
1 files changed, 1 insertions, 100 deletions
diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb index fde0617..1d3a321 100644 --- a/gcc/ada/exp_intr.adb +++ b/gcc/ada/exp_intr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2016, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2017, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -27,7 +27,6 @@ with Atree; use Atree; with Checks; use Checks; with Einfo; use Einfo; with Elists; use Elists; -with Errout; use Errout; with Expander; use Expander; with Exp_Atag; use Exp_Atag; with Exp_Ch4; use Exp_Ch4; @@ -111,12 +110,6 @@ package body Exp_Intr is -- GNAT.Source_Info; see g-souinf.ads for documentation of these -- intrinsics. - procedure Append_Entity_Name (Buf : in out Bounded_String; E : Entity_Id); - -- Recursive procedure to construct string for qualified name of enclosing - -- program unit. The qualification stops at an enclosing scope has no - -- source name (block or loop). If entity is a subprogram instance, skip - -- enclosing wrapper package. The name is appended to Buf. - --------------------- -- Add_Source_Info -- --------------------- @@ -189,98 +182,6 @@ package body Exp_Intr is end case; end Add_Source_Info; - ----------------------- - -- Append_Entity_Name -- - ----------------------- - - procedure Append_Entity_Name (Buf : in out Bounded_String; E : Entity_Id) is - Temp : Bounded_String; - - procedure Inner (E : Entity_Id); - -- Inner recursive routine, keep outer routine nonrecursive to ease - -- debugging when we get strange results from this routine. - - ----------- - -- Inner -- - ----------- - - procedure Inner (E : Entity_Id) is - begin - -- If entity has an internal name, skip by it, and print its scope. - -- Note that we strip a final R from the name before the test; this - -- is needed for some cases of instantiations. - - declare - E_Name : Bounded_String; - - begin - Append (E_Name, Chars (E)); - - if E_Name.Chars (E_Name.Length) = 'R' then - E_Name.Length := E_Name.Length - 1; - end if; - - if Is_Internal_Name (E_Name) then - Inner (Scope (E)); - return; - end if; - end; - - -- Just print entity name if its scope is at the outer level - - if Scope (E) = Standard_Standard then - null; - - -- If scope comes from source, write scope and entity - - elsif Comes_From_Source (Scope (E)) then - Append_Entity_Name (Temp, Scope (E)); - Append (Temp, '.'); - - -- If in wrapper package skip past it - - elsif Is_Wrapper_Package (Scope (E)) then - Append_Entity_Name (Temp, Scope (Scope (E))); - Append (Temp, '.'); - - -- Otherwise nothing to output (happens in unnamed block statements) - - else - null; - end if; - - -- Output the name - - declare - E_Name : Bounded_String; - - begin - Append_Unqualified_Decoded (E_Name, Chars (E)); - - -- Remove trailing upper-case letters from the name (useful for - -- dealing with some cases of internal names generated in the case - -- of references from within a generic). - - while E_Name.Length > 1 - and then E_Name.Chars (E_Name.Length) in 'A' .. 'Z' - loop - E_Name.Length := E_Name.Length - 1; - end loop; - - -- Adjust casing appropriately (gets name from source if possible) - - Adjust_Name_Case (E_Name, Sloc (E)); - Append (Temp, E_Name); - end; - end Inner; - - -- Start of processing for Append_Entity_Name - - begin - Inner (E); - Append (Buf, Temp); - end Append_Entity_Name; - --------------------------------- -- Expand_Binary_Operator_Call -- --------------------------------- |