diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-09-08 10:11:07 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-09-08 10:11:07 +0000 |
commit | e3052f62a70ff946c45310d51aa669fc0c9c8876 (patch) | |
tree | 8e1841fc53228fa10a28187f264d68109d26a652 /gcc/ada/exp_prag.adb | |
parent | 882b5ac891a806ce03213c9178fe9c8c3a1cda08 (diff) | |
download | gcc-e3052f62a70ff946c45310d51aa669fc0c9c8876.tar.gz |
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* exp_intr.adb (Append_Entity_Name): Move to ...
* sem_util.ads, sem_util.adb: ... here to share it.
(Subprogram_Name): New subprogram, to compute the name of the enclosing
subprogram/entity.
* errutil.adb (Error_Msg): Fill new field Node.
* erroutc.ads (Subprogram_Name_Ptr): New.
(Error_Msg_Object): New field Node.
* erroutc.adb (dmsg, Output_Msg_Text): Take new field Node into account.
* errout.adb (Error_Msg): New variant with node id parameter.
Fill new parameter Node when emitting messages. Revert previous
changes for Include_Subprogram_In_Messages.
* sem_ch5.adb (Check_Unreachable_Code): Supply Node parameter when
generating warning message.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* par-ch4.adb (P_Iterated_Component_Association): Place construct
under -gnat2020 flag, given that it is a future feature of
the language.
* sem_aggr.adb (Resolve_Iterated_Component_Association): Mark
defining identifier as referenced to prevent spurious warnings:
corresponding loop is expanded into one or more loops whose
variable has the same name, and the expression uses those names
and not the original one.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251883 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_prag.adb')
-rw-r--r-- | gcc/ada/exp_prag.adb | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index dbb9d3ee3ef..57f60cd90eb 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -338,17 +338,22 @@ package body Exp_Prag is ------------------------------------------ procedure Replace_Discriminals_Of_Protected_Op (Expr : Node_Id) is - function Find_Corresponding_Discriminal (E : Entity_Id) - return Entity_Id; - -- Find the local entity that renames a discriminant of the - -- enclosing protected type, and has a matching name. + function Find_Corresponding_Discriminal + (E : Entity_Id) return Entity_Id; + -- Find the local entity that renames a discriminant of the enclosing + -- protected type, and has a matching name. + + function Replace_Discr_Ref (N : Node_Id) return Traverse_Result; + -- Replace a reference to a discriminant of the original protected + -- type by the local renaming declaration of the discriminant of + -- the target object. ------------------------------------ - -- find_Corresponding_Discriminal -- + -- Find_Corresponding_Discriminal -- ------------------------------------ - function Find_Corresponding_Discriminal (E : Entity_Id) - return Entity_Id + function Find_Corresponding_Discriminal + (E : Entity_Id) return Entity_Id is R : Entity_Id; @@ -369,35 +374,35 @@ package body Exp_Prag is return Empty; end Find_Corresponding_Discriminal; - function Replace_Discr_Ref (N : Node_Id) return Traverse_Result; - -- Replace a reference to a discriminant of the original protected - -- type by the local renaming declaration of the discriminant of - -- the target object. - ----------------------- -- Replace_Discr_Ref -- ----------------------- - function Replace_Discr_Ref (N : Node_Id) return Traverse_Result is + function Replace_Discr_Ref (N : Node_Id) return Traverse_Result is R : Entity_Id; begin if Is_Entity_Name (N) - and then Present (Discriminal_Link (Entity (N))) + and then Present (Discriminal_Link (Entity (N))) then R := Find_Corresponding_Discriminal (Entity (N)); Rewrite (N, New_Occurrence_Of (R, Sloc (N))); end if; + return OK; end Replace_Discr_Ref; procedure Replace_Discriminant_References is new Traverse_Proc (Replace_Discr_Ref); + -- Start of processing for Replace_Discriminals_Of_Protected_Op + begin Replace_Discriminant_References (Expr); end Replace_Discriminals_Of_Protected_Op; + -- Start of processing for Expand_Pragma_Check + begin -- Nothing to do if pragma is ignored |