aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2012-02-22 13:55:17 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2012-02-22 14:55:17 +0100
commit740ce3316fbcbf1629585ed2190140173719d6f2 (patch)
tree4e883c3a71da83aada33d6f1ee6f825368508e5a
parent98ee6f8d5feca105be9b7ea12aae3dad9659d73a (diff)
downloadgcc-740ce3316fbcbf1629585ed2190140173719d6f2.zip
gcc-740ce3316fbcbf1629585ed2190140173719d6f2.tar.gz
gcc-740ce3316fbcbf1629585ed2190140173719d6f2.tar.bz2
sem_prag.adb (Analyze_PPC_In_Decl_Part): Clean up generation of error message text.
2012-02-22 Steve Baird <baird@adacore.com> * sem_prag.adb (Analyze_PPC_In_Decl_Part): Clean up generation of error message text. From-SVN: r184474
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/sem_prag.adb35
2 files changed, 10 insertions, 30 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f8ffbcd..5f8a264 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-22 Steve Baird <baird@adacore.com>
+
+ * sem_prag.adb (Analyze_PPC_In_Decl_Part): Clean up generation of
+ error message text.
+
2012-02-22 Vincent Pucci <pucci@adacore.com>
* rtsfind.adb (Get_Unit_Name): Ada_Numerics_Child and
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 9761f2f..72d47ab 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -285,12 +285,6 @@ package body Sem_Prag is
-- Access to T'class, created if there is a controlling formal
-- that is an access parameter.
- function Aspect_Name return String;
- -- Return the name of the aspect being specified ("Pre" or "Post")
- -- properly capitalized for use in an error message. Precondition
- -- is Present (Corresponding_Aspect (N)), which will be satisfied
- -- if Class_Present (N).
-
function Get_ACW return Entity_Id;
-- If the expression has a reference to an controlling access
-- parameter, create an access to T'class for the necessary
@@ -305,19 +299,6 @@ package body Sem_Prag is
-- type access-to-T'Class. This ensures the expression is well-
-- defined for a primitive subprogram of a type descended from T.
- -----------------
- -- Aspect_Name --
- -----------------
-
- function Aspect_Name return String is
- begin
- if Chars (Identifier (Corresponding_Aspect (N))) = Name_Pre then
- return "Pre";
- else
- return "Post";
- end if;
- end Aspect_Name;
-
-------------
-- Get_ACW --
-------------
@@ -388,20 +369,14 @@ package body Sem_Prag is
begin
if not Present (T) then
+ Error_Msg_Name_1 :=
+ Chars (Identifier (Corresponding_Aspect (N)));
- -- This is weird code, why not just set Err_Msg_Name_1 to
- -- Identifier (Corresponding_Aspect (N)), and Err_Msg_Name_2
- -- to Name_Class and then use
-
- -- "aspect `%''%` can only be specified ...
-
- -- That would be the more normal way of doing things ???
- -- Then you get proper identifier casing mode as well,
- -- instead of presuming mixed case ???
+ Error_Msg_Name_2 := Name_Class;
Error_Msg_N
- ("aspect " & Aspect_Name & "''Class can only be specified " &
- "for a primitive operation of a tagged type",
+ ("aspect `%''%` can only be specified for a primitive " &
+ "operation of a tagged type",
Corresponding_Aspect (N));
end if;