From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by sourceware.org (Postfix) with ESMTPS id 2F109385E02C; Tue, 4 Oct 2022 15:11:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F109385E02C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=benboeckel.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=benboeckel.net Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7BFFD5C02BE; Tue, 4 Oct 2022 11:11:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 04 Oct 2022 11:11:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benboeckel.net; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; t=1664896271; x=1664982671; bh=sr+ogrWIq1 f4jwooN450XPMmkFvEXcW4rGcpOy++/9c=; b=X2X4fwiCQtE83HMDN+kw++M7JW wIAg1H0p2B1z/DX+RqnIDmc0GO+MSfNeaAJniz3NU79d6lWjie1fBLUg7mM/0Fzq DCHKttM4UoY1/vEn+VqB0+gdtvq35yfY79cuVJ9730WgGfPVtkxd7ciIpPABMMfk 7cGgoilAOqIyHg32c9qes2F5r6TQ6iQHM4X2hHZ9hRQbeRXTNKxLmVDDrd7BPV95 SMefNWu6uGX9a4eGkXBD3N8qRQhJWn9RPX2UNOzytnAQJlprwnWuE5URFy/tv6Dt Bft/i8cudfZUwQuO93aABwq7rS/rM8NE5Rl7+aeBTREesbEaZKSazEE1qJeQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1664896271; x=1664982671; bh=sr+ogrWIq1f4jwooN450XPMmkFvEXcW4rGc pOy++/9c=; b=1uf6A8hy1Dq95ieqrSsa+KOnJZXZFJZgpFyNSfbMCkROq3PbqmG zBqQdo2QHM9y+ykOVNSzcSvQE5ktPy9D5AbJOoOO6J6BPRsUyZTWjq32OcOk4DHK uIN/xG1f7Cyna6S8ABzyX/4Zlarkr8Zrpi9UHgSDZ9xn7f4MHpJWjR92Z0WSjsSz HN9Q815e91ZMGvucWiCqLnRKHgBd726TjZSD4dDJaRLfX1spo8L90yufr5DEQ77v /XKAsv6HkiweZRVsSLBGwz3UFvMba+LfK6mplzdd9tE2DV5WXbDLX5xmGUb62v2K oecTdUgmRAO54M90GZRs56IzGaZpLum+9Vg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeiuddgkeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpeeuvghnuceuohgvtghkvghluceomhgvsegsvghnsghovggtkhgv lhdrnhgvtheqnecuggftrfgrthhtvghrnhepheevtdfhfeevuefgtefhtddvjeevfeevhe ekfeetvefggeeuueekvdekteegteeknecuffhomhgrihhnpehishhotghpphdrohhrghdp lhhlvhhmrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepmhgvsegsvghnsghovggtkhgvlhdrnhgvth X-ME-Proxy: Feedback-ID: iffc1478b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Oct 2022 11:11:11 -0400 (EDT) From: Ben Boeckel To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com, nathan@acm.org, fortran@gcc.gnu.org, gcc@gcc.gnu.org, brad.king@kitware.com, Ben Boeckel Subject: [PATCH RESEND 0/1] RFC: P1689R5 support Date: Tue, 4 Oct 2022 11:11:59 -0400 Message-Id: <20221004151200.1275636-1-ben.boeckel@kitware.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This patch adds initial support for ISO C++'s [P1689R5][], a format for describing C++ module requirements and provisions based on the source code. This is required because compiling C++ with modules is not embarrassingly parallel and need to be ordered to ensure that `import some_module;` can be satisfied in time by making sure that the TU with `export import some_module;` is compiled first. [P1689R5]: https://isocpp.org/files/papers/P1689R5.html I'd like feedback on the approach taken here with respect to the user-visible flags. I'll also note that header units are not supported at this time because the current `-E` behavior with respect to `import ;` is to search for an appropriate `.gcm` file which is not something such a "scan" can support. A new mode will likely need to be created (e.g., replacing `-E` with `-fc++-module-scanning` or something) where headers are looked up "normally" and processed only as much as scanning requires. Testing is currently happening in CMake's CI using a prior revision of this patch (the differences are basically the changelog, some style, and `trtbd` instead of `p1689r5` as the format name). For testing within GCC, I'll work on the following: - scanning non-module source - scanning module-importing source (`import X;`) - scanning module-exporting source (`export module X;`) - scanning module implementation unit (`module X;`) - flag combinations? Are there existing tools for handling JSON output for testing purposes? Basically, something that I can add to the test suite that doesn't care about whitespace, but checks the structure (with sensible replacements for absolute paths where relevant)? For the record, Clang has patches with similar flags and behavior by Chuanqi Xu here: https://reviews.llvm.org/D134269 with the same flags (though using my old `trtbd` spelling for the format name). Thanks, --Ben Ben Boeckel (1): p1689r5: initial support gcc/ChangeLog | 9 ++ gcc/c-family/ChangeLog | 6 + gcc/c-family/c-opts.cc | 40 ++++++- gcc/c-family/c.opt | 12 ++ gcc/cp/ChangeLog | 5 + gcc/cp/module.cc | 3 +- gcc/doc/invoke.texi | 15 +++ gcc/fortran/ChangeLog | 5 + gcc/fortran/cpp.cc | 4 +- gcc/genmatch.cc | 2 +- gcc/input.cc | 4 +- libcpp/ChangeLog | 11 ++ libcpp/include/cpplib.h | 12 +- libcpp/include/mkdeps.h | 17 ++- libcpp/init.cc | 14 ++- libcpp/mkdeps.cc | 235 ++++++++++++++++++++++++++++++++++++++-- 16 files changed, 368 insertions(+), 26 deletions(-) base-commit: d812e8cb2a920fd75768e16ca8ded59ad93c172f -- 2.37.3