diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-26 08:15:24 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-26 08:15:24 +0000 |
commit | 6c5793cde82f916e03b7a514124fafd1189d7c34 (patch) | |
tree | 581bde70e3975c92ecbf185b6e851dcc262fcddd /gcc/ada/einfo.adb | |
parent | 3895d3f38b347092d175291594d61c76ec82569e (diff) | |
download | gcc-6c5793cde82f916e03b7a514124fafd1189d7c34.tar.gz |
2015-05-26 Robert Dewar <dewar@adacore.com>
* aspects.ads, aspects.adb: Add aspect Disable_Controlled.
* einfo.ads, einfo.adb (Disable_Controlled): New flag.
(Is_Controlled_Active): New function.
* exp_ch3.adb (Expand_Freeze_Record_Type): Use
Is_Controlled_Active.
* exp_util.adb (Needs_Finalization): Finalization not needed
if Disable_Controlled set.
* freeze.adb (Freeze_Array_Type): Do not set
Has_Controlled_Component if the component has Disable_Controlled.
(Freeze_Record_Type): ditto.
* sem_ch13.adb (Decorate): Minor reformatting.
(Analyze_Aspect_Specifications): Implement Disable_Controlled.
* sem_ch3.adb (Analyze_Object_Declaration): Handle
Disable_Controlled.
(Array_Type_Declaration): ditto.
(Build_Derived_Private_Type): ditto.
(Build_Derived_Type): ditto.
(Record_Type_Definition): ditto.
* snames.ads-tmpl: Add Name_Disable_Controlled.
2015-05-26 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch6.adb (Expand_Actuals): Use a constant declaration instead
of a renaming to capture the return value of a function call.
(Expand_Simple_Function_Return): Call Remove_Side_Effects
instead of removing side effects manually before the call to
_Postconditions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223667 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/einfo.adb')
-rw-r--r-- | gcc/ada/einfo.adb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 2c9a4bab0f9..285e924c11a 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -558,6 +558,7 @@ package body Einfo is -- Has_Implicit_Dereference Flag251 -- Is_Processed_Transient Flag252 + -- Disable_Controlled Flag253 -- Is_Implementation_Defined Flag254 -- Is_Predicate_Function Flag255 -- Is_Predicate_Function_M Flag256 @@ -595,7 +596,6 @@ package body Einfo is -- Is_Volatile_Full_Access Flag285 -- Needs_Typedef Flag286 - -- (unused) Flag253 -- (unused) Flag287 -- (unused) Flag288 -- (unused) Flag289 @@ -1026,6 +1026,11 @@ package body Einfo is return Node20 (Id); end Directly_Designated_Type; + function Disable_Controlled (Id : E) return B is + begin + return Flag253 (Base_Type (Id)); + end Disable_Controlled; + function Discard_Names (Id : E) return B is begin return Flag88 (Id); @@ -3941,6 +3946,12 @@ package body Einfo is Set_Node20 (Id, V); end Set_Directly_Designated_Type; + procedure Set_Disable_Controlled (Id : E; V : B := True) is + begin + pragma Assert (Is_Type (Id) and then Is_Base_Type (Id)); + Set_Flag253 (Id, V); + end Set_Disable_Controlled; + procedure Set_Discard_Names (Id : E; V : B := True) is begin Set_Flag88 (Id, V); @@ -7394,6 +7405,15 @@ package body Einfo is K = E_Constant or else K = E_In_Parameter or else K = E_Loop_Parameter; end Is_Constant_Object; + -------------------------- + -- Is_Controlled_Active -- + -------------------------- + + function Is_Controlled_Active (Id : E) return B is + begin + return Is_Controlled (Id) and then not Disable_Controlled (Id); + end Is_Controlled_Active; + -------------------- -- Is_Discriminal -- -------------------- |