+2014-07-18 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch7.adb: Minor reformatting.
+
+2014-07-18 Claire Dross <dross@adacore.com>
+
+ * sem_aux.ads (Get_Binary_Nkind): New function that returns
+ the Node_Kind value of an entity defining a binary operator.
+ (Get_Unary_Nkind): New function that returns the Node_Kind value
+ of an entity defining a unary operator.
+
+2014-07-18 Pascal Obry <obry@adacore.com>
+
+ * sysdep.c: comment update.
+ * adaint.c (__gnat_fputwc): Use wchar_t on a limited set of
+ platforms where it is known to be supported.
+
+2014-07-18 Thomas Quinot <quinot@adacore.com>
+
+ * sem_dist.adb (Process_Remote_AST_Declaration): Need
+ to set Fat_Type's Ekind in order to be able to use its
+ Corresponding_Remote_Type attribute.
+
2014-07-18 Hristian Kirtchev <kirtchev@adacore.com>
* einfo.adb Last_Aggregate_Assignment is now Node 30.
#else
#include <utime.h>
-#if ! defined (__vxworks)
-#include <wchar.h>
-#endif
#endif
#if defined (_WIN32)
#endif
}
+#if defined (_WIN32) || defined (linux) || defined (sun) \
+ || defined (__FreeBSD__)
+#define HAS_TARGET_WCHAR_T
+#endif
+
+#ifdef HAS_TARGET_WCHAR_T
+#include <wchar.h>
+#endif
+
int
__gnat_fputwc(int c, FILE *stream)
{
-#if ! defined (__vxworks)
+#ifdef HAS_TARGET_WCHAR_T
return fputwc ((wchar_t)c, stream);
#else
return fputc (c, stream);
Label_Construct => Label));
-- Create the associated jump with this object, generate:
- --
+
-- when <counter> =>
-- goto L<counter>;
Name => New_Occurrence_Of (Entity (Label_Id), Loc)))));
-- Insert the jump destination, generate:
- --
+
-- <<L<counter>>>
Append_To (Finalizer_Stmts, Label);
-- Free (Ptr_Typ (Temp));
-- end;
-- end if;
- --
+
-- The generated code effectively detaches the temporary from the
-- caller finalization master and deallocates the object. This is
-- disabled on .NET/JVM because pools are not supported.
with Atree; use Atree;
with Einfo; use Einfo;
-with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Uintp; use Uintp;
return Empty;
end First_Tag_Component;
+ ---------------------
+ -- Get_Binary_Nkind --
+ ---------------------
+
+ function Get_Binary_Nkind (Op : Entity_Id) return Node_Kind is
+ Name : constant String := Get_Name_String (Chars (Op));
+ begin
+ if Name = "Oadd" then
+ return N_Op_Add;
+ elsif Name = "Oconcat" then
+ return N_Op_Concat;
+ elsif Name = "Oexpon" then
+ return N_Op_Expon;
+ elsif Name = "Osubtract" then
+ return N_Op_Subtract;
+ elsif Name = "Omod" then
+ return N_Op_Mod;
+ elsif Name = "Omultiply" then
+ return N_Op_Multiply;
+ elsif Name = "Odivide" then
+ return N_Op_Divide;
+ elsif Name = "Orem" then
+ return N_Op_Rem;
+ elsif Name = "Oand" then
+ return N_Op_And;
+ elsif Name = "Oeq" then
+ return N_Op_Eq;
+ elsif Name = "Oge" then
+ return N_Op_Ge;
+ elsif Name = "Ogt" then
+ return N_Op_Gt;
+ elsif Name = "Ole" then
+ return N_Op_Le;
+ elsif Name = "Olt" then
+ return N_Op_Lt;
+ elsif Name = "One" then
+ return N_Op_Ne;
+ elsif Name = "Oxor" then
+ return N_Op_Or;
+ elsif Name = "Oor" then
+ return N_Op_Xor;
+ else
+ raise Program_Error;
+ end if;
+ end Get_Binary_Nkind;
+
------------------
-- Get_Rep_Item --
------------------
return Empty;
end Get_Rep_Pragma;
+ ---------------------
+ -- Get_Unary_Nkind --
+ ---------------------
+
+ function Get_Unary_Nkind (Op : Entity_Id) return Node_Kind is
+ Name : constant String := Get_Name_String (Chars (Op));
+ begin
+ if Name = "Oabs" then
+ return N_Op_Abs;
+ elsif Name = "Osubtract" then
+ return N_Op_Minus;
+ elsif Name = "Onot" then
+ return N_Op_Not;
+ elsif Name = "Oadd" then
+ return N_Op_Plus;
+ else
+ raise Program_Error;
+ end if;
+ end Get_Unary_Nkind;
+
---------------------------------
-- Has_External_Tag_Rep_Clause --
---------------------------------
with Namet; use Namet;
with Table;
with Types; use Types;
+with Sinfo; use Sinfo;
package Sem_Aux is
-- Given an entity for a package or generic package, return corresponding
-- package specification. Simplifies handling of child units, and better
-- than the old idiom: Specification (Unit_Declaration_Node (Pack_Id)).
+
+ function Get_Binary_Nkind (Op : Entity_Id) return Node_Kind;
+ -- Op must be an entity with an Ekind of E_Operator.
+ -- This function returns the Nkind value that would
+ -- be used to construct a binary operator node referencing
+ -- this entity. It is an error to call this function
+ -- if Ekind (Op) /= E_Operator.
+
+ function Get_Unary_Nkind (Op : Entity_Id) return Node_Kind;
+ -- Op must be an entity with an Ekind of E_Operator.
+ -- This function returns the Nkind value that would
+ -- be used to construct a unary operator node referencing
+ -- this entity. It is an error to call this function
+ -- if Ekind (Op) /= E_Operator.
end Sem_Aux;
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
New_Occurrence_Of (RACW_Type, Loc)))))));
Set_Equivalent_Type (User_Type, Fat_Type);
+
+ -- Set Fat_Type's Etype early so that we can use its
+ -- Corresponding_Remote_Type attribute, whose presence indicates that
+ -- this is the record type used to implement a RAS.
+
+ Set_Ekind (Fat_Type, E_Record_Type);
Set_Corresponding_Remote_Type (Fat_Type, User_Type);
+
Insert_After_And_Analyze (Subpkg_Body, Fat_Type_Decl);
-- The reason we suppress the initialization procedure is that we know
end-of-file.
The other target dependent declarations here are for the three functions
- __gnat_set_binary_mode, __gnat_set_text_mode and __gnat_set_wide_text_mode:
+ __gnat_set_binary_mode, __gnat_set_text_mode and __gnat_set_mode:
void __gnat_set_binary_mode (int handle);
void __gnat_set_text_mode (int handle);
- void __gnat_set_wide_text_mode (int handle);
+ void __gnat_set_mode (int handle, int mode);
These functions have no effect in Unix (or similar systems where there is
no distinction between binary and text files), but in DOS (and similar