From patchwork Tue Nov 3 21:12:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1393412 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=8.43.85.97; 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=Obzm/PVo; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 4CQjDc1JxDz9sXY for ; Wed, 4 Nov 2020 08:13:04 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2EEDC3857C64; Tue, 3 Nov 2020 21:13:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by sourceware.org (Postfix) with ESMTPS id 6C00C3858020 for ; Tue, 3 Nov 2020 21:12:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6C00C3858020 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-qv1-xf30.google.com with SMTP id da2so6462181qvb.0 for ; Tue, 03 Nov 2020 13:12:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=5rrtK6Tqkl40FR7U+mn3j/LXRRyQSvHxsJq+tyk6wMo=; b=Obzm/PVo4S7L05AktMKudVfSyWajlpu8W+US/rNWqJyygLRdBkCsozTLrcPGAyTbQY Ac2qsLablv49yrIr78z4LeeHAWgW0TMK8QEPWzAXzJRwpqWEFktSy5yl5qAjVAUpZTpc jwQQPkmx42jPghKA/E2v4ViLL15mJpLTucGkVXdz/habIowVOPCNQHMfujJ87raywPWV L3gBPoQCJoaCz5xI5K67C8cM0VPHqW0JT8Jf2hXGXXbqJPDwg+MzbMOaHSldUd9MgEz2 lrD7ibpDKHo+yQbE4GdTPSqgvv++rax926Op6UhvAPOxJg0FzXVlonUyIUo0XroXbXPc fwWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:subject:to:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=5rrtK6Tqkl40FR7U+mn3j/LXRRyQSvHxsJq+tyk6wMo=; b=r2SbbNbattaU0Szl+fv4Ttobe3040yjEGq8RVIc9kZzStZgP+HdQ677KsQKYvIQWhq l7P6cBhGnOnEso9IaBmCrDIYXbmkdtJRQ4yhkjKrR9Tn9+4SKNj/gvnySIm9q3RS5zyW iiQUs3gYWSGdVlJDzEqt5lchDW0tsH4VlZWybK31m9AkW3RvDRpttJ5BCVAyWEYLfNpv bSNF3eBMiv31pMsCieg6BdWtOgn7A+ykVtTFVzcKIKvETIh6tyJX+YCYhGy1/hFAUqBj Fvu/FhrK80wEEA6Qxc0KknwzN6Ar5OzFofSG/gMz0LOz8NvhMuAcIWduqKJXexHzP8qQ zkog== X-Gm-Message-State: AOAM5335aRrTF/Z6OCSwH3v6AeSWuNgx0Iuob+VbwE7ufvZXP898GTIR if5B/q7EuEw8xkD6HHJeV20= X-Google-Smtp-Source: ABdhPJwpgiwM7i6ZtuVwygXjsmTKqx5WHqi3VcytfoJ7MQ+ZVEYUdMVb+FFvrlymfm7eKdUJNWqAwA== X-Received: by 2002:a0c:e002:: with SMTP id j2mr7591535qvk.3.1604437977427; Tue, 03 Nov 2020 13:12:57 -0800 (PST) Received: from ?IPv6:2620:10d:c0a8:1102:e5ef:7eb4:1609:98bb? ([2620:10d:c091:480::1:bc2d]) by smtp.googlemail.com with ESMTPSA id p2sm7380570qkk.34.2020.11.03.13.12.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Nov 2020 13:12:56 -0800 (PST) From: Nathan Sidwell Subject: [00/32] C++ 20 Modules To: GCC Patches , Jason Merrill , Richard Biener Message-ID: <94392c65-0a81-17c3-c5d3-f15a5e91dd79@acm.org> Date: Tue, 3 Nov 2020 16:12:55 -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=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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" Here is the implementation of C++20 modules that I have been developing on the devel/c++-modules branch over the last few years. It is not a complete implementation. The major missing pieces are: 1) Private Module Fragment The syntax is recognized and a sorry emitted 2) textually parsing a duplicate global module definition when a definition has already been read from a header-unit. (the converse is supported) 3) Complete type (in)visibility when provided in implementation partitions that are imported into the primary interface. Users will see the type as complete. 4) Internal linkage reachability rules from exported entities. We're likely to accept ill-formed programs. This will not cause us to reject well-formed programs. It is some 25K new lines of code (plus testsuite). There are about 48 FIXMEs, nearly all in module.cc and the remaining in name-lookup.c. Of these 12 are QOI comments. The remaining 36 probably fall into the following categories: 1/3 are repeating a FIXME mentioned elsewhere 1/3 are already resolved, or have become irrelevant 1/3 are defects (an above missing feature, a QOI issue, or something else). I believe there is time in stage 1 to address the most significant ones. I have bootstrapped and tested on: x86_64-linux aarch64-linux powerpc8le-linux powerpc8-aix Iain Sandoe has been regularly bootstrapping on x86_64-darwin. Joseph Myers graciously built for i686-mingw host. We eventually ran into compilation errors in the analyzer, as it seemed unprepared for an IL32P64 host. I have attempted to break the patches apart into coherent pieces. But they are somewhat interconnected. 01-langhooks.diff New langhooks 02-cpp-line-maps.diff line-map pieces 03-cpp-callbacks.diff Preprocessor callbacks 04-cpp-lexer.diff There are new lexing requirements 05-cpp-files.diff ... and file reading functionality 06-cpp-macro.diff ... and macro expansion rules 07-cpp-main.diff Main file reading 08-cpp-mkdeps.diff Dependency generation 09-core-diag.diff Core diagnostics 10-core-config.diff Autoconf 11-core-parmtime.diff parameters and time instrumentation 12-core-doc.diff User documentation 13-family-options.diff New options 14-family-keywords.diff New keyword 15-c++-lexer.diff New C++ lexing 16-c++-infra.diff C++ infrastructure interfaces 17-c++-infra-constexpr.diff new constexpr interfacing 18-c++-infra-template.diff new template interfacing 19-global-trees.diff Global tree ordering 20-c++-dynctor.diff Dynamic constructor generation 21-core-rawbits.diff Some core node bits 22-c++-otherbits.diff Miscellaneous C++ changes 23-libcody.diff Libcody 24-c++-mapper.diff Module Mapper 25-c++-modules.diff The Modules file 26-c++-name-lookup.diff Name lookup changes 27-c++-parser.diff Parser changes 28-c++-langhooks.diff Lang hooks implementation 29-c++-make.diff Makefile changes 30-test-harness.diff Testharness changes 31-testsuite.diff The testsuite 32-aix-fixincl.diff AIX fixinclude Nearly all of this is within gcc/cp and libcpp/ directories. There are a few changes to gcc/ and more changes in gcc/c-family/ It is likely that this patchset will cause breakages, for that I apologize (please try the modules branch and report early). My understanding is that a Global Maintainer's approval is needed for such a large patchset. It's be good to get this in as early in stage 3 as possible (if stage 1 expires). Definitely the most important event of today :) But don't forget to vote. nathan