This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
This patch modifies the analysis of aspects Depends and Global. The machinery can now process renamings of entire objects. Legal renamings are replaced by the object they rename. ------------ -- Source -- ------------ -- renamings.ads package Renamings with Abstract_State => (Input_State with Volatile, Input) is type Composite_Record is record Comp : Integer; end record; Rec : Composite_Record; type Composite_Array is array (1 .. 5) of Composite_Record; Arr : Composite_Array; -- "entire object" renamings Ren_1 : Composite_Record renames Rec; Ren_2 : Composite_Record renames Ren_1; -- illegal renamings Ren_3 : Integer renames Rec.Comp; Ren_4 : Composite_Record renames Arr (3); Ren_5 : Integer renames Arr (3).Comp; procedure OK_1 with Global => Ren_1; procedure OK_2 with Global => Ren_2; procedure Error_1 with Global => (Rec, Ren_1, Ren_2); procedure Error_2 with Global => (Ren_3, Ren_4, Ren_5); end Renamings; -- replacement.ads package Replacement is Obj : Integer; Ren : Integer renames Obj; procedure OK_1 with Global => Ren; function OK_2 return Integer with Depends => (OK_2'Result => Ren); end Replacement; ---------------------------- -- Compilation and output -- ---------------------------- $ gcc -c -gnat12 -gnatd.V renamings.ads $ gcc -c -gnat12 -gnatd.V -gnatdg replacement.ads renamings.ads:27:27: duplicate global item renamings.ads:27:34: duplicate global item renamings.ads:29:22: global item must denote variable or state renamings.ads:29:29: global item must denote variable or state renamings.ads:29:36: global item must denote variable or state Source recreated from tree for Replacement (spec) replacement_E : short_integer := 0; package replacement is replacement__obj : integer; replacement__ren___XR_replacement__obj___XE : _renaming_type; replacement__ren : integer renames replacement__obj; procedure replacement__ok_1 with global => ren; function replacement__ok_2 return integer with depends => ( replacement__ok_2'result => replacement__obj); pragma depends (( replacement__ok_2'result => replacement__obj)); pragma global (replacement__obj); freeze replacement__ok_1 [] end replacement; cannot generate code for file replacement.ads (package spec) Tested on x86_64-pc-linux-gnu, committed on trunk 2013-04-11 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Both pragma Depends and Global can now support renamings of entire objects. Legal renamings are replaced by the object they rename. (Is_Renaming): New routine.
Attachment:
difs
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |