aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-09-29 11:09:06 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-11-24 05:16:00 -0500
commit3ac0642304f83feda52d9285083a4e637e33e3d6 (patch)
tree13b7058d2f218a3e410b47009d8bcf71568a0146
parent41273281cef411c75d12f45e8083faff2633e61a (diff)
downloadgcc-3ac0642304f83feda52d9285083a4e637e33e3d6.zip
gcc-3ac0642304f83feda52d9285083a4e637e33e3d6.tar.gz
gcc-3ac0642304f83feda52d9285083a4e637e33e3d6.tar.bz2
[Ada] Use high-level Present instead of low-level equality test
gcc/ada/ * lib-load.adb, lib-writ.adb, lib.adb, par-load.adb, rtsfind.adb, sem_ch10.adb: Use Present where possible.
-rw-r--r--gcc/ada/lib-load.adb2
-rw-r--r--gcc/ada/lib-writ.adb2
-rw-r--r--gcc/ada/lib.adb2
-rw-r--r--gcc/ada/par-load.adb2
-rw-r--r--gcc/ada/rtsfind.adb2
-rw-r--r--gcc/ada/sem_ch10.adb2
6 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ada/lib-load.adb b/gcc/ada/lib-load.adb
index 2598285..75226d3 100644
--- a/gcc/ada/lib-load.adb
+++ b/gcc/ada/lib-load.adb
@@ -551,7 +551,7 @@ package body Lib.Load is
-- Note: Unit_Name (Main_Unit) is not set if we are parsing gnat.adc.
if Present (Error_Node)
- and then Unit_Name (Main_Unit) /= No_Unit_Name
+ and then Present (Unit_Name (Main_Unit))
then
-- It seems like In_Extended_Main_Source_Unit (Error_Node) would
-- do the trick here, but that's wrong, it is much too early to
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index 6a63b8f..f17b46a 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -837,7 +837,7 @@ package body Lib.Writ is
-- preprocessing data and definition files, there is no Unit_Name,
-- check for that first.
- if Unit_Name (J) /= No_Unit_Name
+ if Present (Unit_Name (J))
and then (With_Flags (J) or else Unit_Name (J) = Pname)
then
Num_Withs := Num_Withs + 1;
diff --git a/gcc/ada/lib.adb b/gcc/ada/lib.adb
index 49a352a..d298267 100644
--- a/gcc/ada/lib.adb
+++ b/gcc/ada/lib.adb
@@ -275,7 +275,7 @@ package body Lib is
begin
-- First unregister the old name, if any
- if Old_N /= No_Unit_Name and then Unit_Names.Get (Old_N) = U then
+ if Present (Old_N) and then Unit_Names.Get (Old_N) = U then
Unit_Names.Set (Old_N, No_Unit);
end if;
diff --git a/gcc/ada/par-load.adb b/gcc/ada/par-load.adb
index a1857dc..ecd5404 100644
--- a/gcc/ada/par-load.adb
+++ b/gcc/ada/par-load.adb
@@ -318,7 +318,7 @@ begin
Spec_Name := Get_Parent_Spec_Name (Unit_Name (Cur_Unum));
- if Spec_Name /= No_Unit_Name then
+ if Present (Spec_Name) then
Unum :=
Load_Unit
(Load_Name => Spec_Name,
diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb
index 872ce01..6a0631f 100644
--- a/gcc/ada/rtsfind.adb
+++ b/gcc/ada/rtsfind.adb
@@ -423,7 +423,7 @@ package body Rtsfind is
(Unit_Name (Current_Sem_Unit));
begin
- if Parent_Name /= No_Unit_Name then
+ if Present (Parent_Name) then
Get_Name_String (Parent_Name);
declare
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 0bad136..aab186c 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -768,7 +768,7 @@ package body Sem_Ch10 is
Unum := Get_Cunit_Unit_Number (N);
Par_Spec_Name := Get_Parent_Spec_Name (Unit_Name (Unum));
- if Par_Spec_Name /= No_Unit_Name then
+ if Present (Par_Spec_Name) then
Unum :=
Load_Unit
(Load_Name => Par_Spec_Name,