Commit 51122913 by Hristian Kirtchev Committed by Arnaud Charlet

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
parent 32b794c8
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> 2016-05-02 Tristan Gingold <gingold@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): Use Has_Protected * sem_ch3.adb (Analyze_Object_Declaration): Use Has_Protected
......
...@@ -11551,36 +11551,21 @@ package body Sem_Ch13 is ...@@ -11551,36 +11551,21 @@ package body Sem_Ch13 is
------------------------- -------------------------
function Get_Alignment_Value (Expr : Node_Id) return Uint is function Get_Alignment_Value (Expr : Node_Id) return Uint is
procedure Alignment_Error; Align : constant Uint := Static_Integer (Expr);
-- Issue an error concerning a negatize or zero alignment represented by
-- expression Expr.
--------------------- begin
-- Alignment_Error -- 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 -- This error is suppressed in ASIS mode to allow for different ASIS
-- back-ends or ASIS-based tools to query the illegal clause. -- back-ends or ASIS-based tools to query the illegal clause.
if not ASIS_Mode then if not ASIS_Mode then
Error_Msg_N ("alignment value must be positive", Expr); Error_Msg_N ("alignment value must be positive", Expr);
end if; 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; return No_Uint;
else else
...@@ -11592,7 +11577,15 @@ package body Sem_Ch13 is ...@@ -11592,7 +11577,15 @@ package body Sem_Ch13 is
exit when M = Align; exit when M = Align;
if M > Align then 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; return No_Uint;
end if; end if;
end; end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment