diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-10-12 15:53:46 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-10-12 15:53:46 +0200 |
commit | d89ce4324c613e79d9e4855a284c809773cbc30f (patch) | |
tree | 6ad2ca58ff5864ec425cb212773f1f9daf273009 /gcc/ada/lib-writ.adb | |
parent | 432b6d957261f946836f2a4d1cbcef3eace17571 (diff) | |
download | gcc-d89ce4324c613e79d9e4855a284c809773cbc30f.zip gcc-d89ce4324c613e79d9e4855a284c809773cbc30f.tar.gz gcc-d89ce4324c613e79d9e4855a284c809773cbc30f.tar.bz2 |
[multiple changes]
2016-10-12 Ed Schonberg <schonberg@adacore.com>
* lib-writ.adb (Write_ALI): Removal of unused file entries from
dependency list must be performed before the list is sorted,
so that the dependency number of other files is properly set-up
for use in tools that relate entity information to the unit in
which they are declared.
2016-10-12 Hristian Kirtchev <kirtchev@adacore.com>
* exp_aggr.adb (Initialize_Ctrl_Array_Component):
Create a copy of the initialization expression to avoid sharing
it between multiple components.
2016-10-12 Yannick Moy <moy@adacore.com>
* einfo.adb, einfo.ads (Has_Partial_Visible_Refinement): New flag
in abtract states.
(Has_Non_Null_Visible_Refinement): Return true for patial refinement.
(Partial_Refinement_Constituents): New function returns the full or
partial refinement constituents depending on scope.
* sem_ch3.adb (Analyze_Declarations): Remove partial visible
refinements when exiting the scope of a package spec or body
and those partial refinements are not in scope afterwards.
* sem_ch7.adb, sem_ch7.ads (Install_Partial_Declarations): Mark
abstract states of parent units with partial refinement so that
it is visible.
* sem_prag.adb (Analyze_Part_Of_In_Decl_Part): Mark enclosing
abstract state if any as having partial refinement in that scope.
(Analyze_Refined_Global_In_Decl_Part): Check constituent usage
based on full or partial refinement depending on scope.
2016-10-12 Ed Schonberg <schonberg@adacore.com>
* exp_ch4.adb (Expand_N_Type_Conversion): If the target type
has an invariant aspect, insert invariant call at the proper
place in the code rather than rewriting the expression as an
expression with actions, to prevent spurious semantic errors on
the rewritten conversion when it is the object in a renaming.
From-SVN: r241048
Diffstat (limited to 'gcc/ada/lib-writ.adb')
-rw-r--r-- | gcc/ada/lib-writ.adb | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb index b78e3eb..0cd615f 100644 --- a/gcc/ada/lib-writ.adb +++ b/gcc/ada/lib-writ.adb @@ -990,8 +990,27 @@ package body Lib.Writ is if Cunit_Entity (Unum) = Empty or else not From_Limited_With (Cunit_Entity (Unum)) then - Num_Sdep := Num_Sdep + 1; - Sdep_Table (Num_Sdep) := Unum; + -- Units that are not analyzed need not appear in the dependency + -- list. These units are either units appearing in limited_with + -- clauses of other units, or units loaded for inlining that end + -- up not inlined by a later decision of the inlining code, to + -- prevent circularities. We want to exclude these files from the + -- list of dependencies, so that the dependency number of other + -- is correctly set, as that number is used by cross-reference + -- tools to relate entity information to the unit in which they + -- are declared. + + if Present (Cunit_Entity (Unum)) + and then Ekind (Cunit_Entity (Unum)) = E_Void + and then Nkind (Unit (Cunit (Unum))) /= N_Subunit + and then Serious_Errors_Detected = 0 + then + null; + + else + Num_Sdep := Num_Sdep + 1; + Sdep_Table (Num_Sdep) := Unum; + end if; end if; end loop; @@ -1433,32 +1452,6 @@ package body Lib.Writ is Units.Table (Unum).Dependency_Num := J; Sind := Units.Table (Unum).Source_Index; - -- The dependency table also contains units that appear in the - -- context of a unit loaded through a limited_with clause. These - -- units are never analyzed, and thus the main unit does not - -- really have a dependency on them. Subunits are always compiled - -- in the context of the parent, and their file table entries are - -- not properly decorated, they are recognized syntactically. - - -- This optimization is disabled when inline is active, because - -- inline may propose some bodies for inlining, and decide later - -- that they may lead to circularities, in which case they are - -- also left unanalyzed in the file table. There is no simple way - -- to distinguish between the two kinds of unanalyzed entries, - -- so simplest is to skip this step. - - -- Actually, this optimization is always disabled, because it - -- breaks gnatfind. - - if False -- ??? - and then Present (Cunit_Entity (Unum)) - and then Ekind (Cunit_Entity (Unum)) = E_Void - and then Nkind (Unit (Cunit (Unum))) /= N_Subunit - and then not Inline_Active - then - goto Next_Unit; - end if; - Write_Info_Initiate ('D'); Write_Info_Char (' '); @@ -1534,9 +1527,6 @@ package body Lib.Writ is end if; Write_Info_EOL; - - <<Next_Unit>> - null; end loop; end; |