public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Move symbol_visibility to coretypes.h
@ 2015-07-30 14:09 Andrew MacLeod
  2015-07-31 16:07 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew MacLeod @ 2015-07-30 14:09 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 386 bytes --]

Pretty simple.  Both flag-types.h and tree-core.h check to see if the 
other header has already defined this enumerated type, and defined it if 
not.

Its an unnecessary conditional compilation and dual maintenance of this 
small enum.  This patch puts it in coretypes.h and makes it always 
available.

Bootstraps on x86_64-pc-linux-gnu with no new regressions.  Ok for trunk?

Andrew

[-- Attachment #2: symbol.patch --]
[-- Type: text/x-patch, Size: 2113 bytes --]


	* coretypes.h (enum symbol_visibility): Relocate here.
	* flag-types.h (enum symbol_visibility): Remove.
	* tree-core.h (enum symbol_visibility): Remove.

Index: coretypes.h
===================================================================
*** coretypes.h	(revision 224292)
--- coretypes.h	(working copy)
*************** enum function_class {
*** 263,268 ****
--- 263,278 ----
    function_c11_misc
  };
  
+ /* Enumerate visibility settings.  This is deliberately ordered from most
+    to least visibility.  */
+ enum symbol_visibility
+ {
+   VISIBILITY_DEFAULT,
+   VISIBILITY_PROTECTED,
+   VISIBILITY_HIDDEN,
+   VISIBILITY_INTERNAL
+ };
+ 
  /* Suppose that higher bits are target dependent. */
  #define MEMMODEL_MASK ((1<<16)-1)
  
Index: flag-types.h
===================================================================
*** flag-types.h	(revision 224292)
--- flag-types.h	(working copy)
*************** enum debug_struct_file
*** 91,109 ****
    DINFO_STRUCT_FILE_ANY     /* Debug structs defined in all files. */
  };
  
- /* Enumerate visibility settings.  This is deliberately ordered from most
-    to least visibility.  */
- #ifndef SYMBOL_VISIBILITY_DEFINED
- #define SYMBOL_VISIBILITY_DEFINED
- enum symbol_visibility
- {
-   VISIBILITY_DEFAULT,
-   VISIBILITY_PROTECTED,
-   VISIBILITY_HIDDEN,
-   VISIBILITY_INTERNAL
- };
- #endif
- 
  /* Enumerate Objective-c instance variable visibility settings. */
  
  enum ivar_visibility
--- 91,96 ----
Index: tree-core.h
===================================================================
*** tree-core.h	(revision 224292)
--- tree-core.h	(working copy)
*************** enum cv_qualifier {
*** 431,447 ****
    TYPE_QUAL_ATOMIC   = 0x8
  };
  
- /* Enumerate visibility settings.  */
- #ifndef SYMBOL_VISIBILITY_DEFINED
- #define SYMBOL_VISIBILITY_DEFINED
- enum symbol_visibility {
-   VISIBILITY_DEFAULT,
-   VISIBILITY_PROTECTED,
-   VISIBILITY_HIDDEN,
-   VISIBILITY_INTERNAL
- };
- #endif  // SYMBOL_VISIBILITY_DEFINED
- 
  /* Standard named or nameless data types of the C compiler.  */
  enum tree_index {
    TI_ERROR_MARK,
--- 431,436 ----

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Move symbol_visibility to coretypes.h
  2015-07-30 14:09 [patch] Move symbol_visibility to coretypes.h Andrew MacLeod
@ 2015-07-31 16:07 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2015-07-31 16:07 UTC (permalink / raw)
  To: Andrew MacLeod, gcc-patches

On 07/30/2015 07:13 AM, Andrew MacLeod wrote:
> Pretty simple.  Both flag-types.h and tree-core.h check to see if the
> other header has already defined this enumerated type, and defined it if
> not.
>
> Its an unnecessary conditional compilation and dual maintenance of this
> small enum.  This patch puts it in coretypes.h and makes it always
> available.
>
> Bootstraps on x86_64-pc-linux-gnu with no new regressions.  Ok for trunk?
OK.
jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-31 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-30 14:09 [patch] Move symbol_visibility to coretypes.h Andrew MacLeod
2015-07-31 16:07 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).