+2014-08-01 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch10.adb: Minor reformatting.
+
+2014-08-01 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Same_Generic_Actual): Make function symmetric,
+ because either type may be a subtype of the other.
+
+2014-08-01 Vincent Celier <celier@adacore.com>
+
+ * makeusg.adb: Add documentation for debug switch -dn.
+
+2014-08-01 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_dim.adb (Process_Minus, Process_Divide): Label dimension
+ expression with standard operator and type, for pretty-printing
+ use, when in ASIS_Mode. When generating code dimensional analysis
+ is not involved and dimension expressions are handled statically,
+ and other operators are resolved in the usual way.
+
+2014-08-01 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Build_Derived_Record_Type): Remove setting of
+ Parent_Subtype in ASIS mode, leads to several failures.
+ * sem_ch4.adb (Analyze_Selected_Component): In an instance,
+ if the prefix is a type extension, check whether component is
+ declared in the parent type, possibly in a parent unit. Needed
+ in ASIS mode when Parent_Subtype is not set.
+
2014-08-01 Robert Dewar <dewar@adacore.com>
* sem_prag.adb: Minor reformatting.
Write_Eol;
Write_Eol;
+ -- Line for -dn
+
+ Write_Str (" -dn Do not delete temporary files");
+ Write_Eol;
+ Write_Eol;
+
Write_Str (" --create-map-file Create map file mainprog.map");
Write_Eol;
-- Avoid checking implicitly generated with clauses, limited with
-- clauses or withs that have pragma Elaborate or Elaborate_All.
- -- With_clauses introduced for renamings of parent clauses are not
- -- marked implicit because they need to be properly installed, but
- -- they do not come from source and do not require warnings.
if Nkind (Clause) = N_With_Clause
and then not Implicit_With (Clause)
and then not Limited_Present (Clause)
and then not Elaborate_Present (Clause)
+
+ -- With_clauses introduced for renamings of parent clauses
+ -- are not marked implicit because they need to be properly
+ -- installed, but they do not come from source and do not
+ -- require warnings.
+
and then Comes_From_Source (Clause)
then
-- Package body-to-spec check
-- STEP 5c: Process the record extension for non private tagged types
elsif not Private_Extension then
+ Expand_Record_Extension (Derived_Type, Type_Def);
- -- Add the _parent field in the derived type. In ASIS mode there is
- -- not enough semantic information for full expansion, but set the
- -- parent subtype to allow resolution of selected components in
- -- instance bodies.
-
- if ASIS_Mode then
- Set_Parent_Subtype (Derived_Type, Parent_Type);
- else
- Expand_Record_Extension (Derived_Type, Type_Def);
- end if;
+ -- Note : previously in ASIS mode we set the Parent_Subtype of the
+ -- derived type to propagate some semantic information. This led
+ -- to other ASIS failures and has been removed.
-- Ada 2005 (AI-251): Addition of the Tag corresponding to all the
-- implemented interfaces if we are in expansion mode
end loop;
if Present (Par) and then Is_Generic_Actual_Type (Par) then
+
-- Now look for component in ancestor types
Par := Generic_Parent_Type (Declaration_Node (Par));
or else Par = Etype (Par);
Par := Etype (Par);
end loop;
+
+ -- In ASIS mode the generic parent type may be absent. Examine
+ -- the parent type directly for a component that may have been
+ -- visible in a parent generic unit.
+
+ elsif Is_Derived_Type (Prefix_Type) then
+ Par := Etype (Prefix_Type);
+ Find_Component_In_Instance (Par);
end if;
end;
if No (Entity (Sel)) then
raise Program_Error;
end if;
+
return;
-- Component not found, specialize error message when appropriate
-- Check that the types of corresponding formals have the same
-- generic actual if any. We have to account for subtypes of a
-- generic formal, declared between a spec and a body, which may
- -- appear distinct in an instance but matched in the generic.
+ -- appear distinct in an instance but matched in the generic, and
+ -- the subtype may be used either in the spec or the body of the
+ -- subprogram being checked.
-------------------------
-- Same_Generic_Actual --
-------------------------
function Same_Generic_Actual (T1, T2 : Entity_Id) return Boolean is
+
+ function Is_Declared_Subtype (S1, S2 : Entity_Id) return Boolean;
+ -- Predicate to check whether S1 is a subtype of S2 in the source
+ -- of the instance.
+
+ -------------------------
+ -- Is_Declared_Subtype --
+ -------------------------
+
+ function Is_Declared_Subtype (S1, S2 : Entity_Id) return Boolean is
+ begin
+ return Comes_From_Source (Parent (S1))
+ and then Nkind (Parent (S1)) = N_Subtype_Declaration
+ and then Is_Entity_Name (Subtype_Indication (Parent (S1)))
+ and then Entity (Subtype_Indication (Parent (S1))) = S2;
+ end Is_Declared_Subtype;
+
+ -- Start of processing for Same_Generic_Actual
+
begin
return Is_Generic_Actual_Type (T1) = Is_Generic_Actual_Type (T2)
- or else
- (Present (Parent (T1))
- and then Comes_From_Source (Parent (T1))
- and then Nkind (Parent (T1)) = N_Subtype_Declaration
- and then Is_Entity_Name (Subtype_Indication (Parent (T1)))
- and then Entity (Subtype_Indication (Parent (T1))) = T2);
+ or else Is_Declared_Subtype (T1, T2)
+ or else Is_Declared_Subtype (T2, T1);
end Same_Generic_Actual;
-- Start of processing for Different_Generic_Profile
-- Provide minimal semantic information on dimension expressions,
-- even though they have no run-time existence. This is for use by
- -- ASIS tools, in particular pretty-printing.
+ -- ASIS tools, in particular pretty-printing. If generating code
+ -- standard operator resolution will take place.
+
+ if ASIS_Mode then
+ Set_Entity (N, Standard_Op_Minus);
+ Set_Etype (N, Standard_Integer);
+ end if;
- Set_Entity (N, Standard_Op_Minus);
- Set_Etype (N, Standard_Integer);
return Result;
end Process_Minus;
-- Provide minimal semantic information on dimension expressions,
-- even though they have no run-time existence. This is for use by
- -- ASIS tools, in particular pretty-printing.
+ -- ASIS tools, in particular pretty-printing. If generating code
+ -- standard operator resolution will take place.
+
+ if ASIS_Mode then
+ Set_Entity (N, Standard_Op_Divide);
+ Set_Etype (N, Standard_Integer);
+ end if;
- Set_Entity (N, Standard_Op_Divide);
- Set_Etype (N, Standard_Integer);
return Result;
end Process_Divide;