Patchwork [Ada] Fix bad -gnatdt output for incomplete type

login
register
mail settings
Submitter Arnaud Charlet
Date Aug. 10, 2010, 1:51 p.m.
Message ID <20100810135110.GA9350@adacore.com>
Download mbox | patch
Permalink /patch/61382/
State New
Headers show

Comments

Arnaud Charlet - Aug. 10, 2010, 1:51 p.m.
The field Primitive_Operations can appear in an incomplete
type, in which case it is always Empty. This patch affects
only comments and -gnatdt debugging output, so there is no
functional effect and no test is required.

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

2010-08-10  Robert Dewar  <dewar@adacore.com>

	* einfo.adb, einfo.ads: Fix bad -gnatdt output for incomplete type.

Patch

Index: einfo.adb
===================================================================
--- einfo.adb	(revision 163054)
+++ einfo.adb	(working copy)
@@ -7475,6 +7475,7 @@  package body Einfo is
             Write_Str ("Storage_Size_Variable");
 
          when Class_Wide_Kind                              |
+              Incomplete_Kind                              |
               E_Record_Type                                |
               E_Record_Subtype                             |
               Private_Kind                                 =>
Index: einfo.ads
===================================================================
--- einfo.ads	(revision 163054)
+++ einfo.ads	(working copy)
@@ -3188,7 +3188,8 @@  package Einfo is
 --       is an error to reference the primitive operations field of a type
 --       that is not tagged). In order to fulfill the C++ ABI, entities of
 --       primitives that come from source must be stored in this list following
---       their order of occurrence in the sources.
+--       their order of occurrence in the sources. Also present in incomplete
+--       types, but in this case the list is always empty.
 
 --    Prival (Node17)
 --       Present in private components of protected types. Refers to the entity