Mercurial > hg > CbC > CbC_gcc
comparison gcc/ada/expander.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 -- E X P A N D E R -- | 5 -- E X P A N D E R -- |
6 -- -- | 6 -- -- |
7 -- B o d y -- | 7 -- B o d y -- |
8 -- -- | 8 -- -- |
9 -- Copyright (C) 1992-2017, Free Software Foundation, Inc. -- | 9 -- Copyright (C) 1992-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- -- |
80 -- WARNING: This routine manages Ghost regions. Return statements must be | 80 -- WARNING: This routine manages Ghost regions. Return statements must be |
81 -- replaced by gotos which jump to the end of the routine and restore the | 81 -- replaced by gotos which jump to the end of the routine and restore the |
82 -- Ghost mode. | 82 -- Ghost mode. |
83 | 83 |
84 procedure Expand (N : Node_Id) is | 84 procedure Expand (N : Node_Id) is |
85 Saved_GM : constant Ghost_Mode_Type := Ghost_Mode; | 85 Saved_GM : constant Ghost_Mode_Type := Ghost_Mode; |
86 -- Save the Ghost mode to restore on exit | 86 Saved_IGR : constant Node_Id := Ignored_Ghost_Region; |
87 -- Save the Ghost-related attributes to restore on exit | |
87 | 88 |
88 begin | 89 begin |
89 -- If we were analyzing a default expression (or other spec expression) | 90 -- If we were analyzing a default expression (or other spec expression) |
90 -- the Full_Analysis flag must be off. If we are in expansion mode then | 91 -- the Full_Analysis flag must be off. If we are in expansion mode then |
91 -- we must be performing a full analysis. If we are analyzing a generic | 92 -- we must be performing a full analysis. If we are analyzing a generic |
122 | 123 |
123 -- There are three reasons for the Expander_Active flag to be false | 124 -- There are three reasons for the Expander_Active flag to be false |
124 | 125 |
125 -- The first is when are not generating code. In this mode the | 126 -- The first is when are not generating code. In this mode the |
126 -- Full_Analysis flag indicates whether we are performing a complete | 127 -- Full_Analysis flag indicates whether we are performing a complete |
127 -- analysis, in which case Full_Analysis = True or a pre-analysis in | 128 -- analysis, in which case Full_Analysis = True or a preanalysis in |
128 -- which case Full_Analysis = False. See the spec of Sem for more info | 129 -- which case Full_Analysis = False. See the spec of Sem for more info |
129 -- on this. | 130 -- on this. |
130 | 131 |
131 -- The second reason for the Expander_Active flag to be False is that | 132 -- The second reason for the Expander_Active flag to be False is that |
132 -- we are performing a pre-analysis. During pre-analysis all expansion | 133 -- we are performing a preanalysis. During preanalysis all expansion |
133 -- activity is turned off to make sure nodes are semantically decorated | 134 -- activity is turned off to make sure nodes are semantically decorated |
134 -- but no extra nodes are generated. This is for instance needed for | 135 -- but no extra nodes are generated. This is for instance needed for |
135 -- the first pass of aggregate semantic processing. Note that in this | 136 -- the first pass of aggregate semantic processing. Note that in this |
136 -- case the Full_Analysis flag is set to False because the node will | 137 -- case the Full_Analysis flag is set to False because the node will |
137 -- subsequently be re-analyzed with expansion on (see the spec of sem). | 138 -- subsequently be re-analyzed with expansion on (see the spec of sem). |
528 | 529 |
529 Debug_A_Exit ("expanding ", N, " (done)"); | 530 Debug_A_Exit ("expanding ", N, " (done)"); |
530 end if; | 531 end if; |
531 | 532 |
532 <<Leave>> | 533 <<Leave>> |
533 Restore_Ghost_Mode (Saved_GM); | 534 Restore_Ghost_Region (Saved_GM, Saved_IGR); |
534 end Expand; | 535 end Expand; |
535 | 536 |
536 --------------------------- | 537 --------------------------- |
537 -- Expander_Mode_Restore -- | 538 -- Expander_Mode_Restore -- |
538 --------------------------- | 539 --------------------------- |