This is the mail archive of the 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]

[Ada] Handling of record extensions whose parent type has unknown discriminants

If a type extension that is not the completion of a private declaration  has    
a parent type with unknown discriminants, we must construct a representation    
of the type that includes the discriminants of the full view of the parent,     
for use in the back-end when computing the size of the type. This patch         
includes the necessary front-end changes to create this representation.         

Eric will follow up soon with the corresponding gigi changes.

Tested on x86_64-pc-linux-gnu, committed on trunk

        *, einfo.adb: New attribute Underlying_Record_View, to handle
        type extensions whose parent is a type with unknown discriminants.

        * exp_aggr.adb (Expand_Record_Aggregate): If the type of an extension
        aggregate has unknown discriminants, use the Underlying_Record_View to
        obtain the discriminants of the ancestor part.

        * exp_disp.adb (Build_Dispatch_Tables): Types that are
        Underlying_Record_Views share the dispatching information of the
        original record extension.

        * exp_ch3.adb (Expand_Record_Extension): If the type inherits unknown
        discriminants, propagate dispach table information to the

        * sem_ch3.adb (Build_Derived_Private_Type): If parent type has unknown
        discriminants and declaration is not a completion, generate
        Underlying_Record_View to provide proper discriminant information to
        the front-end and to gigi.

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]