From patchwork Tue Dec 8 13:01:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1412676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fI/Bk6R4; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cr0gD2M13z9sWK for ; Wed, 9 Dec 2020 00:01:25 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C0B03858024; Tue, 8 Dec 2020 13:01:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by sourceware.org (Postfix) with ESMTPS id 04606385800A for ; Tue, 8 Dec 2020 13:01:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 04606385800A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qt1-x834.google.com with SMTP id k4so11801016qtj.10 for ; Tue, 08 Dec 2020 05:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=K5XWtyUFxXwdLTTwZXWqdVavatBxKt2Jjyki0klujas=; b=fI/Bk6R4PkT55+AQ672JcNY17bzt0hQor414W7nf7ep2JEJ7duKMd7XAhaVp6+oujy w3ibYbQUjJyFyExmhp4vwy2GksAjBAzVf2Bl0qad1LkY+Zka8Mq41aRVhLm7jDb/N5VO CbKi9npDFGEhX536fzaRWBE5XL1ClCczk4VISWNJlrey9l4LZPHOVO8PhTwaCRUX64No O2frklRZmz4v+UCB6jZcEMswhM0YTw2+eKJoKoFyHWY3QDaLyN16UKpLj7KV4+PoKh9I KmHoPDNsPSFssqBdqIeAtZnAELjUZX6dyBLgn+Nqi+fRVyo7+DK7JDKU4pnES+rS3qm8 m3eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=K5XWtyUFxXwdLTTwZXWqdVavatBxKt2Jjyki0klujas=; b=X9MVTTcvqVPhpkfEqGZ9BWa5cE/1F3p5NegXk/xZm48Gl7rzprZGFmaLEP5OnW2NJU O67Yg9GFPWCNz5VqwerBkzVymlHO7l8n6+cfd9TN23+QUZJbSZy/6abgeVR80x3JgrZK zfyjuMvMcb95j6TZORAy7EMGT9/Dc2zZyQ6G+7mFEQq65ZdYAf9jNteFc1r7qCaf+jdC XCAxjYdY2d1IgIVjB/rFa1CNPnXybSBGkHCNU/2RoeOHPASybRlp+wS9M2kvW49oYHXq MbSw0HOUAwhzwvVHAJ1d5K1XX56tbJXGD+em2vCdQH8Dmqh43DZm0JT0QkPvZSWHkor8 nyOg== X-Gm-Message-State: AOAM5323cCUZAlVOzwJ3fEPexiYHkop5gN11aLuFNlI8TlLv7GAhPV8o 2MRRHvhLQqk4cPjV8UUFEsw= X-Google-Smtp-Source: ABdhPJxxl/kAnK0pP+R4IWFXIZwHPxDpKf9L1YMbRayaBcO8GApjkgc10Keq2r6+MsvVcyXnrvIthg== X-Received: by 2002:aed:38e2:: with SMTP id k89mr30132425qte.348.1607432469538; Tue, 08 Dec 2020 05:01:09 -0800 (PST) Received: from ?IPv6:2620:10d:c0a8:1102:9e5:be57:d7de:21c6? ([2620:10d:c091:480::1:a476]) by smtp.googlemail.com with ESMTPSA id d22sm8223676qkb.58.2020.12.08.05.01.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Dec 2020 05:01:08 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: c++: Add module includes Message-ID: <7934072c-5508-e9dd-54e9-ae36fde22640@acm.org> Date: Tue, 8 Dec 2020 08:01:06 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This adds MODULE_VERSION to the makefile, so it's generated from the date of the module.cc file in development. Also adds the include files to module.cc gcc/cp/ * Make-lang.in (MODULE_VERSION): Define. * module.cc: Add includes. pushing to trunk diff --git i/gcc/cp/Make-lang.in w/gcc/cp/Make-lang.in index ebfdc902192..d7dc0dec2b8 100644 --- i/gcc/cp/Make-lang.in +++ w/gcc/cp/Make-lang.in @@ -57,6 +57,15 @@ CFLAGS-cp/g++spec.o += $(DRIVER_DEFINES) CFLAGS-cp/module.o += -DHOST_MACHINE=\"$(host)\" \ -DTARGET_MACHINE=\"$(target)\" +ifeq ($(DEVPHASE_c),experimental) +# Some date's don't grok 'r', if so, simply use today's +# date (don't bootstrap at midnight). +MODULE_VERSION := $(shell date -r $(srcdir)/cp/module.cc '+%y%m%d-%H%M' \ + 2>/dev/null || date '+%y%m%d-0000' 2>/dev/null || echo 0) + +CFLAGS-cp/module.o += -DMODULE_VERSION='($(subst -,,$(MODULE_VERSION))U)' +endif + # Create the compiler driver for g++. GXX_OBJS = $(GCC_OBJS) cp/g++spec.o xg++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS) diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index 596061b3c49..f250d6c1819 100644 --- i/gcc/cp/module.cc +++ w/gcc/cp/module.cc @@ -18,4 +18,49 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -/* This file intentionally left empty. */ +/* This file intentionally left empty of all but barest minium. */ + +/* In expermental (trunk) sources, MODULE_VERSION is a #define passed + in from the Makefile. It records the modification date of the + source directory -- that's the only way to stay sane. In release + sources, we (plan to) use the compiler's major.minor versioning. + While the format might not change between at minor versions, it + seems simplest to tie the two together. There's no concept of + inter-version compatibility. */ +#define IS_EXPERIMENTAL(V) ((V) >= (1U << 20)) +#define MODULE_MAJOR(V) ((V) / 10000) +#define MODULE_MINOR(V) ((V) % 10000) +#define EXPERIMENT(A,B) (IS_EXPERIMENTAL (MODULE_VERSION) ? (A) : (B)) +#ifndef MODULE_VERSION +#error "Shtopp! What are you doing? This is not ready yet." +#include "bversion.h" +#define MODULE_VERSION (BUILDING_GCC_MAJOR * 10000U + BUILDING_GCC_MINOR) +#elif !IS_EXPERIMENTAL (MODULE_VERSION) +#error "This is not the version I was looking for." +#endif + +#define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available. */ +#include "config.h" + +#include "system.h" +#include "coretypes.h" +#include "cp-tree.h" +#include "timevar.h" +#include "stringpool.h" +#include "dumpfile.h" +#include "bitmap.h" +#include "cgraph.h" +#include "tree-iterator.h" +#include "cpplib.h" +#include "mkdeps.h" +#include "incpath.h" +#include "libiberty.h" +#include "stor-layout.h" +#include "version.h" +#include "tree-diagnostic.h" +#include "toplev.h" +#include "opts.h" +#include "attribs.h" +#include "intl.h" +#include "langhooks.h" +