Skip to content
Snippets Groups Projects
  • Bob Duff's avatar
    af191499
    ada: Add Is_Past_Self_Hiding_Point flag · af191499
    Bob Duff authored
    This patch adds a flag Is_Past_Self_Hiding_Point. When False,
    this will replace E_Void as the indicator for a premature use of
    a declaration within itself -- for example, "X : T := X;".
    
    One might think this flag should be called something like
    Is_Hidden_From_All_Visibility, reversing the sense of
    Is_Past_Self_Hiding_Point. We don't do that because we want
    Is_Past_Self_Hiding_Point to be initially False by default (and we have
    no mechanism for defaulting to True), and because it doesn't exactly
    match the RM definition of "hidden from all visibility" (for
    example, for record components).
    
    This is work in progress; more changes are needed before we
    can remove all Mutate_Ekind(..., E_Void).
    
    gcc/ada/
    
    	* einfo.ads (Is_Past_Self_Hiding_Point): Document.
    	* gen_il-fields.ads (Is_Past_Self_Hiding_Point): Add to list of
    	fields.
    	* gen_il-gen-gen_entities.adb (Is_Past_Self_Hiding_Point): Declare
    	in all entities.
    	* exp_aggr.adb: Set Is_Past_Self_Hiding_Point as appropriate.
    	* sem.adb: Likewise.
    	* sem_aggr.adb: Likewise.
    	* sem_ch11.adb: Likewise.
    	* sem_ch12.adb: Likewise.
    	* sem_ch5.adb: Likewise.
    	* sem_ch7.adb: Likewise.
    	* sem_prag.adb: Likewise.
    	* sem_ch6.adb: Likewise.
    	(Set_Formal_Mode): Minor cleanup: Move from spec.
    	* sem_ch6.ads:
    	(Set_Formal_Mode): Minor cleanup: Move to body.
    	* cstand.adb: Call Set_Is_Past_Self_Hiding_Point on all entities
    	as soon as they are created.
    	* comperr.adb (Compiler_Abort): Minor cleanup -- use 'in' instead
    	of 'or else'.
    	* debug.adb: Minor comment cleanups.
    af191499
    History
    ada: Add Is_Past_Self_Hiding_Point flag
    Bob Duff authored
    This patch adds a flag Is_Past_Self_Hiding_Point. When False,
    this will replace E_Void as the indicator for a premature use of
    a declaration within itself -- for example, "X : T := X;".
    
    One might think this flag should be called something like
    Is_Hidden_From_All_Visibility, reversing the sense of
    Is_Past_Self_Hiding_Point. We don't do that because we want
    Is_Past_Self_Hiding_Point to be initially False by default (and we have
    no mechanism for defaulting to True), and because it doesn't exactly
    match the RM definition of "hidden from all visibility" (for
    example, for record components).
    
    This is work in progress; more changes are needed before we
    can remove all Mutate_Ekind(..., E_Void).
    
    gcc/ada/
    
    	* einfo.ads (Is_Past_Self_Hiding_Point): Document.
    	* gen_il-fields.ads (Is_Past_Self_Hiding_Point): Add to list of
    	fields.
    	* gen_il-gen-gen_entities.adb (Is_Past_Self_Hiding_Point): Declare
    	in all entities.
    	* exp_aggr.adb: Set Is_Past_Self_Hiding_Point as appropriate.
    	* sem.adb: Likewise.
    	* sem_aggr.adb: Likewise.
    	* sem_ch11.adb: Likewise.
    	* sem_ch12.adb: Likewise.
    	* sem_ch5.adb: Likewise.
    	* sem_ch7.adb: Likewise.
    	* sem_prag.adb: Likewise.
    	* sem_ch6.adb: Likewise.
    	(Set_Formal_Mode): Minor cleanup: Move from spec.
    	* sem_ch6.ads:
    	(Set_Formal_Mode): Minor cleanup: Move to body.
    	* cstand.adb: Call Set_Is_Past_Self_Hiding_Point on all entities
    	as soon as they are created.
    	* comperr.adb (Compiler_Abort): Minor cleanup -- use 'in' instead
    	of 'or else'.
    	* debug.adb: Minor comment cleanups.