summaryrefslogtreecommitdiff
path: root/gcc/ada/errout.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/errout.adb')
-rw-r--r--gcc/ada/errout.adb24
1 files changed, 16 insertions, 8 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index 7c2a097119f..db558ebacf9 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -2358,7 +2358,10 @@ package body Errout is
-- Adjust_Name_Case --
----------------------
- procedure Adjust_Name_Case (Loc : Source_Ptr) is
+ procedure Adjust_Name_Case
+ (Buf : in out Bounded_String;
+ Loc : Source_Ptr)
+ is
begin
-- We have an all lower case name from Namet, and now we want to set
-- the appropriate case. If possible we copy the actual casing from
@@ -2387,10 +2390,10 @@ package body Errout is
Sbuffer := Source_Text (Src_Ind);
- while Ref_Ptr <= Name_Len loop
+ while Ref_Ptr <= Buf.Length loop
exit when
Fold_Lower (Sbuffer (Src_Ptr)) /=
- Fold_Lower (Name_Buffer (Ref_Ptr));
+ Fold_Lower (Buf.Chars (Ref_Ptr));
Ref_Ptr := Ref_Ptr + 1;
Src_Ptr := Src_Ptr + 1;
end loop;
@@ -2398,23 +2401,28 @@ package body Errout is
-- If we get through the loop without a mismatch, then output the
-- name the way it is cased in the source program
- if Ref_Ptr > Name_Len then
+ if Ref_Ptr > Buf.Length then
Src_Ptr := Loc;
- for J in 1 .. Name_Len loop
- Name_Buffer (J) := Sbuffer (Src_Ptr);
+ for J in 1 .. Buf.Length loop
+ Buf.Chars (J) := Sbuffer (Src_Ptr);
Src_Ptr := Src_Ptr + 1;
end loop;
-- Otherwise set the casing using the default identifier casing
else
- Set_Casing (Identifier_Casing (Src_Ind), Mixed_Case);
+ Set_Casing (Buf, Identifier_Casing (Src_Ind));
end if;
end if;
end;
end Adjust_Name_Case;
+ procedure Adjust_Name_Case (Loc : Source_Ptr) is
+ begin
+ Adjust_Name_Case (Global_Name_Buffer, Loc);
+ end Adjust_Name_Case;
+
---------------------------
-- Set_Identifier_Casing --
---------------------------
@@ -2874,7 +2882,7 @@ package body Errout is
end if;
-- Remaining step is to adjust casing and possibly add 'Class
- Adjust_Name_Case (Loc);
+ Adjust_Name_Case (Global_Name_Buffer, Loc);
Set_Msg_Name_Buffer;
Add_Class;
end Set_Msg_Node;