+2012-12-05 Ed Schonberg <schonberg@adacore.com>
+
+ * s-rident.ads, restrict.ads: Remove discrepancies between the
+ documentation on implementation-defined restrictions, and
+ the internal data structure used for warnings and errors on
+ implementation-defined restriction violations.
+
+2012-12-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Chain_PPC): Pre- and postcondition aspects
+ are legal on a subprogram body that acts as a spec.
+
+2012-12-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Find_Selected_Component): If the selector name is
+ an overloadable entity but the name is not overloaded, generate
+ reference to it rather than delaying this until resolution.
+
+2012-12-05 Robert Dewar <dewar@adacore.com>
+
+ * checks.ads, checks.adb (Activate_Overflow_Check): No effect for
+ MOD/REM/unary +
+ * exp_ch4.adb (Expand_N_Op_Mod): Remove call to set Do_Overflow_Check.
+
+2012-12-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb (Find_Non_Universal_Interpretation): Use the
+ types of the right operand if the left operand is null.
+
+2012-12-05 Sergey Rybin <rybin@adacore.com frybin>
+
+ * gnat_ugn.texi, vms_data.ads: document gnatpp -nn option.
+
+2012-12-05 Jose Ruiz <ruiz@adacore.com>
+
+ * init.c (__gnat_install_handler): For the LEON VxWorks kernel
+ run-time library we need to install a trap handler directly in the
+ trap table (no support by the OS) for the software trap 0.
+
2012-12-05 Eric Botcazou <ebotcazou@adacore.com>
* gnat_rm.texi (Interfacing to C++): Document new restrictions.
procedure Activate_Overflow_Check (N : Node_Id) is
begin
- Set_Do_Overflow_Check (N, True);
- Possible_Local_Raise (N, Standard_Constraint_Error);
+ if not Nkind_In (N, N_Op_Rem, N_Op_Mod, N_Op_Plus) then
+ Set_Do_Overflow_Check (N, True);
+ Possible_Local_Raise (N, Standard_Constraint_Error);
+ end if;
end Activate_Overflow_Check;
--------------------------
-- Sets Do_Overflow_Check flag in node N, and handles possible local raise.
-- Always call this routine rather than calling Set_Do_Overflow_Check to
-- set an explicit value of True, to ensure handling the local raise case.
+ -- Note that this call has no effect for MOD, REM, and unary "+" for which
+ -- overflow is never possible in any case.
procedure Activate_Range_Check (N : Node_Id);
pragma Inline (Activate_Range_Check);
procedure Expand_N_Op_Mod (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
- DOC : constant Boolean := Do_Overflow_Check (N);
DDC : constant Boolean := Do_Division_Check (N);
Left : Node_Id;
Set_Entity (N, Standard_Entity (S_Op_Rem));
Set_Etype (N, Typ);
- Set_Do_Overflow_Check (N, DOC);
Set_Do_Division_Check (N, DDC);
Expand_N_Op_Rem (N);
Set_Analyzed (N);
Names introduced by type and subtype declarations are always in
mixed case. Overrides ^-n^/NAME_CASING^ casing setting.
+@item ^-nnU^/NUMBER_CASING=UPPER_CASE^
+Names introduced by number declarations are always in
+upper case. Overrides ^-n^/NAME_CASING^ casing setting.
+
+@item ^-nnL^/NUMBER_CASING=LOWER_CASE^
+Names introduced by number declarations are always in
+lower case. Overrides ^-n^/NAME_CASING^ casing setting.
+
+@item ^-nnM^/NUMBER_CASING=MIXED_CASE^
+Names introduced by number declarations are always in
+mixed case. Overrides ^-n^/NAME_CASING^ casing setting.
+
@cindex @option{^-p@var{x}^/PRAGMA_CASING^} (@command{gnatpp})
@item ^-pL^/PRAGMA_CASING=LOWER_CASE^
Pragma names are lower case
#endif
}
+#if defined(__leon__) && defined(_WRS_KERNEL)
+/* For LEON VxWorks we need to install a trap handler for stack overflow */
+
+extern void excEnt (void);
+/* VxWorks exception handler entry */
+
+struct trap_entry {
+ unsigned long inst_first;
+ unsigned long inst_second;
+ unsigned long inst_third;
+ unsigned long inst_fourth;
+};
+/* Four instructions representing entries in the trap table */
+
+struct trap_entry *trap_0_entry;
+/* We will set the location of the entry for software trap 0 in the trap
+ table. */
+#endif
+
void
__gnat_install_handler (void)
{
sigaction (SIGSEGV, &act, NULL);
sigaction (SIGBUS, &act, NULL);
+#if defined(__leon__) && defined(_WRS_KERNEL)
+ /* Specific to the LEON VxWorks kernel run-time library */
+
+ /* For stack checking the compiler triggers a software trap 0 (ta 0) in
+ case of overflow (we use the stack limit mechanism). We need to install
+ the trap handler here for this software trap (the OS does not handle
+ it) as if it were a data_access_exception (trap 9). We do the same as
+ if we put in the trap table a VXSPARC_BAD_TRAP(9). Software trap 0 is
+ located at vector 0x80, and each entry takes 4 words. */
+
+ trap_0_entry = (struct trap_entry *)(intVecBaseGet () + 0x80 * 4);
+
+ /* mov 0x9, %l7 */
+
+ trap_0_entry->inst_first = 0xae102000 + 9;
+
+ /* sethi %hi(excEnt), %l6 */
+
+ /* The 22 most significant bits of excEnt are obtained shifting 10 times
+ to the right. */
+
+ trap_0_entry->inst_second = 0x2d000000 + ((unsigned long)excEnt >> 10);
+
+ /* jmp %l6+%lo(excEnt) */
+
+ /* The 10 least significant bits of excEnt are obtained by masking */
+
+ trap_0_entry->inst_third = 0x81c5a000 + ((unsigned long)excEnt & 0x3ff);
+
+ /* rd %psr, %l0 */
+
+ trap_0_entry->inst_fourth = 0xa1480000;
+#endif
+
__gnat_handler_installed = 1;
}
Implementation_Restriction : array (All_Restrictions) of Boolean :=
(Simple_Barriers => True,
- No_Asynchronous_Control => True,
No_Calendar => True,
+ No_Default_Initialization => True,
+ No_Direct_Boolean_Operators => True,
No_Dispatching_Calls => True,
No_Dynamic_Attachment => True,
No_Elaboration_Code => True,
No_Entry_Calls_In_Elaboration_Code => True,
No_Entry_Queue => True,
No_Exception_Handlers => True,
+ No_Exception_Propagation => True,
No_Exception_Registration => True,
+ No_Finalization => True,
No_Implementation_Attributes => True,
No_Implementation_Pragmas => True,
No_Implicit_Conditionals => True,
+ No_Implicit_Aliasing => True,
No_Implicit_Dynamic_Code => True,
No_Implicit_Loops => True,
+ No_Initialize_Scalars => True,
No_Local_Protected_Objects => True,
No_Protected_Type_Allocators => True,
No_Relative_Delay => True,
No_Secondary_Stack => True,
No_Select_Statements => True,
No_Standard_Storage_Pools => True,
+ No_Stream_Optimizations => True,
No_Streams => True,
No_Task_Attributes_Package => True,
No_Task_Termination => True,
- No_Unchecked_Conversion => True,
- No_Unchecked_Deallocation => True,
+ No_Tasking => True,
No_Wide_Characters => True,
Static_Priorities => True,
Static_Storage_Size => True,
+ SPARK => True,
others => False);
-- The following table records entries made by Restrictions pragmas
No_Allocators, -- (RM H.4(7))
No_Allocators_After_Elaboration, -- Ada 2012 (RM D.7(19.1/2))
No_Anonymous_Allocators, -- Ada 2012 (RM H.4(8/1))
- No_Asynchronous_Control, -- (RM D.7(10))
+ No_Asynchronous_Control, -- (RM J.13(3/2)
No_Calendar, -- GNAT
No_Default_Stream_Attributes, -- Ada 2012 (RM 13.12.1(4/2))
No_Delay, -- (RM H.4(21))
No_Tasking, -- GNAT
No_Terminate_Alternatives, -- (RM D.7(6))
No_Unchecked_Access, -- (RM H.4(18))
- No_Unchecked_Conversion, -- (RM H.4(16))
- No_Unchecked_Deallocation, -- (RM H.4(9))
+ No_Unchecked_Conversion, -- (RM J.13(4/2))
+ No_Unchecked_Deallocation, -- (RM J.13(5/2))
Static_Priorities, -- GNAT
Static_Storage_Size, -- GNAT
-- of the operand types. If one of the operands has a universal interpre-
-- tation, the legality check uses some compatible non-universal
-- interpretation of the other operand. N can be an operator node, or
- -- a function call whose name is an operator designator.
+ -- a function call whose name is an operator designator. Any_Access, which
+ -- is the initial type of the literal NULL, is a universal type for the
+ -- purpose of this routine.
function Find_Primitive_Operation (N : Node_Id) return Boolean;
-- Find candidate interpretations for the name Obj.Proc when it appears
begin
if T1 = Universal_Integer
or else T1 = Universal_Real
+ or else T1 = Any_Access
then
if not Is_Overloaded (R) then
Add_One_Interp
null;
end if;
end if;
+
+ -- If there is a single interpretation for N we can generate a
+ -- reference to the unique entity found.
+
+ if Is_Overloadable (Id) and then not Is_Overloaded (N) then
+ Generate_Reference (Id, N);
+ end if;
end Find_Expanded_Name;
-------------------------
Error_Pragma
("aspect % requires ''Class for null procedure");
+ -- Pre/postconditions are legal on a subprogram body if it is not
+ -- a completion of a declaration.
+
+ elsif Nkind (PO) = N_Subprogram_Body
+ and then Acts_As_Spec (PO)
+ then
+ null;
+
elsif not Nkind_In (PO, N_Subprogram_Declaration,
N_Expression_Function,
N_Generic_Subprogram_Declaration,
--
-- Replace all tabulations in comments with spaces.
+ S_Pretty_Numbers : aliased constant S := "/NUMBER_CASING=" &
+ "AS_DECLARED " &
+ "-ntD " &
+ "LOWER_CASE " &
+ "-ntL " &
+ "UPPER_CASE " &
+ "-ntU " &
+ "MIXED_CASE " &
+ "-ntM";
+ -- /NUMBER_CASING=name-option
+ --
+ -- Specify the casing of named number names. If not specified, the casing
+ -- of these names is defined by the NAME_CASING option. 'name-option'
+ -- is one of:
+ --
+ -- AS_DECLARED Names are cased as they appear in the declaration
+ -- in the source file.
+ --
+ -- LOWER_CASE Names are in lower case.
+ --
+ -- UPPER_CASE Names are in upper case.
+ --
+ -- MIXED_CASE Names are in mixed case.
+
S_Pretty_Output : aliased constant S := "/OUTPUT=@" &
"-o@";
-- /OUTPUT=file
S_Pretty_Names 'Access,
S_Pretty_No_Labels 'Access,
S_Pretty_Notabs 'Access,
+ S_Pretty_Numbers 'Access,
S_Pretty_Output 'Access,
S_Pretty_Override 'Access,
S_Pretty_Pragma 'Access,