aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/make.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 12:00:15 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 12:00:15 +0200
commit47b79f7801556cc194b099d5bad6409c93cf599c (patch)
treea46cc1b345b5b36131aaf156511be52f5bb1358a /gcc/ada/make.adb
parente9f97e793186e04e2a69ef8dc15073b530f2851f (diff)
downloadgcc-47b79f7801556cc194b099d5bad6409c93cf599c.zip
gcc-47b79f7801556cc194b099d5bad6409c93cf599c.tar.gz
gcc-47b79f7801556cc194b099d5bad6409c93cf599c.tar.bz2
[multiple changes]
2015-10-20 Gary Dismukes <dismukes@adacore.com> * sem_ch13.adb: Minor reference change (RM => AARM). 2015-10-20 Eric Botcazou <ebotcazou@adacore.com> * make.adb (Check): Skip multilib switches reinstated by the compiler only when counting the number of switches, since it is what really matters in the regular operating mode. 2015-10-20 Arnaud Charlet <charlet@adacore.com> * einfo.adb: Add extra assertion for small clause. * cstand.adb: Minor style fix in comment. * debug.adb: Minor reformatting. * exp_util.adb: Fix minor typo. 2015-10-20 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Same_Instantiated_Function): New predicate in Check_Formal_Package_Instance, used to verify that the formal and the actual of an actual package match when both are functions given as attribute references. From-SVN: r229034
Diffstat (limited to 'gcc/ada/make.adb')
-rw-r--r--gcc/ada/make.adb52
1 files changed, 32 insertions, 20 deletions
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 8db2598..e368a9f 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -1572,12 +1572,21 @@ package body Make is
Source_Name : File_Name_Type;
Text : Text_Buffer_Ptr;
- Prev_Switch : String_Access;
- -- Previous switch processed
+ First_Arg : Arg_Id;
+ -- Index of the first argument in Args.Table for a given unit
+
+ Last_Arg : Arg_Id;
+ -- Index of the last argument in Args.Table for a given unit
Arg : Arg_Id := Arg_Id'First;
-- Current index in Args.Table for a given unit (init to stop warning)
+ Number_Of_Switches : Natural;
+ -- Number of switches recorded for a given unit
+
+ Prev_Switch : String_Access;
+ -- Previous switch processed
+
Switch_Found : Boolean;
-- True if a given switch has been found
@@ -1720,17 +1729,12 @@ package body Make is
for J in 1 .. Last_Argument loop
- -- Skip -c, -I and -o switches, as well as multilib switches
- -- reinstated by the compiler according to lang-specs.h.
+ -- Skip -c, -I and -o switches
if Arguments (J) (1) = '-'
and then Arguments (J) (2) /= 'c'
and then Arguments (J) (2) /= 'o'
and then Arguments (J) (2) /= 'I'
- and then not (Arguments (J)'Length = 5
- and then Arguments (J) (2 .. 5) = "mrtp")
- and then not (Arguments (J)'Length = 6
- and then Arguments (J) (2 .. 6) = "fsjlj")
then
Normalize_Compiler_Switches
(Arguments (J).all,
@@ -1745,6 +1749,9 @@ package body Make is
end if;
end loop;
+ First_Arg := Units.Table (ALIs.Table (ALI).First_Unit).First_Arg;
+ Last_Arg := Units.Table (ALIs.Table (ALI).First_Unit).Last_Arg;
+
for J in 1 .. Switches_To_Check.Last loop
-- Comparing switches is delicate because gcc reorders a number
@@ -1762,15 +1769,12 @@ package body Make is
Prev_Switch (6) /= Switches_To_Check.Table (J) (6))
then
Prev_Switch := Switches_To_Check.Table (J);
- Arg :=
- Units.Table (ALIs.Table (ALI).First_Unit).First_Arg;
+ Arg := First_Arg;
end if;
Switch_Found := False;
- for K in Arg ..
- Units.Table (ALIs.Table (ALI).First_Unit).Last_Arg
- loop
+ for K in Arg .. Last_Arg loop
if
Switches_To_Check.Table (J).all = Args.Table (K).all
then
@@ -1792,17 +1796,25 @@ package body Make is
end if;
end loop;
- if Switches_To_Check.Last /=
- Integer (Units.Table (ALIs.Table (ALI).First_Unit).Last_Arg -
- Units.Table (ALIs.Table (ALI).First_Unit).First_Arg + 1)
- then
+ Number_Of_Switches := Natural (Last_Arg - First_Arg + 1);
+
+ -- Do not count the multilib switches reinstated by the compiler
+ -- according to the lang-specs.h.settings.
+
+ for K in First_Arg .. Last_Arg loop
+ if Args.Table (K).all = "-mrtp"
+ or else Args.Table (K).all = "-fsjlj"
+ then
+ Number_Of_Switches := Number_Of_Switches - 1;
+ end if;
+ end loop;
+
+ if Switches_To_Check.Last /= Number_Of_Switches then
if Verbose_Mode then
Verbose_Msg (ALIs.Table (ALI).Sfile,
"different number of switches");
- for K in Units.Table (ALIs.Table (ALI).First_Unit).First_Arg
- .. Units.Table (ALIs.Table (ALI).First_Unit).Last_Arg
- loop
+ for K in First_Arg .. Last_Arg loop
Write_Str (Args.Table (K).all);
Write_Char (' ');
end loop;