summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_scil.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-11-30 12:55:21 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2009-11-30 12:55:21 +0100
commit828781519a85aa04c47b5057555938017cec3ae2 (patch)
tree59148f8fcc8d5a03432b0b4f1157f9066894a5d2 /gcc/ada/sem_scil.adb
parentfd0d899b57a1c3283bf47e414cad99e0f1bd3a2c (diff)
downloadgcc-828781519a85aa04c47b5057555938017cec3ae2.tar.gz
[multiple changes]
2009-11-30 Vincent Celier <celier@adacore.com> * gnatlink.adb (Process_Args): Call Executable_Name on argument of -o with Only_If_No_Suffix set to True. * osint.adb (Executable_Name): Do not add executable suffix if there is already a suffix and Only_If_No_Suffix is True. * osint.ads (Executable_Name): New Boolean parameter Only_If_No_Suffix, defaulted to False. 2009-11-30 Javier Miranda <miranda@adacore.com> * exp_atag.adb (Build_TSD): Change argument name because the actual is now the address of a tag (instead of the tag). Update implementation accordingly. (Build_CW_Membership): New implementation. Converted into a procedure because it has an additional out mode parameter. Its implementation has been rewritten to improve the generated code but also to facilitate referencing the relocated object node in the caller. * exp_atag.ads (Build_CW_Membership): Update profile and documentation. * sinfo.ads (N_SCIL_Membership_Test) New_Node. (SCIL_Tag_Value): New field of N_SCIL_Membership_Test nodes. (Is_Syntactic_Field): Add entry of new node. (SCIL_Tag_Value/Set_SCIL_Tag_Value): New subprograms. * sinfo.adb (SCIL_Related_Node, SCIL_Entity): Update assertions to handle N_SCIL_Membership_Test nodes. (SCIL_Tag_Value/Set_SCIL_Tag_Value): New subprograms. * sem.adb (Analyze): Add null management for new node. * sem_scil.adb (Find_SCIL_Node): Add null management for new node. (Check_SCIL_Node): Add checks of N_SCIL_Membership_Test nodes. * exp_ch4.adb (Tagged_Membership): Change profile from function to procedure. Add generation of SCIL node associated with class-wide membership test. (Expand_N_In): Complete decoration of SCIL nodes. * exp_intr.adb (Expand_Dispatching_Constructor_Call): Tune call to Build_CW_Membership because its profile has been changed. * exp_util.adb (Insert_Actions): Add null management for new node. * sprint.adb (Sprint_Node_Actual): Handle new node. * gcc-interface/trans.c Add no processing for N_SCIL_Membership_Test nodes. * gcc-interface/Make-lang.in: Update dependencies. 2009-11-30 Ed Schonberg <schonberg@adacore.com> * opt.ads: New flags Init_Or_Norm_Scalars_Config, Initialize_Scalars_Config, to capture the presence of the corresponding pragmas in a configuration file. * opt.adb (Register_, Save_, Set_, Restore_Opt_Configuration_Switches): handle new flags so that they are restored for each compilation unit. * frontend.adb: At the end of compilation, scan the context of the main unit to recover occurrences of pragma Initialize_Scalars, to annotate the ALI file accordingly. From-SVN: r154792
Diffstat (limited to 'gcc/ada/sem_scil.adb')
-rw-r--r--gcc/ada/sem_scil.adb52
1 files changed, 48 insertions, 4 deletions
diff --git a/gcc/ada/sem_scil.adb b/gcc/ada/sem_scil.adb
index cd4e66be554..977c07d6ddf 100644
--- a/gcc/ada/sem_scil.adb
+++ b/gcc/ada/sem_scil.adb
@@ -101,15 +101,58 @@ package body Sem_SCIL is
-- Check_SCIL_Node --
---------------------
- -- Is this a good name for the function, given it only deals with
- -- N_SCIL_Dispatching_Call case ???
-
function Check_SCIL_Node (N : Node_Id) return Traverse_Result is
Ctrl_Tag : Node_Id;
Ctrl_Typ : Entity_Id;
begin
- if Nkind (N) = N_SCIL_Dispatching_Call then
+ if Nkind (N) = N_SCIL_Membership_Test then
+
+ -- Check contents of the boolean expression associated with the
+ -- membership test.
+
+ pragma Assert (Nkind (SCIL_Related_Node (N)) = N_Identifier
+ and then Etype (SCIL_Related_Node (N)) = Standard_Boolean);
+
+ -- Check the entity identifier of the associated tagged type (that
+ -- is, in testing for membership in T'Class, the entity id of the
+ -- specific type T).
+
+ -- Note: When the SCIL node is generated the private and full-view
+ -- of the tagged types may have been swapped and hence the node
+ -- referenced by attribute SCIL_Entity may be the private view.
+ -- Therefore, in order to uniformily locate the full-view we use
+ -- attribute Underlying_Type.
+
+ pragma Assert (Is_Tagged_Type (Underlying_Type (SCIL_Entity (N))));
+
+ -- Interface types are unsupported
+
+ pragma Assert (not Is_Interface (Underlying_Type (SCIL_Entity (N))));
+
+ -- Check the decoration of the expression that denotes the tag value
+ -- being tested
+
+ Ctrl_Tag := SCIL_Tag_Value (N);
+
+ case Nkind (Ctrl_Tag) is
+
+ -- For class-wide membership tests the SCIL tag value is the tag
+ -- of the tested object (i.e. Obj.Tag).
+
+ when N_Selected_Component =>
+ pragma Assert (Etype (Ctrl_Tag) = RTE (RE_Tag));
+ null;
+
+ when others =>
+ pragma Assert (False);
+ null;
+
+ end case;
+
+ return Skip;
+
+ elsif Nkind (N) = N_SCIL_Dispatching_Call then
Ctrl_Tag := SCIL_Controlling_Tag (N);
-- SCIL_Related_Node of SCIL dispatching call nodes MUST reference
@@ -452,6 +495,7 @@ package body Sem_SCIL is
N_SCIL_Dispatch_Table_Object_Init |
N_SCIL_Dispatch_Table_Tag_Init |
N_SCIL_Dispatching_Call |
+ N_SCIL_Membership_Test |
N_SCIL_Tag_Init
=>
pragma Assert (False);