aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/einfo-utils.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2023-01-13 14:48:46 -0500
committerMarc Poulhiès <poulhies@adacore.com>2023-05-15 11:36:43 +0200
commitd41df0366e6dfbdc3a5a50577462a9b6689ebbfb (patch)
treeb5926ac57eda5319d83d36786d3ffc79fe55bf52 /gcc/ada/einfo-utils.adb
parent0ec72fa3db193354264d8c092da21f29fd473d88 (diff)
downloadgcc-d41df0366e6dfbdc3a5a50577462a9b6689ebbfb.zip
gcc-d41df0366e6dfbdc3a5a50577462a9b6689ebbfb.tar.gz
gcc-d41df0366e6dfbdc3a5a50577462a9b6689ebbfb.tar.bz2
ada: Use Inline aspect instead of pragma in Einfo.Utils
This package was using the Ada 83 renaming idiom for inlining Next_Component and other Next_... procedures without inlining the same-named functions. Using the Inline aspect avoids that sort of horsing around. We change all the other pragmas Inline in this package to aspects as well, which is a more-minor improvement. Fix too-long lines without wrapping lines. gcc/ada/ * einfo-utils.ads, einfo-utils.adb: Get rid of the Proc_Next_... procedures. Use Inline aspect instead of pragma Inline. Is_Discrete_Or_Fixed_Point_Type did not have pragma Inline, but now has the aspect; this was probably an oversight (which illustrates why aspects are better).
Diffstat (limited to 'gcc/ada/einfo-utils.adb')
-rw-r--r--gcc/ada/einfo-utils.adb43
1 files changed, 21 insertions, 22 deletions
diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
index a8220e2..febc80a 100644
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -1505,11 +1505,10 @@ package body Einfo.Utils is
Kind : constant Node_Kind := Nkind (N);
begin
- -- Identifiers, operator symbols, expanded names are entity names
+ -- Identifiers, operator symbols, expanded names are entity names.
+ -- (But not N_Character_Literal.)
- return Kind = N_Identifier
- or else Kind = N_Operator_Symbol
- or else Kind = N_Expanded_Name
+ return Kind in N_Identifier | N_Operator_Symbol | N_Expanded_Name
-- Attribute references are entity names if they refer to an entity.
-- Note that we don't do this by testing for the presence of the
@@ -3212,49 +3211,49 @@ package body Einfo.Utils is
-- Iterator Procedures --
-------------------------
- procedure Proc_Next_Component (N : in out Node_Id) is
+ procedure Next_Component (N : in out Node_Id) is
begin
N := Next_Component (N);
- end Proc_Next_Component;
+ end Next_Component;
- procedure Proc_Next_Component_Or_Discriminant (N : in out Node_Id) is
+ procedure Next_Component_Or_Discriminant (N : in out Node_Id) is
begin
N := Next_Component_Or_Discriminant (N);
- end Proc_Next_Component_Or_Discriminant;
+ end Next_Component_Or_Discriminant;
- procedure Proc_Next_Discriminant (N : in out Node_Id) is
+ procedure Next_Discriminant (N : in out Node_Id) is
begin
N := Next_Discriminant (N);
- end Proc_Next_Discriminant;
+ end Next_Discriminant;
- procedure Proc_Next_Formal (N : in out Node_Id) is
+ procedure Next_Formal (N : in out Node_Id) is
begin
N := Next_Formal (N);
- end Proc_Next_Formal;
+ end Next_Formal;
- procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
+ procedure Next_Formal_With_Extras (N : in out Node_Id) is
begin
N := Next_Formal_With_Extras (N);
- end Proc_Next_Formal_With_Extras;
+ end Next_Formal_With_Extras;
- procedure Proc_Next_Index (N : in out Node_Id) is
+ procedure Next_Index (N : in out Node_Id) is
begin
N := Next_Index (N);
- end Proc_Next_Index;
+ end Next_Index;
- procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
+ procedure Next_Inlined_Subprogram (N : in out Node_Id) is
begin
N := Next_Inlined_Subprogram (N);
- end Proc_Next_Inlined_Subprogram;
+ end Next_Inlined_Subprogram;
- procedure Proc_Next_Literal (N : in out Node_Id) is
+ procedure Next_Literal (N : in out Node_Id) is
begin
N := Next_Literal (N);
- end Proc_Next_Literal;
+ end Next_Literal;
- procedure Proc_Next_Stored_Discriminant (N : in out Node_Id) is
+ procedure Next_Stored_Discriminant (N : in out Node_Id) is
begin
N := Next_Stored_Discriminant (N);
- end Proc_Next_Stored_Discriminant;
+ end Next_Stored_Discriminant;
end Einfo.Utils;