diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-09-02 09:10:07 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-09-02 09:10:07 +0200 |
commit | bd0bc43e58edb507c01ecabdfdf0e7717a825324 (patch) | |
tree | 912a34c00bd350df63b1b3b2de596bb767cf8687 | |
parent | 9fdb5d2171b7104581e0e80bfb8f527d37d93fcd (diff) | |
download | gcc-bd0bc43e58edb507c01ecabdfdf0e7717a825324.zip gcc-bd0bc43e58edb507c01ecabdfdf0e7717a825324.tar.gz gcc-bd0bc43e58edb507c01ecabdfdf0e7717a825324.tar.bz2 |
[multiple changes]
2011-09-02 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Analyze_With_Clause): If the library unit
is the generated subprogram declaration for a child unit body
that acts as spec, use the original body in the with_clause,
to prevent binding errors.
2011-09-02 Vincent Celier <celier@adacore.com>
* gnat_ugn.texi: Adapt documentation of -gnateInnn to new VMS
qualifier /MULTI_UNIT_INDEX=
2011-09-02 Johannes Kanig <kanig@adacore.com>
* g-comlin.adb (Getopt): Return when switch is dealt with automatically,
instead of calling the callback function
From-SVN: r178435
-rw-r--r-- | gcc/ada/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/ada/g-comlin.adb | 3 | ||||
-rw-r--r-- | gcc/ada/g-comlin.ads | 3 | ||||
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 6 | ||||
-rw-r--r-- | gcc/ada/sem_ch10.adb | 15 |
5 files changed, 40 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 936169a..4ab6922 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,20 @@ +2011-09-02 Ed Schonberg <schonberg@adacore.com> + + * sem_ch10.adb (Analyze_With_Clause): If the library unit + is the generated subprogram declaration for a child unit body + that acts as spec, use the original body in the with_clause, + to prevent binding errors. + +2011-09-02 Vincent Celier <celier@adacore.com> + + * gnat_ugn.texi: Adapt documentation of -gnateInnn to new VMS + qualifier /MULTI_UNIT_INDEX= + +2011-09-02 Johannes Kanig <kanig@adacore.com> + + * g-comlin.adb (Getopt): Return when switch is dealt with automatically, + instead of calling the callback function + 2011-09-02 Robert Dewar <dewar@adacore.com> * prj-proc.adb, prj.ads, sem_util.adb, s-taprop-linux.adb, diff --git a/gcc/ada/g-comlin.adb b/gcc/ada/g-comlin.adb index 5f5855f..43a6524 100644 --- a/gcc/ada/g-comlin.adb +++ b/gcc/ada/g-comlin.adb @@ -3290,11 +3290,14 @@ package body GNAT.Command_Line is with "Expected integer parameter for '" & Switch & "'"; end; + return; when Switch_String => Free (Config.Switches (Index).String_Output.all); Config.Switches (Index).String_Output.all := new String'(Parameter); + return; + end case; end if; diff --git a/gcc/ada/g-comlin.ads b/gcc/ada/g-comlin.ads index ec84280..f1b2163 100644 --- a/gcc/ada/g-comlin.ads +++ b/gcc/ada/g-comlin.ads @@ -707,7 +707,8 @@ package GNAT.Command_Line is Callback : Switch_Handler := null; Parser : Opt_Parser := Command_Line_Parser); -- Similar to the standard Getopt function. - -- For each switch found on the command line, this calls Callback. + -- For each switch found on the command line, this calls Callback, if the + -- switch is not handled automatically. -- -- The list of valid switches are the ones from the configuration. The -- switches that were declared through Define_Switch with an Output diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 2a2618c..145c66e 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -4130,11 +4130,11 @@ Display full source path name in brief error messages. @cindex @option{-gnateG} (@command{gcc}) Save result of preprocessing in a text file. -@item -gnateInnn +@item ^-gnateI^/MULTI_UNIT_INDEX=^@var{nnn} @cindex @option{-gnateI} (@command{gcc}) Indicates that the source is a multi-unit source and that the index of the -unit to compile is nnn. nnn needs to be a positive number and need to -be a valid index in the multi-unit source. +unit to compile is @var{nnn}. @var{nnn} needs to be a positive number and need +to be a valid index in the multi-unit source. @item -gnatem=@var{path} @cindex @option{-gnatem} (@command{gcc}) diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 063da58..a0f0a79 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -2536,6 +2536,21 @@ package body Sem_Ch10 is -- Child unit in a with clause Change_Selected_Component_To_Expanded_Name (Name (N)); + + -- If this is a child unit without a spec, and it has benn analyzed + -- already, a declaration has been created for it. The with_clause + -- must reflect the actual body, and not the generated declaration, + -- to prevent spurious binding errors involving an out-of-date spec. + -- Note that this can only happen if the unit includes more than one + -- with_clause for the child unit (e.g. in separate subunits). + + if Unit_Kind = N_Subprogram_Declaration + and then Analyzed (Library_Unit (N)) + and then not Comes_From_Source (Library_Unit (N)) + then + Set_Library_Unit (N, + Cunit (Get_Source_Unit (Corresponding_Body (U)))); + end if; end if; -- Restore style checks and restrictions |