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]

Re: [Patch, Ada] pragma Discard_Names for Restriction_Id

> But, The "pragma Discard_Names;" in doesn't work as
> intended. String images of Restriction_Id are included in my binary.
> This configuration pragma seems not to work well if it's not at the head
> of the file.
> I tested this patch on i686-pc-mingw32 with --disable-bootstrap.
> (I cannot build trunk without --disable-bootstrap on mingw.)
> Ok for mainline?

Sorry for answering late.

The patch is not OK, since it is only covering for a bug in the front-end.

The real bug is that pragma Discard_Names should reach inside inner scopes,
and should be fixed in sem_ch8.adb, e.g:

--- sem_ch8.adb 2006/12/11 16:22:01     1.764
+++ sem_ch8.adb 2006/12/24 10:41:34     1.765
@@ -5611,8 +5612,9 @@ package body Sem_Ch8 is
          --  inner level subprograms do not inherit the categorization.

          if Is_Library_Level_Entity (S) then
-            Set_Is_Preelaborated (S, Is_Preelaborated (E));
+            Set_Is_Preelaborated  (S, Is_Preelaborated (E));
             Set_Is_Shared_Passive (S, Is_Shared_Passive (E));
+            Set_Discard_Names     (S, Discard_Names (E));
             Set_Categorization_From_Scope (E => S, Scop => E);
          end if;
       end if;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]