diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2024-09-10 15:54:52 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-10-08 10:37:14 +0200 |
commit | 57a26ae990f0fbde0ab6ec1d256d403561a8a4f5 (patch) | |
tree | 6ae0a2381e056d1ddac2dc23eb2b8868f093b8de | |
parent | 4ca91b84aa1cdb5fcd178ecb2bc7a13c9be082e3 (diff) | |
download | gcc-57a26ae990f0fbde0ab6ec1d256d403561a8a4f5.zip gcc-57a26ae990f0fbde0ab6ec1d256d403561a8a4f5.tar.gz gcc-57a26ae990f0fbde0ab6ec1d256d403561a8a4f5.tar.bz2 |
ada: Add dependency lines for External_Initialization
When a file included through External_Initialization has been modified,
the unit including it must be recompiled. This patch adds the
generation of dependency lines to the handling of the
External_Initialization aspect, to signal that fact to gnatmake and
other tools that invoke GNAT.
gcc/ada/ChangeLog:
* lib-writ.ads (Add_Preprocessing_Dependency): Update
documentation comment.
* sem_ch3.adb (Apply_External_Initialization): Add call to
Add_Preprocessing_Dependency.
-rw-r--r-- | gcc/ada/lib-writ.ads | 3 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/lib-writ.ads b/gcc/ada/lib-writ.ads index fd62ef9..3820617 100644 --- a/gcc/ada/lib-writ.ads +++ b/gcc/ada/lib-writ.ads @@ -1064,6 +1064,7 @@ package Lib.Writ is procedure Add_Preprocessing_Dependency (S : Source_File_Index); -- Indicate that there is a dependency to be added on a preprocessing data - -- file or on a preprocessing definition file. + -- file, on a preprocessing definition file or on a file included through + -- External_Initialization. end Lib.Writ; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 2a48882..ea0a97b 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -47,6 +47,7 @@ with Ghost; use Ghost; with Itypes; use Itypes; with Layout; use Layout; with Lib; use Lib; +with Lib.Writ; with Lib.Xref; use Lib.Xref; with Mutably_Tagged; use Mutably_Tagged; with Namet; use Namet; @@ -3947,6 +3948,8 @@ package body Sem_Ch3 is return; end if; + Lib.Writ.Add_Preprocessing_Dependency (Source_File_I); + Expr := Make_External_Initializer (Sloc (Specification), Source_File_I); |