aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-02-20 15:04:38 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-02-20 15:04:38 +0100
commit3e586e100a61b0c1c9592740d5250d7604e7f685 (patch)
treede1a52fd70761d3b0bd18ba9a912bf4eaf01b22b /gcc/ada/sem_util.adb
parent7f568bfad328b73b207b06da80ccb99a4780c2ed (diff)
downloadgcc-3e586e100a61b0c1c9592740d5250d7604e7f685.zip
gcc-3e586e100a61b0c1c9592740d5250d7604e7f685.tar.gz
gcc-3e586e100a61b0c1c9592740d5250d7604e7f685.tar.bz2
[multiple changes]
2014-02-20 Robert Dewar <dewar@adacore.com> * a-cborma.adb, a-cbhama.adb, a-cbdlli.adb, a-cbmutr.adb: Use pragma Unmodified rather than Warnings (Off). Make comments uniform in the four affected units. 2014-02-20 Robert Dewar <dewar@adacore.com> * sem_ch13.adb (Analyze_Attribute_Definition_Clause, case Object_Size): For non-scalar types allow any value that is a multiple of 8. * gnat_rm.texi: Document Object_Size for composites more clearly. 2014-02-20 Yannick Moy <moy@adacore.com> * sem_util.ads, sem_util.adb (Default_Initialization): Remove function. 2014-02-20 Ed Schonberg <schonberg@adacore.com> * stand.ads: Raise_Type: new predefined entity, used as the type of a Raise_Expression prior to resolution. * cstand.adb: Build entity for Raise_Type. * sem_ch11.adb (Analyze_Raise_Expression): use Raise_Type as the initial type of the node. * sem_type.adb (Covers): Raise_Type is compatible with all other types. * sem_res.adb (Resolve): Remove special handling of Any_Type on Raise_Expression nodes. (Resolve_Raise_Expression): Signal ambiguity if the type of the context is still Raise_Type. From-SVN: r207950
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r--gcc/ada/sem_util.adb132
1 files changed, 0 insertions, 132 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 435db38..6b94f5a 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -4036,138 +4036,6 @@ package body Sem_Util is
end if;
end Deepest_Type_Access_Level;
- ----------------------------
- -- Default_Initialization --
- ----------------------------
-
- function Default_Initialization
- (Typ : Entity_Id) return Default_Initialization_Kind
- is
- Comp : Entity_Id;
- Init : Default_Initialization_Kind;
-
- FDI : Boolean := False;
- NDI : Boolean := False;
- -- Two flags used to designate whether a record type has at least one
- -- fully default initialized component and/or one not fully default
- -- initialized component.
-
- begin
- -- Access types are always fully default initialized
-
- if Is_Access_Type (Typ) then
- return Full_Default_Initialization;
-
- -- An array type subject to aspect/pragma Default_Component_Value is
- -- fully default initialized. Otherwise its initialization status is
- -- that of its component type.
-
- elsif Is_Array_Type (Typ) then
- if Present (Default_Aspect_Component_Value (Base_Type (Typ))) then
- return Full_Default_Initialization;
- else
- return Default_Initialization (Component_Type (Typ));
- end if;
-
- -- The initialization status of a private type depends on its full view
-
- elsif Is_Private_Type (Typ) and then Present (Full_View (Typ)) then
- return Default_Initialization (Full_View (Typ));
-
- -- Record and protected types offer several initialization options
- -- depending on their components (if any).
-
- elsif Is_Record_Type (Typ) or else Is_Protected_Type (Typ) then
- Comp := First_Component (Typ);
-
- -- Inspect all components
-
- if Present (Comp) then
- while Present (Comp) loop
-
- -- Do not process internally generated components except for
- -- _parent which represents the ancestor portion of a derived
- -- type.
-
- if Comes_From_Source (Comp)
- or else Chars (Comp) = Name_uParent
- then
- Init := Default_Initialization (Base_Type (Etype (Comp)));
-
- -- A component with mixed initialization renders the whole
- -- record/protected type mixed.
-
- if Init = Mixed_Initialization then
- return Mixed_Initialization;
-
- -- The component is fully default initialized when its type
- -- is fully default initialized or when the component has an
- -- initialization expression. Note that this has precedence
- -- given that the component type may lack initialization.
-
- elsif Init = Full_Default_Initialization
- or else Present (Expression (Parent (Comp)))
- then
- FDI := True;
-
- -- Components with no possible initialization are ignored
-
- elsif Init = No_Possible_Initialization then
- null;
-
- -- The component has no full default initialization
-
- else
- NDI := True;
- end if;
- end if;
-
- Next_Component (Comp);
- end loop;
-
- -- Detect a mixed case of initialization
-
- if FDI and NDI then
- return Mixed_Initialization;
-
- elsif FDI then
- return Full_Default_Initialization;
-
- elsif NDI then
- return No_Default_Initialization;
-
- -- The type either has no components or they are all internally
- -- generated.
-
- else
- return No_Possible_Initialization;
- end if;
-
- -- The record type is null, there is nothing to initialize
-
- else
- return No_Possible_Initialization;
- end if;
-
- -- A scalar type subject to aspect/pragma Default_Value is fully default
- -- initialized.
-
- elsif Is_Scalar_Type (Typ)
- and then Present (Default_Aspect_Value (Base_Type (Typ)))
- then
- return Full_Default_Initialization;
-
- -- Task types are always fully default initialized
-
- elsif Is_Task_Type (Typ) then
- return Full_Default_Initialization;
- end if;
-
- -- The type has no full default initialization
-
- return No_Default_Initialization;
- end Default_Initialization;
-
---------------------
-- Defining_Entity --
---------------------