From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id 0D5AB3858C52 for ; Tue, 27 Sep 2022 17:09:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D5AB3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kitware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kitware.com Received: by mail-qt1-x836.google.com with SMTP id b23so6403665qtr.13 for ; Tue, 27 Sep 2022 10:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kitware.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=sr+ogrWIq1f4jwooN450XPMmkFvEXcW4rGcpOy++/9c=; b=TYkp/cAkQdqny//8bpYvaCaV463D+cv7EnVci+LY1AygWy1Y27qhoA9jZ2E+SP9bHO vZm5UMf5J+Ba3gRvUjGBT0JSIi4KMcAiVzP9XSMxoVsUW7s6Md4WFIbn2O6gktoQlc8N 0rcWB6lhjsiPSA/6upaqQAhNgcW+kwo+T0xeY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=sr+ogrWIq1f4jwooN450XPMmkFvEXcW4rGcpOy++/9c=; b=rcv/Mi5SIgw2iaiPfZDRgWShW66CaU4eZusGS/LWnVz2VwmV92d1eaxDFx3m3CntyD WHmdjeAIp/2RDvyAnudD5RqXjAC/S0L6suvjq8G/YWHkq31r169/v9Vm+E1y20HWAIJJ /IqlCDGvK+MQ+lcFr6K+LvvZOIiIwKYild4EyOioAQfJez+OyoAMBGCcb8MLanxNkbht CJH/5SGSJPaLzt+qXEe2pdQfnTYMAMAex7trmETE0hnusAlA9ASTYBl8tJfY7K5lZTF5 +ovdvVie4JqFg0K4IdtQp6MGpeiOFhStBKnUN8LgEvYLDf/Nm4EbfKpfnFtSFS+aLRI+ 84pw== X-Gm-Message-State: ACrzQf0FdJujIva19wJ0J36B+IU3oIHNuQ6/b/ZOOu8ReSNd+xczXKJ5 lPLf470eztjW5Sa5QiSXagdkhXZB+KQePXg2 X-Google-Smtp-Source: AMsMyM48LhyNLMdIlxuK2uZS6/THAyt1Bq9l7VbiMFykmM79nr0uneoKbCuuzGs2aj1q9BJCMN8hmQ== X-Received: by 2002:ac8:7f8f:0:b0:35c:cbd2:9261 with SMTP id z15-20020ac87f8f000000b0035ccbd29261mr23671020qtj.485.1664298572373; Tue, 27 Sep 2022 10:09:32 -0700 (PDT) Received: from localhost (cpe-142-105-146-128.nycap.res.rr.com. [142.105.146.128]) by smtp.gmail.com with ESMTPSA id h2-20020a05620a244200b006ccc96c78easm1276869qkn.134.2022.09.27.10.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 10:09:31 -0700 (PDT) From: Ben Boeckel To: gcc-patches@gcc.gnu.org Cc: fortran@gcc.gnu.org, gcc@gcc.gnu.org, brad.king@kitware.com, Ben Boeckel Subject: [PATCH 0/1] RFC: P1689R5 support Date: Tue, 27 Sep 2022 13:10:23 -0400 Message-Id: <20220927171024.402766-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=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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