aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-01-08 12:50:24 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-05-04 05:17:35 -0400
commit8ee1a28114021b11a6672accd7d0ed428dac135c (patch)
tree15b7880a3a4888d0c865530ad6554b0f31920af4
parent6c1655399bada8bb7ddb099c0865f7a882fe96e7 (diff)
downloadgcc-8ee1a28114021b11a6672accd7d0ed428dac135c.zip
gcc-8ee1a28114021b11a6672accd7d0ed428dac135c.tar.gz
gcc-8ee1a28114021b11a6672accd7d0ed428dac135c.tar.bz2
[Ada] Reuse existing To_Mixed routine in pretty-printer
gcc/ada/ * pprint.adb (To_Mixed): Removed.
-rw-r--r--gcc/ada/pprint.adb31
1 files changed, 3 insertions, 28 deletions
diff --git a/gcc/ada/pprint.adb b/gcc/ada/pprint.adb
index 0360e94..6b8fd8d 100644
--- a/gcc/ada/pprint.adb
+++ b/gcc/ada/pprint.adb
@@ -24,7 +24,6 @@
------------------------------------------------------------------------------
with Atree; use Atree;
-with Csets; use Csets;
with Einfo; use Einfo;
with Namet; use Namet;
with Nlists; use Nlists;
@@ -34,6 +33,8 @@ with Sinput; use Sinput;
with Snames; use Snames;
with Uintp; use Uintp;
+with System.Case_Util;
+
package body Pprint is
List_Name_Count : Natural := 0;
@@ -272,32 +273,6 @@ package body Pprint is
when N_Attribute_Reference =>
if Take_Prefix then
declare
- function To_Mixed_Case (S : String) return String;
- -- Transform given string into the corresponding one in
- -- mixed case form.
-
- -------------------
- -- To_Mixed_Case --
- -------------------
-
- function To_Mixed_Case (S : String) return String is
- Result : String (S'Range);
- Ucase : Boolean := True;
-
- begin
- for J in S'Range loop
- if Ucase then
- Result (J) := Fold_Upper (S (J));
- else
- Result (J) := Fold_Lower (S (J));
- end if;
-
- Ucase := (S (J) = '_');
- end loop;
-
- return Result;
- end To_Mixed_Case;
-
Id : constant Attribute_Id :=
Get_Attribute_Id (Attribute_Name (Expr));
@@ -306,7 +281,7 @@ package body Pprint is
Str : constant String :=
Expr_Name (Prefix (Expr))
& "'"
- & To_Mixed_Case
+ & System.Case_Util.To_Mixed
(Get_Name_String (Attribute_Name (Expr)));
N : Node_Id;