aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2016-05-02 10:06:45 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2016-05-02 12:06:45 +0200
commit51122913ce1b40087fecc4ae4b21a8ece12ed612 (patch)
treeace708944e995b77c05af9a7378d78dd0ec22924 /gcc
parent32b794c81a5712113fe4245ec917abf6603158e6 (diff)
downloadgcc-51122913ce1b40087fecc4ae4b21a8ece12ed612.zip
gcc-51122913ce1b40087fecc4ae4b21a8ece12ed612.tar.gz
gcc-51122913ce1b40087fecc4ae4b21a8ece12ed612.tar.bz2
sem_ch13.adb (Alignment_Error): Removed.
2016-05-02 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch13.adb (Alignment_Error): Removed. (Get_Alignment_Value): Code cleanup. From-SVN: r235733
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/sem_ch13.adb37
2 files changed, 20 insertions, 22 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7627ad3..8d6e8ef 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch13.adb (Alignment_Error): Removed.
+ (Get_Alignment_Value): Code cleanup.
+
2016-05-02 Tristan Gingold <gingold@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): Use Has_Protected
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 8f078fd..73fecfc 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -11551,36 +11551,21 @@ package body Sem_Ch13 is
-------------------------
function Get_Alignment_Value (Expr : Node_Id) return Uint is
- procedure Alignment_Error;
- -- Issue an error concerning a negatize or zero alignment represented by
- -- expression Expr.
+ Align : constant Uint := Static_Integer (Expr);
- ---------------------
- -- Alignment_Error --
- ---------------------
+ begin
+ if Align = No_Uint then
+ return No_Uint;
+
+ elsif Align <= 0 then
- procedure Alignment_Error is
- begin
-- This error is suppressed in ASIS mode to allow for different ASIS
-- back-ends or ASIS-based tools to query the illegal clause.
if not ASIS_Mode then
Error_Msg_N ("alignment value must be positive", Expr);
end if;
- end Alignment_Error;
- -- Local variables
-
- Align : constant Uint := Static_Integer (Expr);
-
- -- Start of processing for Get_Alignment_Value
-
- begin
- if Align = No_Uint then
- return No_Uint;
-
- elsif Align <= 0 then
- Alignment_Error;
return No_Uint;
else
@@ -11592,7 +11577,15 @@ package body Sem_Ch13 is
exit when M = Align;
if M > Align then
- Alignment_Error;
+
+ -- This error is suppressed in ASIS mode to allow for
+ -- different ASIS back-ends or ASIS-based tools to query the
+ -- illegal clause.
+
+ if not ASIS_Mode then
+ Error_Msg_N ("alignment value must be power of 2", Expr);
+ end if;
+
return No_Uint;
end if;
end;