Commit bebbff91 by Arnaud Charlet

a-stmaco.ads, [...]: Minor reformatting througout (including new function specs)…

a-stmaco.ads, [...]: Minor reformatting througout (including new function specs) Add ??? comments...

	* a-stmaco.ads, exp_util.ads, exp_util.adb, i-cpp.ads, i-cpp.adb:
	Minor reformatting througout (including new function specs)
	Add ??? comments asking for clarification.

From-SVN: r90901
parent ee575992
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
......@@ -70,7 +70,7 @@ private
others => False);
Graphic_Set : constant Character_Set :=
(L.Space .. L.Tilde => True,
(L.Space .. L.Tilde => True,
L.No_Break_Space .. L.LC_Y_Diaeresis => True,
others => False);
......@@ -107,7 +107,7 @@ private
others => False);
Decimal_Digit_Set : constant Character_Set :=
('0' .. '9' => True,
('0' .. '9' => True,
others => False);
Hexadecimal_Digit_Set : constant Character_Set :=
......
......@@ -257,8 +257,7 @@ package Exp_Util is
function Duplicate_Subexpr
(Exp : Node_Id;
Name_Req : Boolean := False)
return Node_Id;
Name_Req : Boolean := False) return Node_Id;
-- Given the node for a subexpression, this function makes a logical
-- copy of the subexpression, and returns it. This is intended for use
-- when the expansion of an expression needs to repeat part of it. For
......@@ -280,8 +279,7 @@ package Exp_Util is
function Duplicate_Subexpr_No_Checks
(Exp : Node_Id;
Name_Req : Boolean := False)
return Node_Id;
Name_Req : Boolean := False) return Node_Id;
-- Identical in effect to Duplicate_Subexpr, except that Remove_Checks
-- is called on the result, so that the duplicated expression does not
-- include checks. This is appropriate for use when Exp, the original
......@@ -290,8 +288,7 @@ package Exp_Util is
function Duplicate_Subexpr_Move_Checks
(Exp : Node_Id;
Name_Req : Boolean := False)
return Node_Id;
Name_Req : Boolean := False) return Node_Id;
-- Identical in effect to Duplicate_Subexpr, except that Remove_Checks
-- is called on Exp after the duplication is complete, so that the
-- original expression does not include checks. In this case the result
......@@ -482,8 +479,7 @@ package Exp_Util is
function Make_Subtype_From_Expr
(E : Node_Id;
Unc_Typ : Entity_Id)
return Node_Id;
Unc_Typ : Entity_Id) return Node_Id;
-- Returns a subtype indication corresponding to the actual type of an
-- expression E. Unc_Typ is an unconstrained array or record, or
-- a classwide type.
......@@ -536,8 +532,7 @@ package Exp_Util is
function Target_Has_Fixed_Ops
(Left_Typ : Entity_Id;
Right_Typ : Entity_Id;
Result_Typ : Entity_Id)
return Boolean;
Result_Typ : Entity_Id) return Boolean;
-- Returns True if and only if the target machine has direct support
-- for fixed-by-fixed multiplications and divisions for the given
-- operand and result types. This is called in package Exp_Fixd to
......
......@@ -38,6 +38,8 @@ with Unchecked_Conversion;
package body Interfaces.CPP is
-- The declarations below need (extensive) comments ???
subtype Cstring is String (Positive);
type Cstring_Ptr is access all Cstring;
type Tag_Table is array (Natural range <>) of Vtable_Ptr;
......@@ -52,7 +54,7 @@ package body Interfaces.CPP is
end record;
type Vtable_Entry is record
Pfn : System.Address;
Pfn : System.Address;
end record;
type Type_Specific_Data_Ptr is access all Type_Specific_Data;
......@@ -97,8 +99,7 @@ package body Interfaces.CPP is
function CPP_CW_Membership
(Obj_Tag : Vtable_Ptr;
Typ_Tag : Vtable_Ptr)
return Boolean
Typ_Tag : Vtable_Ptr) return Boolean
is
Pos : constant Integer := Obj_Tag.TSD.Idepth - Typ_Tag.TSD.Idepth;
begin
......@@ -138,8 +139,8 @@ package body Interfaces.CPP is
function CPP_Get_Prim_Op_Address
(T : Vtable_Ptr;
Position : Positive)
return Address is
Position : Positive) return Address
is
begin
return T.Prims_Ptr (Position).Pfn;
end CPP_Get_Prim_Op_Address;
......@@ -150,7 +151,6 @@ package body Interfaces.CPP is
function CPP_Get_RC_Offset (T : Vtable_Ptr) return SSE.Storage_Offset is
pragma Warnings (Off, T);
begin
return 0;
end CPP_Get_RC_Offset;
......@@ -161,7 +161,6 @@ package body Interfaces.CPP is
function CPP_Get_Remotely_Callable (T : Vtable_Ptr) return Boolean is
pragma Warnings (Off, T);
begin
return True;
end CPP_Get_Remotely_Callable;
......@@ -199,8 +198,8 @@ package body Interfaces.CPP is
(Old_TSD : Address;
New_Tag : Vtable_Ptr)
is
TSD : constant Type_Specific_Data_Ptr
:= To_Type_Specific_Data_Ptr (Old_TSD);
TSD : constant Type_Specific_Data_Ptr :=
To_Type_Specific_Data_Ptr (Old_TSD);
New_TSD : Type_Specific_Data renames New_Tag.TSD.all;
......@@ -266,7 +265,6 @@ package body Interfaces.CPP is
procedure CPP_Set_RC_Offset (T : Vtable_Ptr; Value : SSE.Storage_Offset) is
pragma Warnings (Off, T);
pragma Warnings (Off, Value);
begin
null;
end CPP_Set_RC_Offset;
......@@ -278,7 +276,6 @@ package body Interfaces.CPP is
procedure CPP_Set_Remotely_Callable (T : Vtable_Ptr; Value : Boolean) is
pragma Warnings (Off, T);
pragma Warnings (Off, Value);
begin
null;
end CPP_Set_Remotely_Callable;
......@@ -318,7 +315,6 @@ package body Interfaces.CPP is
function Expanded_Name (T : Vtable_Ptr) return String is
Result : constant Cstring_Ptr := T.TSD.Expanded_Name;
begin
return Result (1 .. Length (Result));
end Expanded_Name;
......@@ -329,7 +325,6 @@ package body Interfaces.CPP is
function External_Tag (T : Vtable_Ptr) return String is
Result : constant Cstring_Ptr := T.TSD.External_Tag;
begin
return Result (1 .. Length (Result));
end External_Tag;
......@@ -348,4 +343,5 @@ package body Interfaces.CPP is
return Len - 1;
end Length;
end Interfaces.CPP;
......@@ -33,6 +33,16 @@
-- Definitions for interfacing to C++ classes
-- This package corresponds to Ada.Tags but applied to tagged types which are
-- are imported from C++ and correspond exactly to a C++ Class. The code that
-- the GNAT front end generates does not know about the structure of the C++
-- dispatch table (Vtable) but always accesses it through the procedural
-- interface defined in this package, thus the implementation of this package
-- (the body) can be customized to another C++ compiler without any change in
-- the compiler code itself as long as this procedural interface is respected.
-- Note that Ada.Tags defines a very similar procedural interface to the
-- regular Ada Dispatch Table.
with System;
with System.Storage_Elements;
......@@ -41,23 +51,15 @@ package Interfaces.CPP is
package S renames System;
package SSE renames System.Storage_Elements;
-- This package corresponds to Ada.Tags but applied to tagged
-- types which are 'imported' from C++ and correspond exactly to a
-- C++ Class. GNAT doesn't know about the structure of the C++
-- dispatch table (Vtable) but always accesses it through the
-- procedural interface defined below, thus the implementation of
-- this package (the body) can be customized to another C++
-- compiler without any change in the compiler code itself as long
-- as this procedural interface is respected. Note that Ada.Tags
-- defines a very similar procedural interface to the regular Ada
-- Dispatch Table.
type Vtable_Ptr is private;
function Expanded_Name (T : Vtable_Ptr) return String;
function External_Tag (T : Vtable_Ptr) return String;
private
-- These subprograms are in the private part. They are never accessed
-- directly except from compiler generated code, which has access to
-- private components of packages via the Rtsfind interface.
procedure CPP_Set_Prim_Op_Address
(T : Vtable_Ptr;
......
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