comparison gcc/ada/lib-xref.adb @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
4 -- -- 4 -- --
5 -- L I B . X R E F -- 5 -- L I B . X R E F --
6 -- -- 6 -- --
7 -- B o d y -- 7 -- B o d y --
8 -- -- 8 -- --
9 -- Copyright (C) 1998-2017, Free Software Foundation, Inc. -- 9 -- Copyright (C) 1998-2018, Free Software Foundation, Inc. --
10 -- -- 10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under -- 11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- -- 12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- -- 13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
25 25
26 with Atree; use Atree; 26 with Atree; use Atree;
27 with Csets; use Csets; 27 with Csets; use Csets;
28 with Elists; use Elists; 28 with Elists; use Elists;
29 with Errout; use Errout; 29 with Errout; use Errout;
30 with Lib.Util; use Lib.Util;
30 with Nlists; use Nlists; 31 with Nlists; use Nlists;
31 with Opt; use Opt; 32 with Opt; use Opt;
32 with Restrict; use Restrict; 33 with Restrict; use Restrict;
33 with Rident; use Rident; 34 with Rident; use Rident;
34 with Sem; use Sem; 35 with Sem; use Sem;
663 Error_Msg_NE ("& is only defined in Ada 2012?y?", N, E); 664 Error_Msg_NE ("& is only defined in Ada 2012?y?", N, E);
664 end if; 665 end if;
665 666
666 -- Do not generate references if we are within a postcondition sub- 667 -- Do not generate references if we are within a postcondition sub-
667 -- program, because the reference does not comes from source, and the 668 -- program, because the reference does not comes from source, and the
668 -- pre-analysis of the aspect has already created an entry for the ALI 669 -- preanalysis of the aspect has already created an entry for the ALI
669 -- file at the proper source location. 670 -- file at the proper source location.
670 671
671 if Chars (Current_Scope) = Name_uPostconditions then 672 if Chars (Current_Scope) = Name_uPostconditions then
672 return; 673 return;
673 end if; 674 end if;
1031 -- Because a declaration may be generated for a subprogram body 1032 -- Because a declaration may be generated for a subprogram body
1032 -- without declaration in GNATprove mode, for inlining, some 1033 -- without declaration in GNATprove mode, for inlining, some
1033 -- parameters may end up being marked as not coming from source 1034 -- parameters may end up being marked as not coming from source
1034 -- although they are. Take these into account specially. 1035 -- although they are. Take these into account specially.
1035 1036
1036 elsif GNATprove_Mode and then Ekind (E) in Formal_Kind then 1037 elsif GNATprove_Mode and then Is_Formal (E) then
1037 Ent := E; 1038 Ent := E;
1038 1039
1039 -- Entity does not come from source, but is a derived subprogram and 1040 -- Entity does not come from source, but is a derived subprogram and
1040 -- the derived subprogram comes from source (after one or more 1041 -- the derived subprogram comes from source (after one or more
1041 -- derivations) in which case the reference is to parent subprogram. 1042 -- derivations) in which case the reference is to parent subprogram.