From patchwork Thu Oct 28 19:29:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 69490 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D8282B70AA for ; Fri, 29 Oct 2010 06:29:22 +1100 (EST) Received: (qmail 21882 invoked by alias); 28 Oct 2010 19:29:18 -0000 Received: (qmail 21551 invoked by uid 22791); 28 Oct 2010 19:29:17 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Oct 2010 19:29:13 +0000 Received: from bonzini by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1PBY9v-0006la-47 for gcc-patches@gcc.gnu.org; Thu, 28 Oct 2010 15:29:11 -0400 From: Paolo Bonzini To: gcc-patches@gcc.gnu.org Subject: [PATCH] Small c-pragma.c cleanup Date: Thu, 28 Oct 2010 21:29:06 +0200 Message-Id: <1288294147-32401-2-git-send-email-bonzini@gnu.org> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org HANDLE_PRAGMA_VISIBILITY is always defined, no need to test it with #ifdefs. Bootstrapped/regtested x86_64-pc-linux-gnu, ok for mainline? Paolo c-family: 2010-06-02 Paolo Bonzini * c-pragma.h (HANDLE_PRAGMA_VISIBILITY): Remove. (HANDLE_PRAGMA_WEAK, HANDLE_PRAGMA_PACK): Move defaults... * c-pragma.c: ... here. (handle_pragma_visibility): Remove #ifdefs. cp: 2010-06-02 Paolo Bonzini * name-lookup.c (handle_namespace_attrs): Assume HANDLE_PRAGMA_VISIBILITY is defined. * parser.c (cp_parser_namespace_definition): Likewise. Index: gcc/c-family/c-pragma.h =================================================================== --- gcc/c-family/c-pragma.h (branch diag) +++ gcc/c-family/c-pragma.h (working copy) @@ -75,26 +75,6 @@ typedef enum pragma_omp_clause { #define HANDLE_PRAGMA_PACK 1 #endif /* HANDLE_PRAGMA_PACK_PUSH_POP */ -/* It's safe to always leave visibility pragma enabled as if - visibility is not supported on the host OS platform the - statements are ignored. */ -#define HANDLE_PRAGMA_VISIBILITY 1 extern void push_visibility (const char *, int); extern bool pop_visibility (int); Index: gcc/c-family/c-pragma.c =================================================================== --- gcc/c-family/c-pragma.c (branch diag) +++ gcc/c-family/c-pragma.c (working copy) @@ -616,8 +632,11 @@ maybe_apply_renaming_pragma (tree decl, return 0; } + +/* It's safe to always leave visibility pragma enabled as if + visibility is not supported on the host OS platform the + statements are ignored. */ -#ifdef HANDLE_PRAGMA_VISIBILITY static void handle_pragma_visibility (cpp_reader *); static VEC (int, heap) *visstack; @@ -710,8 +729,7 @@ handle_pragma_visibility (cpp_reader *du warning (OPT_Wpragmas, "junk at end of %<#pragma GCC visibility%>"); } -#endif - + static void handle_pragma_diagnostic(cpp_reader *ARG_UNUSED(dummy)) { @@ -1329,10 +1347,8 @@ init_pragma (void) #ifdef HANDLE_PRAGMA_WEAK c_register_pragma (0, "weak", handle_pragma_weak); #endif -#ifdef HANDLE_PRAGMA_VISIBILITY - c_register_pragma ("GCC", "visibility", handle_pragma_visibility); -#endif + c_register_pragma ("GCC", "visibility", handle_pragma_visibility); c_register_pragma ("GCC", "diagnostic", handle_pragma_diagnostic); c_register_pragma ("GCC", "target", handle_pragma_target); c_register_pragma ("GCC", "optimize", handle_pragma_optimize); Index: gcc/cp/parser.c =================================================================== --- gcc/cp/parser.c (branch diag) +++ gcc/cp/parser.c (working copy) @@ -13776,10 +13776,8 @@ cp_parser_namespace_definition (cp_parse /* Parse the body of the namespace. */ cp_parser_namespace_body (parser); -#ifdef HANDLE_PRAGMA_VISIBILITY if (has_visibility) pop_visibility (1); -#endif /* Finish the namespace. */ pop_namespace (); Index: gcc/cp/name-lookup.c =================================================================== --- gcc/cp/name-lookup.c (branch diag) +++ gcc/cp/name-lookup.c (working copy) @@ -3239,7 +3239,6 @@ handle_namespace_attrs (tree ns, tree at tree name = TREE_PURPOSE (d); tree args = TREE_VALUE (d); -#ifdef HANDLE_PRAGMA_VISIBILITY if (is_attribute_p ("visibility", name)) { tree x = args ? TREE_VALUE (args) : NULL_TREE; @@ -3260,7 +3259,6 @@ handle_namespace_attrs (tree ns, tree at saw_vis = true; } else -#endif { warning (OPT_Wattributes, "%qD attribute directive ignored", name);