Fname := Get_File_Name (Sname, Subunit => False);
Src_Ind := Load_Source_File (Fname);
- -- Case where body is present and it is not a subunit. Exclude
- -- the subunit case, because it has nothing to do with the
- -- package we are compiling. It is illegal for a child unit and a
- -- subunit with the same expanded name (RM 10.2(9)) to appear
- -- together in a partition, but there is nothing to stop a
- -- compilation environment from having both, and the test here
- -- simply allows that. If there is an attempt to include both in
- -- a partition, this is diagnosed at bind time. In Ada 83 mode
- -- this is not a warning case.
-
- -- Note: if weird file names are being used, we can have
- -- situation where the file name that supposedly contains body,
- -- in fact contains a spec, or we can't tell what it contains.
- -- Skip the error message in these cases.
+ -- Case where body is present and it is not a subunit. Exclude the
+ -- subunit case, because it has nothing to do with the package we are
+ -- compiling. It is illegal for a child unit and a subunit with the
+ -- same expanded name (RM 10.2(9)) to appear together in a partition,
+ -- but there is nothing to stop a compilation environment from having
+ -- both, and the test here simply allows that. If there is an attempt
+ -- to include both in a partition, this is diagnosed at bind time. In
+ -- Ada 83 mode this is not a warning case.
+
+ -- Note: if weird file names are being used, we can have a situation
+ -- where the file name that supposedly contains body in fact contains
+ -- a spec, or we can't tell what it contains. Skip the error message
+ -- in these cases.
-- Also ignore body that is nothing but pragma No_Body; (that's the
-- whole point of this pragma, to be used this way and to cause the
if S = No_Source_File then
Write_Line
("fatal error, run-time library not installed correctly");
- Write_Line
- ("cannot locate file system.ads");
+ Write_Line ("cannot locate file system.ads");
raise Unrecoverable_Error;
-- Remember source index of system.ads (which was read successfully)
-- subunits. Note that we always generate code for all generic units (a
-- change from some previous versions of GNAT).
- elsif Main_Kind = N_Subprogram_Body
- and then not Subunits_Missing
- then
+ elsif Main_Kind = N_Subprogram_Body and then not Subunits_Missing then
Back_End_Mode := Generate_Object;
-- We can generate code for a package body unless there are subunits
-- missing (note that we always generate code for generic units, which
-- is a change from some earlier versions of GNAT).
- elsif Main_Kind = N_Package_Body
- and then not Subunits_Missing
- then
+ elsif Main_Kind = N_Package_Body and then not Subunits_Missing then
Back_End_Mode := Generate_Object;
-- We can generate code for a package declaration or a subprogram
Exit_Program (E_No_Code);
end if;
- -- In -gnatc mode, we only do annotation if -gnatt or -gnatR is also
- -- set as indicated by Back_Annotate_Rep_Info being set to True.
+ -- In -gnatc mode, we only do annotation if -gnatt or -gnatR is also set
+ -- as indicated by Back_Annotate_Rep_Info being set to True.
-- We don't call for annotations on a subunit, because to process those
-- the back-end requires that the parent(s) be properly compiled.
-- Annotation is suppressed for targets where front-end layout is
-- enabled, because the front end determines representations.
- -- Annotation is also suppressed in the case of compiling for
- -- a VM, since representations are largely symbolic there.
+ -- Annotation is also suppressed in the case of compiling for a VM,
+ -- since representations are largely symbolic there.
if Back_End_Mode = Declarations_Only
and then (not (Back_Annotate_Rep_Info or Generate_SCIL)
Write_ALI (Object => (Back_End_Mode = Generate_Object));
- -- Generate the ASIS tree after writing the ALI file, since in ASIS
- -- mode, Write_ALI may in fact result in further tree decoration from
- -- the original tree file. Note that we dump the tree just before
- -- generating it, so that the dump will exactly reflect what is written
- -- out.
+ -- Generate ASIS tree after writing the ALI file, since in ASIS mode,
+ -- Write_ALI may in fact result in further tree decoration from the
+ -- original tree file. Note that we dump the tree just before generating
+ -- it, so that the dump will exactly reflect what is written out.
Treepr.Tree_Dump;
Tree_Gen;
procedure Cannot_Inline (Msg : String; N : Node_Id; Subp : Entity_Id) is
begin
- -- Do not emit warning if this is a predefined unit which is not
- -- the main unit. With validity checks enabled, some predefined
- -- subprograms may contain nested subprograms and become ineligible
- -- for inlining.
+ -- Do not emit warning if this is a predefined unit which is not the
+ -- main unit. With validity checks enabled, some predefined subprograms
+ -- may contain nested subprograms and become ineligible for inlining.
if Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Subp)))
and then not In_Extended_Main_Source_Unit (Subp)
end;
end if;
- -- If there is an overridden subprogram, then check that there is not
- -- a "not overriding" indicator, and mark the subprogram as overriding.
+ -- If there is an overridden subprogram, then check that there is no
+ -- "not overriding" indicator, and mark the subprogram as overriding.
-- This is not done if the overridden subprogram is marked as hidden,
-- which can occur for the case of inherited controlled operations
-- (see Derive_Subprogram), unless the inherited subprogram's parent
-- If Subp is an operator, it may override a predefined operation, if
-- it is defined in the same scope as the type to which it applies.
- -- In that case overridden_subp is empty because of our implicit
+ -- In that case Overridden_Subp is empty because of our implicit
-- representation for predefined operators. We have to check whether the
-- signature of Subp matches that of a predefined operator. Note that
-- first argument provides the name of the operator, and the second
elsif Nkind (Subp) = N_Defining_Operator_Symbol then
declare
Typ : constant Entity_Id :=
- Base_Type (Etype (First_Formal (Subp)));
+ Base_Type (Etype (First_Formal (Subp)));
Can_Override : constant Boolean :=
Operator_Matches_Spec (Subp, Subp)
elsif Can_Override then
Error_Msg_NE
- ("subprogram & overrides predefined operator ",
- Spec, Subp);
+ ("subprogram& overrides predefined operator ", Spec, Subp);
end if;
elsif Must_Override (Spec) then