Commit 8bfbd380 by Arnaud Charlet

[multiple changes]

2013-04-11  Arnaud Charlet  <charlet@adacore.com>

	* gnat1drv.adb: Minor code clean up.

2013-04-11  Arnaud Charlet  <charlet@adacore.com>

	* debug.adb, sem_ch13.adb (Analyze_Enumeration_Representation_Clause):
	Ignore enumeration rep clauses by default in CodePeer mode, unless
	-gnatd.I is specified.

2013-04-11  Ed Schonberg  <schonberg@adacore.com>

	* sem_util.adb (Safe_To_Capture_Value): If the node belongs to
	an expression that has been attached to the else_actions of an
	if-expression, the capture is not safe.

2013-04-11  Yannick Moy  <moy@adacore.com>

	* checks.adb (Apply_Type_Conversion_Checks): Put check mark on type
	conversion for arrays.

2013-04-11  Robert Dewar  <dewar@adacore.com>

	* a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb: Minor reformatting.

2013-04-11  Johannes Kanig  <kanig@adacore.com>

	* adabkend.adb: Minor comment addition.

From-SVN: r197773
parent 256f3847
2013-04-11 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb: Minor code clean up.
2013-04-11 Arnaud Charlet <charlet@adacore.com>
* debug.adb, sem_ch13.adb (Analyze_Enumeration_Representation_Clause):
Ignore enumeration rep clauses by default in CodePeer mode, unless
-gnatd.I is specified.
2013-04-11 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Safe_To_Capture_Value): If the node belongs to
an expression that has been attached to the else_actions of an
if-expression, the capture is not safe.
2013-04-11 Yannick Moy <moy@adacore.com>
* checks.adb (Apply_Type_Conversion_Checks): Put check mark on type
conversion for arrays.
2013-04-11 Robert Dewar <dewar@adacore.com>
* a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb: Minor reformatting.
2013-04-11 Johannes Kanig <kanig@adacore.com>
* adabkend.adb: Minor comment addition.
2013-04-11 Matthew Heaney <heaney@adacore.com>
* a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb ("="): Increment
......
......@@ -234,8 +234,15 @@ package body Adabkend is
then
if Is_Switch (Argv) then
Fail ("Object file name missing after -gnatO");
-- In Alfa_Mode, such an object file is never written, and the
-- call to Set_Output_Object_File_Name may fail (e.g. when the
-- object file name does not have the expected suffix). So we
-- skip that call when Alfa_Mode is set.
elsif Alfa_Mode then
Output_File_Name_Seen := True;
else
Set_Output_Object_File_Name (Argv);
Output_File_Name_Seen := True;
......
......@@ -3244,13 +3244,18 @@ package body Checks is
Reason => CE_Discriminant_Check_Failed));
end;
-- For arrays, conversions are applied during expansion, to take into
-- accounts changes of representation. The checks become range checks on
-- the base type or length checks on the subtype, depending on whether
-- the target type is unconstrained or constrained.
-- For arrays, checks are set now, but conversions are applied during
-- expansion, to take into accounts changes of representation. The
-- checks become range checks on the base type or length checks on the
-- subtype, depending on whether the target type is unconstrained or
-- constrained.
elsif Is_Array_Type (Target_Type) then
if Is_Constrained (Target_Type) then
Set_Do_Length_Check (N);
else
null;
Set_Do_Range_Check (Expr);
end if;
end if;
end Apply_Type_Conversion_Checks;
......
......@@ -126,7 +126,7 @@ package body Debug is
-- d.F Alfa mode
-- d.G Frame condition mode for gnat2why
-- d.H Standard package only mode for gnat2why
-- d.I
-- d.I Do not ignore enum representation clauses in CodePeer mode
-- d.J Disable parallel SCIL generation mode
-- d.K Alfa detection only mode for gnat2why
-- d.L Depend on back end for limited types in if and case expressions
......@@ -614,6 +614,12 @@ package body Debug is
-- will only generate Why code for package Standard. Any given input
-- file will be ignored.
-- d.I Do not ignore enum representation clauses in CodePeer mode.
-- The default of ignoring representation clauses for enumeration
-- types in CodePeer is good for the majority of Ada code, but in some
-- cases being able to change this default might be useful to remove
-- some false positives.
-- d.J Disable parallel SCIL generation. Normally SCIL file generation is
-- done in parallel to speed processing. This switch disables this
-- behavior.
......
......@@ -293,11 +293,15 @@ procedure Gnat1drv is
Formal_Extensions := True;
end if;
-- Alfa_Mode is activated by default in the gnat2why executable, but
-- can also be activated using the -gnatd.F switch.
-- Enable Alfa_Mode when using -gnatd.F switch
if Debug_Flag_Dot_FF or else Alfa_Mode then
if Debug_Flag_Dot_FF then
Alfa_Mode := True;
end if;
-- Alfa_Mode is also activated by default in the gnat2why executable
if Alfa_Mode then
-- Set strict standard interpretation of compiler permissions
......
......@@ -26,6 +26,7 @@
with Aspects; use Aspects;
with Atree; use Atree;
with Checks; use Checks;
with Debug; use Debug;
with Einfo; use Einfo;
with Elists; use Elists;
with Errout; use Errout;
......@@ -4253,6 +4254,14 @@ package body Sem_Ch13 is
return;
end if;
-- Ignore enumeration rep clauses by default in CodePeer mode,
-- unless -gnatd.I is specified, as a work around for potential false
-- positive messages.
if CodePeer_Mode and not Debug_Flag_Dot_II then
return;
end if;
-- First some basic error checks
Find_Type (Ident);
......
......@@ -12984,6 +12984,19 @@ package body Sem_Util is
else
Desc := P;
P := Parent (P);
-- A special Ada 2012 case: the original node may be part
-- of the else_actions of a conditional expression, in which
-- case it might not have been expanded yet, and appears in
-- a non-syntactic list of actions. In that case it is clearly
-- not safe to save a value.
if No (P)
and then Is_List_Member (Desc)
and then No (Parent (List_Containing (Desc)))
then
return False;
end if;
end if;
end loop;
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