annotate gcc/ada/exp_ch12.adb @ 143:76e1cf5455ef

add cbc_gc test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:24:05 +0900
parents 84e7813d76e9
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- E X P _ C H 1 2 --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- B o d y --
kono
parents:
diff changeset
8 -- --
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 -- Copyright (C) 1997-2018, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
kono
parents:
diff changeset
17 -- for more details. You should have received a copy of the GNU General --
kono
parents:
diff changeset
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
kono
parents:
diff changeset
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
kono
parents:
diff changeset
20 -- --
kono
parents:
diff changeset
21 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
23 -- --
kono
parents:
diff changeset
24 ------------------------------------------------------------------------------
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 with Atree; use Atree;
kono
parents:
diff changeset
27 with Checks; use Checks;
kono
parents:
diff changeset
28 with Einfo; use Einfo;
kono
parents:
diff changeset
29 with Exp_Util; use Exp_Util;
kono
parents:
diff changeset
30 with Nmake; use Nmake;
kono
parents:
diff changeset
31 with Sinfo; use Sinfo;
kono
parents:
diff changeset
32 with Snames; use Snames;
kono
parents:
diff changeset
33 with Stand; use Stand;
kono
parents:
diff changeset
34 with Tbuild; use Tbuild;
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 package body Exp_Ch12 is
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 ------------------------------------
kono
parents:
diff changeset
39 -- Expand_N_Generic_Instantiation --
kono
parents:
diff changeset
40 ------------------------------------
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 -- If elaboration entity is defined and this is not an outer level entity,
kono
parents:
diff changeset
43 -- we need to generate a check for it here.
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 procedure Expand_N_Generic_Instantiation (N : Node_Id) is
kono
parents:
diff changeset
46 Loc : constant Source_Ptr := Sloc (N);
kono
parents:
diff changeset
47 Ent : constant Entity_Id := Entity (Name (N));
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 begin
kono
parents:
diff changeset
50 if Etype (Name (N)) = Any_Type then
kono
parents:
diff changeset
51 return;
kono
parents:
diff changeset
52 end if;
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 if Present (Elaboration_Entity (Ent))
kono
parents:
diff changeset
55 and then not Is_Compilation_Unit (Ent)
kono
parents:
diff changeset
56 and then not Elaboration_Checks_Suppressed (Ent)
kono
parents:
diff changeset
57 then
kono
parents:
diff changeset
58 Insert_Action (Instance_Spec (N),
kono
parents:
diff changeset
59 Make_Raise_Program_Error (Loc,
kono
parents:
diff changeset
60 Condition =>
kono
parents:
diff changeset
61 Make_Op_Not (Loc,
kono
parents:
diff changeset
62 Right_Opnd =>
kono
parents:
diff changeset
63 Make_Attribute_Reference (Loc,
kono
parents:
diff changeset
64 Attribute_Name => Name_Elaborated,
kono
parents:
diff changeset
65 Prefix => New_Occurrence_Of (Ent, Loc))),
kono
parents:
diff changeset
66 Reason => PE_Access_Before_Elaboration));
kono
parents:
diff changeset
67 end if;
kono
parents:
diff changeset
68 end Expand_N_Generic_Instantiation;
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 end Exp_Ch12;