From patchwork Thu Mar 20 16:36:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 332306 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0E55E2C0096 for ; Fri, 21 Mar 2014 03:38:53 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=kk22CKXjdw52k2tM4RjzwjQUmGHJaPeFAdQbrRIlGGb7Lp 1V0RTYbJti6FT7arWy8BG48AH7DR3ku0KLX0scgDhySTCGi61j/m3B7ZhL8A7kfS sZRKlb4IxtsQ4+2os2zNA1ndNIhrPy0wBem8bkdouMNZ+x0mNyqvhl9uTXGc0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=VUEyUZZjcxCx3u6woLpgh0ZHh9Q=; b=Zh3hCzOYRwGgrxtUJnIr QVc7Yc8iKNndvDlzGKmFebU7ZI34Bh324vFztlay/OQKDJ/ZMj1VnMnUkF6YSmrA XpAX5Y+k3XyP0Kgg7IDIlKBK32bI8c2OgVLslJtyHVti4dF0/245UsLxtsDxxB80 dXiYkzHy6QySE523b7G6AA8= Received: (qmail 17130 invoked by alias); 20 Mar 2014 16:38:45 -0000 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 Received: (qmail 17073 invoked by uid 89); 20 Mar 2014 16:38:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Mar 2014 16:38:42 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WQfzL-000309-2E from Bernd_Schmidt@mentor.com ; Thu, 20 Mar 2014 09:38:39 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 20 Mar 2014 09:38:38 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.2.247.3; Thu, 20 Mar 2014 16:38:35 +0000 Message-ID: <532B1912.6030306@codesourcery.com> Date: Thu, 20 Mar 2014 17:36:34 +0100 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: GCC Patches , Ilya Verbin Subject: [gomp4/stage1] Clean up lto section name headers This reduces duplication of a number of defines related to LTO section/segment names. Committed on gomp-4_0-branch; ok for stage1? Bernd Index: gcc/lto/ChangeLog =================================================================== --- gcc/lto/ChangeLog (revision 208706) +++ gcc/lto/ChangeLog (working copy) @@ -1,3 +1,9 @@ +2014-03-20 Bernd Schmidt + + * lto-object.c: Include "lto-section-names.h". + (LTO_SEGMENT_NAME): Don't define. + * lto.c: Include "lto-section-names.h". + 2014-02-14 Jan Hubicka PR lto/60295 Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (revision 208715) +++ gcc/ChangeLog (working copy) @@ -1,5 +1,17 @@ 2014-03-20 Bernd Schmidt + * config/darwin.c: Include "lto-section-names.h". + (LTO_SEGMENT_NAME): Don't define. + * config/i386/winnt.c: Include "lto-section-names.h". + * lto-streamer.c: Include "lto-section-names.h". + * lto-streamer.h (LTO_SECTION_NAME_PREFIX, OMP_SECTION_NAME_PREFIX): + Don't define. + (section_name_prefix): Don't declare. + * lto-wrapper.c: Include "lto-section-names.h". + (LTO_SECTION_NAME_PREFIX): Don't define. + * lto-section-names.h: New file. + * cgraphunit.c: Include "lto-section-names.h". + * configure.ac (real_target_noncanonical, tool_prefix, accel_dir_suffix, offload_targets): Compute new variables. (--enable-as-accelerator-for, --enable-as-accelerator, Index: gcc/cgraphunit.c =================================================================== --- gcc/cgraphunit.c (revision 208706) +++ gcc/cgraphunit.c (working copy) @@ -210,6 +210,7 @@ along with GCC; see the file COPYING3. #include "pass_manager.h" #include "tree-nested.h" #include "gimplify.h" +#include "lto-section-names.h" /* Queue of cgraph nodes scheduled to be added into cgraph. This is a secondary queue used during optimization to accommodate passes that Index: gcc/config/darwin.c =================================================================== --- gcc/config/darwin.c (revision 208706) +++ gcc/config/darwin.c (working copy) @@ -61,6 +61,7 @@ along with GCC; see the file COPYING3. #include "gimple.h" #include "gimplify.h" #include "lto-streamer.h" +#include "lto-section-names.h" /* Darwin supports a feature called fix-and-continue, which is used for rapid turn around debugging. When code is compiled with the @@ -1900,9 +1901,6 @@ typedef struct GTY (()) darwin_lto_secti static GTY (()) vec *lto_section_names; -/* Segment for LTO data. */ -#define LTO_SEGMENT_NAME "__GNU_LTO" - /* Section wrapper scheme (used here to wrap the unlimited number of LTO sections into three Mach-O ones). NOTE: These names MUST be kept in sync with those in Index: gcc/config/i386/winnt.c =================================================================== --- gcc/config/i386/winnt.c (revision 208706) +++ gcc/config/i386/winnt.c (working copy) @@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. #include "is-a.h" #include "gimple.h" #include "lto-streamer.h" +#include "lto-section-names.h" /* i386/PE specific attribute support. Index: gcc/lto/lto-object.c =================================================================== --- gcc/lto/lto-object.c (revision 208706) +++ gcc/lto/lto-object.c (working copy) @@ -32,13 +32,9 @@ along with GCC; see the file COPYING3. #include "lto.h" #include "tm.h" #include "lto-streamer.h" +#include "lto-section-names.h" #include "simple-object.h" -/* Segment name for LTO sections. This is only used for Mach-O. - FIXME: This needs to be kept in sync with darwin.c. */ - -#define LTO_SEGMENT_NAME "__GNU_LTO" - /* An LTO file wrapped around an simple_object. */ struct lto_simple_object Index: gcc/lto/lto.c =================================================================== --- gcc/lto/lto.c (revision 208706) +++ gcc/lto/lto.c (working copy) @@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. #include "lto.h" #include "lto-tree.h" #include "lto-streamer.h" +#include "lto-section-names.h" #include "tree-streamer.h" #include "splay-tree.h" #include "lto-partition.h" Index: gcc/lto-section-names.h =================================================================== --- gcc/lto-section-names.h (revision 0) +++ gcc/lto-section-names.h (working copy) @@ -0,0 +1,33 @@ +/* Definitions for LTO section names. + Copyright (C) 2013 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +/* The string that is the prefix on the section names we make for lto. + For decls the DECL_ASSEMBLER_NAME is appended to make the section + name for the functions and static_initializers. For other types of + sections a '.' and the section type are appended. */ +#define LTO_SECTION_NAME_PREFIX ".gnu.lto_" + +/* Segment name for LTO sections. This is only used for Mach-O. */ + +#define LTO_SEGMENT_NAME "__GNU_LTO" +#define OMP_SECTION_NAME_PREFIX ".gnu.target_lto_" + +/* Can be either OMP_SECTION_NAME_PREFIX when we stream pragma omp target + stuff, or LTO_SECTION_NAME_PREFIX for lto case. */ +extern const char *section_name_prefix; Index: gcc/lto-streamer.c =================================================================== --- gcc/lto-streamer.c (revision 208706) +++ gcc/lto-streamer.c (working copy) @@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. #include "diagnostic-core.h" #include "tree-streamer.h" #include "lto-streamer.h" +#include "lto-section-names.h" #include "streamer-hooks.h" /* Statistics gathered during LTO, WPA and LTRANS. */ Index: gcc/lto-streamer.h =================================================================== --- gcc/lto-streamer.h (revision 208706) +++ gcc/lto-streamer.h (working copy) @@ -134,17 +134,6 @@ along with GCC; see the file COPYING3. String are represented in the table as pairs, a length in ULEB128 form followed by the data for the string. */ -/* The string that is the prefix on the section names we make for lto. - For decls the DECL_ASSEMBLER_NAME is appended to make the section - name for the functions and static_initializers. For other types of - sections a '.' and the section type are appended. */ -#define LTO_SECTION_NAME_PREFIX ".gnu.lto_" -#define OMP_SECTION_NAME_PREFIX ".gnu.target_lto_" - -/* Can be either OMP_SECTION_NAME_PREFIX when we stream pragma omp target - stuff, or LTO_SECTION_NAME_PREFIX for lto case. */ -extern const char *section_name_prefix; - #define LTO_major_version 3 #define LTO_minor_version 0 Index: gcc/lto-wrapper.c =================================================================== --- gcc/lto-wrapper.c (revision 208706) +++ gcc/lto-wrapper.c (working copy) @@ -46,13 +46,7 @@ along with GCC; see the file COPYING3. #include "opts.h" #include "options.h" #include "simple-object.h" - -/* From lto-streamer.h which we cannot include with -fkeep-inline-functions. - ??? Split out a lto-streamer-core.h. */ - -#define LTO_SECTION_NAME_PREFIX ".gnu.lto_" - -/* End of lto-streamer.h copy. */ +#include "lto-section-names.h" int debug; /* true if -save-temps. */ int verbose; /* true if -v. */