OSDN Git Service

2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Apr 2013 13:17:28 +0000 (13:17 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Apr 2013 13:17:28 +0000 (13:17 +0000)
commit57a50f49e9ebb0b8a51dd458dce7eb0a41895cc7
treec7c678d7b9c33b74d5c089d938c6fa6b9abda2eb
parent705808287cae898ee7ef41bc91bde7339df6f367
2013-04-12  Hristian Kirtchev  <kirtchev@adacore.com>

* aspects.adb: Alphabetize subprogram bodies in this unit. Add
an entry for Aspect_Ghost in the table of canonical aspects.
(Has_Aspect): New routine.
* aspects.ads: Add Aspect_Ghost to all relevant
tables. Alphabetize subprograms in this unit.
(Has_Aspect): New routine.
* einfo.adb: Add with and use clauses for Aspects.
(Is_Ghost_Function): New routine.
* einfo.ads: Add new synthesized attribute Is_Ghost_Function and
update the structure of the related nodes.
(Is_Ghost_Function): New routine.
* exp_ch4.adb (Find_Enclosing_Context): Use routine
Is_Body_Or_Package_Declaration to terminate a search.
(Is_Body_Or_Unit): Removed.
* exp_util.adb (Within_Case_Or_If_Expression): Use routine
Is_Body_Or_Package_Declaration to terminate a search.
* par-prag.adb: Add pragma Ghost to the list of pragmas that do
not need special processing by the parser.
* sem_attr.adb (Analyze_Access_Attribute): Detect an
illegal use of 'Access where the prefix is a ghost function.
(Analyze_Attribute): Use routine Is_Body_Or_Package_Declaration
to terminate a search. (Check_References_In_Prefix): Use routine
Is_Body_Or_Package_Declaration to terminate a search.
* sem_ch4.adb (Analyze_Call): Mark a function when it appears
inside an assertion expression.  Verify the legality of a call
to a ghost function.
(Check_Ghost_Function_Call): New routine.
* sem_ch6.adb (Analyze_Function_Call): Code reformatting. Move
the setting of attribute In_Assertion_Expression to Analyze_Call.
(Check_Overriding_Indicator): Detect an illegal attempt to
override a function with a ghost function.
* sem_ch12.adb (Preanalyze_Actuals): Detect an illegal use of
a ghost function as a generic actual.
* sem_elab.adb (Check_Internal_Call_Continue): Update the call
to In_Assertion.
* sem_prag.adb: Add an entry for pragma Ghost in the table
of significant arguments.
(Analyze_Pragma): Do not analyze
an "others" case guard. Add processing for pragma Ghost. Use
Preanalyze_Assert_Expression when analyzing the expression of
pragmas Loop_Invariant and Loop_Variant.
* sem_util.adb (Get_Subprogram_Entity): Reimplemented.
(Is_Body_Or_Package_Declaration): New routine.
* sem_util.ads: Alphabetize subprotrams in this unit.
(Is_Body_Or_Package_Declaration): New routine.
* sinfo.adb (In_Assertion): Rename to In_Assertion_Expression.
(Set_In_Assertion): Rename to Set_In_Assertion_Expression.
* sinfo.ads: Rename flag In_Assertion to In_Assertion_Expression
to better reflect its use.  Update all places that mention the flag.
(In_Assertion): Rename to In_Assertion_Expression. Update
related pragma Inline. (Set_In_Assertion): Rename to
Set_In_Assertion_Expression. Update related pragma Inline.
* snames.ads-tmpl: Add new predefined name Ghost. Add new pragma
id Pragma_Ghost.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197909 138bc75d-0d04-0410-961f-82ee72b054a4
19 files changed:
gcc/ada/ChangeLog
gcc/ada/aspects.adb
gcc/ada/aspects.ads
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/exp_ch4.adb
gcc/ada/exp_util.adb
gcc/ada/par-prag.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_elab.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads
gcc/ada/sinfo.adb
gcc/ada/sinfo.ads
gcc/ada/snames.ads-tmpl