From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1059) id 15BDB3858036; Fri, 18 Dec 2020 13:03:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15BDB3858036 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Nathan Sidwell To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc/devel/c++-modules] Merge trunk 35b8d268746 X-Act-Checkin: gcc X-Git-Author: Nathan Sidwell X-Git-Refname: refs/heads/devel/c++-modules X-Git-Oldrev: 0043138307786e2a0f071dcb6a3487c56d622a91 X-Git-Newrev: d34124b256d985ae207451c2832a8f1cdfaa48fa Message-Id: <20201218130322.15BDB3858036@sourceware.org> Date: Fri, 18 Dec 2020 13:03:22 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2020 13:03:22 -0000 https://gcc.gnu.org/g:d34124b256d985ae207451c2832a8f1cdfaa48fa commit d34124b256d985ae207451c2832a8f1cdfaa48fa Merge: 00431383077 35b8d268746 Author: Nathan Sidwell Date: Fri Dec 18 05:02:54 2020 -0800 Merge trunk 35b8d268746 Diff: ChangeLog | 15 + ChangeLog.modules | 9755 +------------------- MAINTAINERS | 1 + c++tools/ChangeLog | 25 + c++tools/Makefile.in | 42 +- c++tools/config.h.in | 33 + c++tools/configure | 678 +- c++tools/configure.ac | 7 + c++tools/resolver.cc | 41 +- c++tools/server.cc | 3 +- contrib/ChangeLog | 9 + contrib/gcc_update | 4 + gcc/ChangeLog | 472 + gcc/DATESTAMP | 2 +- gcc/Makefile.in | 7 + gcc/ada/ChangeLog | 578 ++ gcc/ada/Makefile.rtl | 6 +- gcc/ada/adaint.c | 3 + gcc/ada/adaint.h | 10 +- gcc/ada/ali.adb | 10 +- gcc/ada/ali.ads | 4 +- gcc/ada/bindo-writers.adb | 2 +- gcc/ada/checks.adb | 56 +- gcc/ada/checks.ads | 1 - gcc/ada/debug.adb | 7 +- .../doc/gnat_rm/implementation_defined_pragmas.rst | 4 +- gcc/ada/exp_ch11.adb | 4 +- gcc/ada/exp_ch3.adb | 4 +- gcc/ada/exp_ch4.adb | 62 +- gcc/ada/exp_ch5.adb | 59 +- gcc/ada/exp_ch6.adb | 7 +- gcc/ada/exp_ch7.adb | 43 +- gcc/ada/exp_ch7.ads | 7 - gcc/ada/exp_ch9.adb | 3 +- gcc/ada/exp_dbug.adb | 2 +- gcc/ada/exp_fixd.adb | 14 - gcc/ada/exp_imgv.adb | 17 +- gcc/ada/exp_intr.adb | 10 +- gcc/ada/exp_tss.adb | 42 - gcc/ada/exp_tss.ads | 1 - gcc/ada/exp_util.adb | 140 +- gcc/ada/exp_util.ads | 24 - gcc/ada/expect.c | 8 +- gcc/ada/freeze.adb | 4 +- gcc/ada/gnat1drv.adb | 9 - gcc/ada/gnat_rm.texi | 6 +- gcc/ada/impunit.adb | 2 +- gcc/ada/lib-load.adb | 2 +- gcc/ada/lib-writ.adb | 2 +- gcc/ada/libgnarl/s-tporft.adb | 1 + gcc/ada/libgnat/a-cbdlli.adb | 10 +- gcc/ada/libgnat/a-cbdlli.ads | 6 +- gcc/ada/libgnat/a-cbsyqu.ads | 10 +- gcc/ada/libgnat/a-cdlili.adb | 10 +- gcc/ada/libgnat/a-cdlili.ads | 6 +- gcc/ada/libgnat/a-cidlli.adb | 10 +- gcc/ada/libgnat/a-cidlli.ads | 6 +- gcc/ada/libgnat/a-cobove.adb | 73 +- gcc/ada/libgnat/a-cobove.ads | 44 +- gcc/ada/libgnat/a-coinve.adb | 64 +- gcc/ada/libgnat/a-coinve.ads | 43 +- gcc/ada/libgnat/a-convec.adb | 80 +- gcc/ada/libgnat/a-convec.ads | 78 +- gcc/ada/libgnat/a-strfix.ads | 894 +- gcc/ada/libgnat/a-tags.adb | 44 - gcc/ada/libgnat/a-tags.ads | 50 +- gcc/ada/libgnat/a-tifiio.adb | 2 +- gcc/ada/libgnat/a-tifiio.ads | 2 +- gcc/ada/libgnat/a-tifiio__128.adb | 2 +- gcc/ada/libgnat/g-expect.adb | 6 + gcc/ada/libgnat/memtrack.adb | 33 +- gcc/ada/libgnat/s-finmas.adb | 14 - gcc/ada/libgnat/s-finmas.ads | 4 - gcc/ada/libgnat/s-imgrea.adb | 6 +- gcc/ada/libgnat/s-objrea.adb | 4 + gcc/ada/libgnat/s-objrea.ads | 5 +- gcc/ada/libgnat/s-powflt.ads | 85 + gcc/ada/libgnat/s-powlfl.ads | 355 + gcc/ada/libgnat/{s-powtab.ads => s-powllf.ads} | 12 +- gcc/ada/libgnat/s-valflt.ads | 7 +- gcc/ada/libgnat/s-vallfl.ads | 7 +- gcc/ada/libgnat/s-valllf.ads | 7 +- gcc/ada/libgnat/s-valrea.adb | 141 +- gcc/ada/libgnat/s-valrea.ads | 4 + gcc/ada/libgnat/s-valued.adb | 5 +- gcc/ada/libgnat/s-valuef.adb | 3 +- gcc/ada/libgnat/s-valuer.adb | 120 +- gcc/ada/libgnat/s-valuer.ads | 2 +- gcc/ada/libgnat/system-aix.ads | 2 - gcc/ada/libgnat/system-darwin-arm.ads | 2 - gcc/ada/libgnat/system-darwin-ppc.ads | 2 - gcc/ada/libgnat/system-darwin-x86.ads | 2 - gcc/ada/libgnat/system-djgpp.ads | 2 - gcc/ada/libgnat/system-dragonfly-x86_64.ads | 2 - gcc/ada/libgnat/system-freebsd.ads | 2 - gcc/ada/libgnat/system-hpux-ia64.ads | 2 - gcc/ada/libgnat/system-hpux.ads | 2 - gcc/ada/libgnat/system-linux-alpha.ads | 2 - gcc/ada/libgnat/system-linux-arm.ads | 2 - gcc/ada/libgnat/system-linux-hppa.ads | 2 - gcc/ada/libgnat/system-linux-ia64.ads | 2 - gcc/ada/libgnat/system-linux-m68k.ads | 2 - gcc/ada/libgnat/system-linux-mips.ads | 2 - gcc/ada/libgnat/system-linux-ppc.ads | 2 - gcc/ada/libgnat/system-linux-riscv.ads | 2 - gcc/ada/libgnat/system-linux-s390.ads | 2 - gcc/ada/libgnat/system-linux-sh4.ads | 2 - gcc/ada/libgnat/system-linux-sparc.ads | 2 - gcc/ada/libgnat/system-linux-x86.ads | 2 - gcc/ada/libgnat/system-lynxos178-ppc.ads | 4 +- gcc/ada/libgnat/system-lynxos178-x86.ads | 4 +- gcc/ada/libgnat/system-mingw.ads | 2 - gcc/ada/libgnat/system-qnx-aarch64.ads | 2 - gcc/ada/libgnat/system-rtems.ads | 2 - gcc/ada/libgnat/system-solaris-sparc.ads | 2 - gcc/ada/libgnat/system-solaris-x86.ads | 2 - gcc/ada/libgnat/system-vxworks-arm-rtp-smp.ads | 2 - gcc/ada/libgnat/system-vxworks-arm-rtp.ads | 2 - gcc/ada/libgnat/system-vxworks-arm.ads | 2 - gcc/ada/libgnat/system-vxworks-e500-kernel.ads | 2 - gcc/ada/libgnat/system-vxworks-e500-rtp-smp.ads | 2 - gcc/ada/libgnat/system-vxworks-e500-rtp.ads | 2 - gcc/ada/libgnat/system-vxworks-e500-vthread.ads | 2 - gcc/ada/libgnat/system-vxworks-ppc-kernel.ads | 2 - gcc/ada/libgnat/system-vxworks-ppc-ravenscar.ads | 2 - gcc/ada/libgnat/system-vxworks-ppc-rtp-smp.ads | 2 - gcc/ada/libgnat/system-vxworks-ppc-rtp.ads | 2 - gcc/ada/libgnat/system-vxworks-ppc-vthread.ads | 2 - gcc/ada/libgnat/system-vxworks-ppc.ads | 2 - gcc/ada/libgnat/system-vxworks-x86-kernel.ads | 2 - gcc/ada/libgnat/system-vxworks-x86-rtp-smp.ads | 2 - gcc/ada/libgnat/system-vxworks-x86-rtp.ads | 2 - gcc/ada/libgnat/system-vxworks-x86-vthread.ads | 2 - gcc/ada/libgnat/system-vxworks-x86.ads | 2 - .../libgnat/system-vxworks7-aarch64-rtp-smp.ads | 2 - gcc/ada/libgnat/system-vxworks7-aarch64.ads | 2 - gcc/ada/libgnat/system-vxworks7-arm-rtp-smp.ads | 2 - gcc/ada/libgnat/system-vxworks7-arm.ads | 2 - gcc/ada/libgnat/system-vxworks7-e500-kernel.ads | 2 - gcc/ada/libgnat/system-vxworks7-e500-rtp-smp.ads | 2 - gcc/ada/libgnat/system-vxworks7-e500-rtp.ads | 2 - gcc/ada/libgnat/system-vxworks7-ppc-kernel.ads | 2 - gcc/ada/libgnat/system-vxworks7-ppc-rtp-smp.ads | 2 - gcc/ada/libgnat/system-vxworks7-ppc-rtp.ads | 2 - gcc/ada/libgnat/system-vxworks7-ppc64-kernel.ads | 2 - gcc/ada/libgnat/system-vxworks7-ppc64-rtp-smp.ads | 2 - gcc/ada/libgnat/system-vxworks7-x86-kernel.ads | 2 - gcc/ada/libgnat/system-vxworks7-x86-rtp-smp.ads | 2 - gcc/ada/libgnat/system-vxworks7-x86-rtp.ads | 2 - gcc/ada/libgnat/system-vxworks7-x86_64-kernel.ads | 2 - gcc/ada/libgnat/system-vxworks7-x86_64-rtp-smp.ads | 2 - gcc/ada/opt.ads | 2 +- gcc/ada/par-ch12.adb | 27 +- gcc/ada/par-ch3.adb | 21 +- gcc/ada/par-ch4.adb | 18 +- gcc/ada/par-ch6.adb | 5 +- gcc/ada/par-ch9.adb | 9 +- gcc/ada/repinfo.adb | 80 +- gcc/ada/repinfo.ads | 88 +- gcc/ada/rtsfind.ads | 2 - gcc/ada/s-oscons-tmplt.c | 35 + gcc/ada/scng.adb | 19 +- gcc/ada/sem_aggr.adb | 17 +- gcc/ada/sem_attr.adb | 54 +- gcc/ada/sem_aux.adb | 116 +- gcc/ada/sem_aux.ads | 25 - gcc/ada/sem_cat.adb | 9 +- gcc/ada/sem_ch10.adb | 13 +- gcc/ada/sem_ch11.adb | 2 +- gcc/ada/sem_ch12.adb | 10 +- gcc/ada/sem_ch13.adb | 415 +- gcc/ada/sem_ch13.ads | 31 - gcc/ada/sem_ch3.adb | 78 +- gcc/ada/sem_ch4.adb | 18 +- gcc/ada/sem_ch5.adb | 61 +- gcc/ada/sem_ch6.adb | 6 +- gcc/ada/sem_ch8.adb | 34 +- gcc/ada/sem_ch9.adb | 20 +- gcc/ada/sem_disp.adb | 2 +- gcc/ada/sem_elab.adb | 4 +- gcc/ada/sem_eval.adb | 125 +- gcc/ada/sem_eval.ads | 5 + gcc/ada/sem_prag.adb | 56 +- gcc/ada/sem_res.adb | 93 +- gcc/ada/sem_util.adb | 943 +- gcc/ada/sem_util.ads | 34 +- gcc/ada/sem_warn.adb | 4 +- gcc/ada/symbols.adb | 90 - gcc/ada/symbols.ads | 115 - gcc/ada/targparm.adb | 16 +- gcc/ada/targparm.ads | 10 - gcc/ada/validsw.adb | 50 - gcc/ada/validsw.ads | 13 +- gcc/brig/ChangeLog | 4 + gcc/brig/lang.opt | 2 +- gcc/c-family/ChangeLog | 4 + gcc/c-family/c.opt | 8 +- gcc/c/ChangeLog | 11 + gcc/c/c-parser.c | 10 +- gcc/c/c-typeck.c | 13 +- gcc/cfgrtl.c | 47 + gcc/cfgrtl.h | 1 + gcc/combine.c | 36 - gcc/common.opt | 588 +- gcc/config.gcc | 4 + gcc/config/aarch64/aarch64-simd.md | 8 + gcc/config/aarch64/aarch64-sve.md | 14 + gcc/config/aarch64/aarch64-sve2.md | 10 + gcc/config/aarch64/aarch64.c | 35 +- gcc/config/aarch64/aarch64.opt | 18 +- gcc/config/aarch64/iterators.md | 4 + gcc/config/alpha/alpha.opt | 38 +- gcc/config/arc/arc.opt | 110 +- gcc/config/arm/arm-cpus.in | 11 + gcc/config/arm/arm-tables.opt | 3 + gcc/config/arm/arm-tune.md | 10 +- gcc/config/arm/arm.opt | 66 +- gcc/config/arm/arm_mve.h | 70 +- gcc/config/arm/arm_mve_builtins.def | 26 +- gcc/config/arm/arm_neon.h | 96 +- gcc/config/arm/arm_neon_builtins.def | 4 - gcc/config/arm/constraints.md | 2 +- gcc/config/arm/iterators.md | 22 +- gcc/config/arm/mve.md | 172 +- gcc/config/arm/unspecs.md | 18 +- gcc/config/arm/vec-common.md | 10 + gcc/config/avr/avr.opt | 52 +- gcc/config/bfin/bfin.opt | 34 +- gcc/config/bpf/bpf.opt | 6 +- gcc/config/c6x/c6x.opt | 6 +- gcc/config/cr16/cr16.opt | 4 +- gcc/config/cris/cris.opt | 64 +- gcc/config/cris/elf.opt | 2 +- gcc/config/csky/csky.opt | 60 +- gcc/config/darwin.opt | 24 +- gcc/config/fr30/fr30.opt | 2 +- gcc/config/frv/frv.opt | 62 +- gcc/config/ft32/ft32.opt | 12 +- gcc/config/gcn/gcn.opt | 12 +- gcc/config/i386/cygming.opt | 6 +- gcc/config/i386/i386.opt | 304 +- gcc/config/ia64/ia64.opt | 68 +- gcc/config/ia64/ilp32.opt | 4 +- gcc/config/linux-android.opt | 2 +- gcc/config/linux.opt | 8 +- gcc/config/lm32/lm32.opt | 10 +- gcc/config/m32r/m32r.opt | 14 +- gcc/config/m68k/m68k.opt | 24 +- gcc/config/mcore/mcore.opt | 22 +- gcc/config/microblaze/microblaze.opt | 8 +- gcc/config/mips/mips.opt | 164 +- gcc/config/mmix/mmix.opt | 34 +- gcc/config/mn10300/mn10300.opt | 10 +- gcc/config/moxie/moxie.opt | 6 +- gcc/config/msp430/msp430.opt | 34 +- gcc/config/nds32/nds32.opt | 40 +- gcc/config/nios2/elf.opt | 4 +- gcc/config/nios2/nios2.opt | 258 +- gcc/config/nvptx/nvptx.opt | 16 +- gcc/config/pa/pa.opt | 26 +- gcc/config/pdp11/pdp11.opt | 24 +- gcc/config/pru/pru.opt | 6 +- gcc/config/riscv/riscv.opt | 22 +- gcc/config/rl78/rl78.opt | 18 +- gcc/config/rs6000/aix64.opt | 6 +- gcc/config/rs6000/freebsd64.h | 12 +- gcc/config/rs6000/linux64.opt | 2 +- gcc/config/rs6000/mma.md | 32 +- gcc/config/rs6000/rs6000.c | 14 +- gcc/config/rs6000/rs6000.opt | 126 +- gcc/config/rs6000/sysv4.opt | 32 +- gcc/config/rx/elf.opt | 2 +- gcc/config/rx/rx.opt | 26 +- gcc/config/s390/s390.opt | 64 +- gcc/config/s390/tpf.opt | 14 +- gcc/config/sh/sh.opt | 38 +- gcc/config/sol2.opt | 4 +- gcc/config/sparc/long-double-switch.opt | 4 +- gcc/config/sparc/sparc.opt | 60 +- gcc/config/tilegx/tilegx.opt | 8 +- gcc/config/tilepro/tilepro.opt | 2 +- gcc/config/v850/v850.opt | 48 +- gcc/config/visium/visium.opt | 6 +- gcc/config/vms/vms.opt | 6 +- gcc/config/vxworks.opt | 2 +- gcc/config/xtensa/xtensa.c | 15 + gcc/config/xtensa/xtensa.md | 62 +- gcc/config/xtensa/xtensa.opt | 12 +- gcc/configure | 72 +- gcc/configure.ac | 57 +- gcc/cp/ChangeLog | 51 + gcc/cp/mapper-client.cc | 9 + gcc/cp/mapper-resolver.cc | 2 + gcc/cp/module.cc | 71 +- gcc/cp/parser.c | 4 +- gcc/d/ChangeLog | 7 + gcc/d/decl.cc | 43 +- gcc/defaults.h | 11 + gcc/doc/install.texi | 7 +- gcc/doc/invoke.texi | 21 +- gcc/doc/options.texi | 3 - gcc/doc/rtl.texi | 787 ++ gcc/doc/tm.texi | 7 +- gcc/emit-rtl.h | 3 + gcc/fortran/ChangeLog | 16 + gcc/fortran/match.c | 3 - gcc/fortran/resolve.c | 10 + gcc/fortran/trans-stmt.c | 5 +- gcc/fwprop.c | 1685 ++-- gcc/gimple-ssa-store-merging.c | 91 +- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/expressions.cc | 23 +- gcc/go/gofrontend/gogo.cc | 13 +- gcc/go/gofrontend/gogo.h | 17 + gcc/go/gofrontend/lex.cc | 7 + gcc/go/gofrontend/parse.cc | 1 + gcc/go/gofrontend/statements.cc | 2 +- gcc/go/gofrontend/types.cc | 21 +- gcc/hard-reg-set.h | 2 + gcc/iterator-utils.h | 159 + gcc/lto/ChangeLog | 4 + gcc/lto/lang.opt | 6 +- gcc/match.pd | 13 +- gcc/mux-utils.h | 251 + gcc/obstack-utils.h | 86 + gcc/opt-functions.awk | 4 +- gcc/optc-gen.awk | 4 - gcc/opts-common.c | 12 +- gcc/opts.h | 2 - gcc/output.h | 2 +- gcc/print-rtl.c | 5 +- gcc/print-rtl.h | 1 + gcc/range-op.cc | 25 + gcc/recog.c | 474 +- gcc/recog.h | 154 + gcc/reginfo.c | 5 + gcc/rtl-ssa.h | 71 + gcc/rtl-ssa/access-utils.h | 553 ++ gcc/rtl-ssa/accesses.cc | 1594 ++++ gcc/rtl-ssa/accesses.h | 1032 +++ gcc/rtl-ssa/blocks.cc | 1146 +++ gcc/rtl-ssa/blocks.h | 301 + gcc/rtl-ssa/change-utils.h | 137 + gcc/rtl-ssa/changes.cc | 1025 ++ gcc/rtl-ssa/changes.h | 118 + gcc/rtl-ssa/functions.cc | 325 + gcc/rtl-ssa/functions.h | 433 + gcc/rtl-ssa/insn-utils.h | 46 + gcc/rtl-ssa/insns.cc | 718 ++ gcc/rtl-ssa/insns.h | 505 + gcc/rtl-ssa/internals.inl | 682 ++ gcc/rtl-ssa/is-a.inl | 98 + gcc/rtl-ssa/member-fns.inl | 928 ++ gcc/rtl-ssa/movement.h | 335 + gcc/rtl.h | 151 +- gcc/rtlanal.c | 327 + gcc/rtlanal.h | 334 + gcc/selftest-run-tests.c | 1 + gcc/selftest.h | 1 + gcc/shrink-wrap.c | 2 +- gcc/simplify-rtx.c | 152 +- gcc/splay-tree-utils.cc | 264 + gcc/splay-tree-utils.h | 491 + gcc/splay-tree-utils.tcc | 960 ++ gcc/system.h | 6 + gcc/target.def | 7 +- gcc/target.h | 12 +- gcc/targhooks.c | 2 +- gcc/targhooks.h | 3 +- gcc/testsuite/ChangeLog | 152 + gcc/testsuite/c-c++-common/attr-used-5.c | 27 + gcc/testsuite/c-c++-common/attr-used-6.c | 27 + gcc/testsuite/c-c++-common/attr-used-7.c | 9 + gcc/testsuite/c-c++-common/attr-used-8.c | 9 + gcc/testsuite/c-c++-common/attr-used-9.c | 28 + gcc/testsuite/g++.dg/cpp0x/constexpr-52830.C | 1 - gcc/testsuite/g++.dg/template/pr98297.C | 6 + gcc/testsuite/gcc.dg/pr96239.c | 54 + gcc/testsuite/gcc.dg/pr97750.c | 21 + gcc/testsuite/gcc.dg/pr98271.c | 13 + gcc/testsuite/gcc.dg/pr98272.c | 22 + gcc/testsuite/gcc.dg/qual-assign-7.c | 18 + .../rtl/x86_64/test-return-const.c.before-fwprop.c | 2 +- gcc/testsuite/gcc.dg/torture/pr98289.c | 52 + gcc/testsuite/gcc.dg/tree-ssa/pr96094.c | 34 + gcc/testsuite/gcc.dg/tsan/atomic-fence.c | 11 + gcc/testsuite/gcc.dg/unused-9.c | 13 + .../gcc.target/aarch64/sve/acle/asm/st4_s8.c | 8 +- .../gcc.target/aarch64/sve/acle/asm/st4_u8.c | 8 +- gcc/testsuite/gcc.target/i386/pr98289.c | 54 + .../gcc.target/powerpc/fold-vec-logical-ors-char.c | 4 +- .../gcc.target/powerpc/fold-vec-logical-ors-int.c | 4 +- .../powerpc/fold-vec-logical-ors-longlong.c | 4 +- .../powerpc/fold-vec-logical-ors-short.c | 4 +- .../powerpc/fold-vec-logical-other-char.c | 2 +- .../powerpc/fold-vec-logical-other-int.c | 2 +- .../powerpc/fold-vec-logical-other-longlong.c | 2 +- .../powerpc/fold-vec-logical-other-short.c | 2 +- gcc/testsuite/gcc.target/powerpc/pr96933-1.c | 1 + gcc/testsuite/gcc.target/powerpc/pr96933-2.c | 1 + gcc/testsuite/gcc.target/xtensa/shifts.c | 31 + gcc/testsuite/gdc.dg/pr98277.d | 13 + gcc/testsuite/gfortran.dg/finalize_37.f90 | 80 + gcc/testsuite/gfortran.dg/forall_19.f90 | 32 + gcc/testsuite/gfortran.dg/pr98284.f90 | 12 + gcc/testsuite/gnat.dg/debug15.adb | 23 - gcc/testsuite/gnat.dg/interface6.adb | 2 +- gcc/testsuite/gnat.dg/not_null.adb | 4 +- gcc/testsuite/gnat.dg/protected_func.adb | 4 +- gcc/testsuite/go.test/test/fixedbugs/bug13343.go | 18 + gcc/testsuite/go.test/test/fixedbugs/bug19403.go | 134 + gcc/testsuite/go.test/test/fixedbugs/bug195.go | 2 +- gcc/testsuite/go.test/test/fixedbugs/bug251.go | 2 +- .../go.test/test/fixedbugs/bug369.dir/main.go | 55 + gcc/testsuite/go.test/test/fixedbugs/bug483.go | 36 + gcc/testsuite/go.test/test/fixedbugs/bug484.go | 78 + gcc/testsuite/go.test/test/fixedbugs/bug485.go | 39 + gcc/testsuite/go.test/test/fixedbugs/bug486.go | 14 + gcc/testsuite/go.test/test/fixedbugs/bug490.go | 16 + gcc/testsuite/go.test/test/fixedbugs/bug491.go | 110 + gcc/testsuite/go.test/test/fixedbugs/bug495.go | 20 + gcc/testsuite/go.test/test/fixedbugs/bug498.go | 23 + .../go.test/test/fixedbugs/bug510.dir/a.go | 13 + .../go.test/test/fixedbugs/bug510.dir/b.go | 14 + gcc/testsuite/go.test/test/fixedbugs/bug510.go | 9 + gcc/testsuite/go.test/test/fixedbugs/gcc61204.go | 17 + gcc/testsuite/go.test/test/fixedbugs/gcc61244.go | 19 + gcc/testsuite/go.test/test/fixedbugs/gcc61246.go | 17 + gcc/testsuite/go.test/test/fixedbugs/gcc61248.go | 14 + gcc/testsuite/go.test/test/fixedbugs/gcc61253.go | 20 + gcc/testsuite/go.test/test/fixedbugs/gcc61254.go | 13 + gcc/testsuite/go.test/test/fixedbugs/gcc61255.go | 13 + gcc/testsuite/go.test/test/fixedbugs/gcc61258.go | 13 + gcc/testsuite/go.test/test/fixedbugs/gcc61264.go | 13 + gcc/testsuite/go.test/test/fixedbugs/gcc61265.go | 16 + gcc/testsuite/go.test/test/fixedbugs/gcc61273.go | 16 + gcc/testsuite/go.test/test/fixedbugs/gcc65755.go | 37 + gcc/testsuite/go.test/test/fixedbugs/issue10047.go | 19 + .../go.test/test/fixedbugs/issue10066.dir/a.go | 11 + .../go.test/test/fixedbugs/issue10066.dir/b.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue10066.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue10135.go | 25 + .../go.test/test/fixedbugs/issue10219.dir/a.go | 24 + .../go.test/test/fixedbugs/issue10219.dir/b.go | 11 + .../go.test/test/fixedbugs/issue10219.dir/c.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue10219.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue10253.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue10284.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue10320.go | 55 + gcc/testsuite/go.test/test/fixedbugs/issue10332.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue10353.go | 49 + gcc/testsuite/go.test/test/fixedbugs/issue10407.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue10441.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue10486.go | 31 + gcc/testsuite/go.test/test/fixedbugs/issue10607.go | 34 + .../go.test/test/fixedbugs/issue10607a.go | 81 + gcc/testsuite/go.test/test/fixedbugs/issue10654.go | 17 + .../go.test/test/fixedbugs/issue10700.dir/other.go | 10 + .../go.test/test/fixedbugs/issue10700.dir/test.go | 49 + gcc/testsuite/go.test/test/fixedbugs/issue10700.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue10925.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue10958.go | 95 + gcc/testsuite/go.test/test/fixedbugs/issue10975.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue10977.go | 20 + .../go.test/test/fixedbugs/issue11053.dir/p.go | 9 + .../test/fixedbugs/issue11053.dir/p_test.go | 51 + gcc/testsuite/go.test/test/fixedbugs/issue11053.go | 10 + .../go.test/test/fixedbugs/issue11053.out | 3 + gcc/testsuite/go.test/test/fixedbugs/issue11256.go | 53 + gcc/testsuite/go.test/test/fixedbugs/issue11286.go | 34 + .../go.test/test/fixedbugs/issue11326b.go | 44 + gcc/testsuite/go.test/test/fixedbugs/issue11354.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue11359.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue11361.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue11362.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue11369.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue11370.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue11371.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue11590.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue11610.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue11614.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue11674.go | 40 + gcc/testsuite/go.test/test/fixedbugs/issue11699.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue11750.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue11771.go | 64 + gcc/testsuite/go.test/test/fixedbugs/issue11790.go | 36 + gcc/testsuite/go.test/test/fixedbugs/issue11945.go | 71 + gcc/testsuite/go.test/test/fixedbugs/issue11987.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue12006.go | 174 + gcc/testsuite/go.test/test/fixedbugs/issue12108.go | 37 + gcc/testsuite/go.test/test/fixedbugs/issue12133.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue12226.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue12347.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue12411.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue12413.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue12536.go | 22 + gcc/testsuite/go.test/test/fixedbugs/issue12577.go | 66 + gcc/testsuite/go.test/test/fixedbugs/issue12588.go | 88 + .../go.test/test/fixedbugs/issue12677.dir/p.go | 8 + .../go.test/test/fixedbugs/issue12677.dir/q.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue12677.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue12686.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue1304.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue13160.go | 70 + gcc/testsuite/go.test/test/fixedbugs/issue13162.go | 82 + gcc/testsuite/go.test/test/fixedbugs/issue13169.go | 49 + gcc/testsuite/go.test/test/fixedbugs/issue13171.go | 34 + gcc/testsuite/go.test/test/fixedbugs/issue13248.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue13261.go | 29 + gcc/testsuite/go.test/test/fixedbugs/issue13262.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue13263.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue13266.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue13268.go | 42 + gcc/testsuite/go.test/test/fixedbugs/issue13274.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue13337.go | 30 + gcc/testsuite/go.test/test/fixedbugs/issue13365.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue13415.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue13471.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue13480.go | 38 + gcc/testsuite/go.test/test/fixedbugs/issue13485.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue13539.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue13684.go | 17 + .../test/fixedbugs/issue13777.dir/burnin.go | 19 + .../go.test/test/fixedbugs/issue13777.dir/main.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue13777.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue13799.go | 190 + gcc/testsuite/go.test/test/fixedbugs/issue13821.go | 15 + .../go.test/test/fixedbugs/issue13821b.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue14006.go | 67 + gcc/testsuite/go.test/test/fixedbugs/issue14010.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue14136.go | 19 + .../go.test/test/fixedbugs/issue14164.dir/a.go | 47 + .../go.test/test/fixedbugs/issue14164.dir/main.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue14164.go | 7 + .../go.test/test/fixedbugs/issue14331.dir/a.go | 14 + .../go.test/test/fixedbugs/issue14331.dir/b.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue14331.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue14405.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue14520.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue14553.go | 45 + gcc/testsuite/go.test/test/fixedbugs/issue14591.go | 38 + gcc/testsuite/go.test/test/fixedbugs/issue14636.go | 43 + gcc/testsuite/go.test/test/fixedbugs/issue14646.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue14651.go | 71 + gcc/testsuite/go.test/test/fixedbugs/issue14652.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue14725.go | 57 + gcc/testsuite/go.test/test/fixedbugs/issue14729.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue14988.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue15013.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue15039.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue15042.go | 27 + .../go.test/test/fixedbugs/issue15071.dir/exp.go | 24 + .../go.test/test/fixedbugs/issue15071.dir/main.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue15071.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue15084.go | 30 + gcc/testsuite/go.test/test/fixedbugs/issue15141.go | 33 + gcc/testsuite/go.test/test/fixedbugs/issue15175.go | 66 + gcc/testsuite/go.test/test/fixedbugs/issue15252.go | 32 + gcc/testsuite/go.test/test/fixedbugs/issue15277.go | 40 + gcc/testsuite/go.test/test/fixedbugs/issue15303.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue15329.go | 79 + gcc/testsuite/go.test/test/fixedbugs/issue15439.go | 25 + .../go.test/test/fixedbugs/issue15470.dir/a.go | 24 + .../go.test/test/fixedbugs/issue15470.dir/b.go | 3 + gcc/testsuite/go.test/test/fixedbugs/issue15470.go | 10 + .../go.test/test/fixedbugs/issue15514.dir/a.go | 7 + .../go.test/test/fixedbugs/issue15514.dir/b.go | 7 + .../go.test/test/fixedbugs/issue15514.dir/c.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue15514.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue15528.go | 131 + .../go.test/test/fixedbugs/issue15548.dir/a.go | 17 + .../go.test/test/fixedbugs/issue15548.dir/b.go | 9 + .../go.test/test/fixedbugs/issue15548.dir/c.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue15548.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue15550.go | 28 + .../go.test/test/fixedbugs/issue15572.dir/a.go | 40 + .../go.test/test/fixedbugs/issue15572.dir/b.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue15572.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue15585.go | 45 + gcc/testsuite/go.test/test/fixedbugs/issue15602.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue15604.go | 17 + .../go.test/test/fixedbugs/issue15609.dir/call.go | 7 + .../test/fixedbugs/issue15609.dir/call_386.s | 8 + .../test/fixedbugs/issue15609.dir/call_amd64.s | 8 + .../test/fixedbugs/issue15609.dir/call_decl.go | 5 + .../go.test/test/fixedbugs/issue15609.dir/main.go | 14 + .../go.test/test/fixedbugs/issue15646.dir/a.go | 23 + .../go.test/test/fixedbugs/issue15646.dir/b.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue15646.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue15722.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue15733.go | 23 + .../go.test/test/fixedbugs/issue15838.dir/a.go | 61 + .../go.test/test/fixedbugs/issue15838.dir/b.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue15838.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue15895.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue15898.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue15902.go | 27 + .../go.test/test/fixedbugs/issue15920.dir/a.go | 9 + .../go.test/test/fixedbugs/issue15920.dir/b.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue15920.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue15926.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue15961.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue15988.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue15992.go | 38 + .../go.test/test/fixedbugs/issue15992.out | 4 + gcc/testsuite/go.test/test/fixedbugs/issue16016.go | 35 + .../go.test/test/fixedbugs/issue16037_run.go | 70 + gcc/testsuite/go.test/test/fixedbugs/issue16095.go | 104 + gcc/testsuite/go.test/test/fixedbugs/issue16130.go | 43 + .../go.test/test/fixedbugs/issue16133.dir/a1.go | 7 + .../go.test/test/fixedbugs/issue16133.dir/a2.go | 7 + .../go.test/test/fixedbugs/issue16133.dir/b.go | 7 + .../go.test/test/fixedbugs/issue16133.dir/c.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue16193.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue16249.go | 58 + gcc/testsuite/go.test/test/fixedbugs/issue16306.go | 15 + .../go.test/test/fixedbugs/issue16317.dir/a.go | 11 + .../go.test/test/fixedbugs/issue16317.dir/b.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue16317.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue16331.go | 48 + gcc/testsuite/go.test/test/fixedbugs/issue16369.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue16428.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue16439.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue16515.go | 53 + .../go.test/test/fixedbugs/issue16616.dir/a.go | 7 + .../go.test/test/fixedbugs/issue16616.dir/b.go | 14 + .../test/fixedbugs/issue16616.dir/issue16616.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue16616.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue16733.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue16741.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue16760.go | 42 + gcc/testsuite/go.test/test/fixedbugs/issue16804.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue16948.go | 34 + gcc/testsuite/go.test/test/fixedbugs/issue16985.go | 37 + gcc/testsuite/go.test/test/fixedbugs/issue17005.go | 46 + gcc/testsuite/go.test/test/fixedbugs/issue17111.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue17194.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue17270.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue17328.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue17381.go | 54 + gcc/testsuite/go.test/test/fixedbugs/issue17551.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue17588.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue17596.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue17631.go | 22 + gcc/testsuite/go.test/test/fixedbugs/issue17640.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue17645.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue17710.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue17752.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue17758.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue17918.go | 41 + gcc/testsuite/go.test/test/fixedbugs/issue18089.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue18092.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue18231.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue18393.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue18410.go | 40 + .../go.test/test/fixedbugs/issue18419.dir/other.go | 11 + .../go.test/test/fixedbugs/issue18419.dir/test.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue18419.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue18595.go | 53 + gcc/testsuite/go.test/test/fixedbugs/issue18636.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue18640.go | 46 + gcc/testsuite/go.test/test/fixedbugs/issue18655.go | 22 + gcc/testsuite/go.test/test/fixedbugs/issue18661.go | 39 + gcc/testsuite/go.test/test/fixedbugs/issue18725.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue18808.go | 63 + gcc/testsuite/go.test/test/fixedbugs/issue18906.go | 36 + gcc/testsuite/go.test/test/fixedbugs/issue18915.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue18994.go | 22 + gcc/testsuite/go.test/test/fixedbugs/issue19012.go | 25 + .../go.test/test/fixedbugs/issue19028.dir/a.go | 9 + .../go.test/test/fixedbugs/issue19028.dir/main.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue19028.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue19040.go | 36 + gcc/testsuite/go.test/test/fixedbugs/issue19056.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue19078.go | 42 + gcc/testsuite/go.test/test/fixedbugs/issue19084.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue19137.go | 51 + gcc/testsuite/go.test/test/fixedbugs/issue19182.go | 37 + gcc/testsuite/go.test/test/fixedbugs/issue19201.go | 52 + gcc/testsuite/go.test/test/fixedbugs/issue19217.go | 39 + gcc/testsuite/go.test/test/fixedbugs/issue19275.go | 72 + gcc/testsuite/go.test/test/fixedbugs/issue19323.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue19359.go | 91 + gcc/testsuite/go.test/test/fixedbugs/issue19482.go | 34 + .../test/fixedbugs/issue19507.dir/div_arm.s | 12 + .../go.test/test/fixedbugs/issue19507.dir/main.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue19507.go | 8 + gcc/testsuite/go.test/test/fixedbugs/issue19515.go | 51 + .../go.test/test/fixedbugs/issue19548.dir/a.go | 26 + .../go.test/test/fixedbugs/issue19548.dir/b.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue19548.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue19555.go | 36 + gcc/testsuite/go.test/test/fixedbugs/issue19632.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue19658.go | 99 + gcc/testsuite/go.test/test/fixedbugs/issue19667.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue19671.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue19678.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue19679.go | 38 + gcc/testsuite/go.test/test/fixedbugs/issue19696.go | 20 + .../go.test/test/fixedbugs/issue19699b.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue19705.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue19710.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue19743.go | 31 + .../go.test/test/fixedbugs/issue19764.dir/a.go | 15 + .../go.test/test/fixedbugs/issue19764.dir/b.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue19764.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue19783.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue19799.go | 71 + gcc/testsuite/go.test/test/fixedbugs/issue19880.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue19911.go | 34 + gcc/testsuite/go.test/test/fixedbugs/issue19977.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue20029.go | 32 + gcc/testsuite/go.test/test/fixedbugs/issue20097.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue20145.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue20185.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue20227.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue20333.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue20335.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue20415.go | 33 + gcc/testsuite/go.test/test/fixedbugs/issue20529.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue20530.go | 34 + gcc/testsuite/go.test/test/fixedbugs/issue20602.go | 14 + .../go.test/test/fixedbugs/issue20682.dir/p.go | 13 + .../go.test/test/fixedbugs/issue20682.dir/q.go | 13 + .../go.test/test/fixedbugs/issue20682.dir/r.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue20682.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue20739.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue20749.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue20780.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue20811.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue20812.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue20813.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue21048.go | 72 + .../go.test/test/fixedbugs/issue21120.dir/a.go | 13 + .../go.test/test/fixedbugs/issue21120.dir/b.go | 29 + .../go.test/test/fixedbugs/issue21120.dir/main.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue21120.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue21221.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue21256.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue21273.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue21317.go | 60 + gcc/testsuite/go.test/test/fixedbugs/issue21576.go | 63 + gcc/testsuite/go.test/test/fixedbugs/issue21655.go | 62 + gcc/testsuite/go.test/test/fixedbugs/issue21770.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue21808.go | 17 + .../go.test/test/fixedbugs/issue21808.out | 3 + gcc/testsuite/go.test/test/fixedbugs/issue21879.go | 37 + .../go.test/test/fixedbugs/issue21879.out | 2 + gcc/testsuite/go.test/test/fixedbugs/issue21882.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue21887.go | 25 + .../go.test/test/fixedbugs/issue21887.out | 2 + gcc/testsuite/go.test/test/fixedbugs/issue21963.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue21979.go | 46 + gcc/testsuite/go.test/test/fixedbugs/issue21988.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue22063.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue22076.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue22083.go | 41 + gcc/testsuite/go.test/test/fixedbugs/issue22198.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue22200.go | 20 + .../go.test/test/fixedbugs/issue22200b.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue22326.go | 25 + .../go.test/test/fixedbugs/issue22326.out | 1 + gcc/testsuite/go.test/test/fixedbugs/issue22327.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue22429.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue22458.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue22605.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue22660.go | 50 + gcc/testsuite/go.test/test/fixedbugs/issue22683.go | 30 + .../go.test/test/fixedbugs/issue22683.out | 1 + gcc/testsuite/go.test/test/fixedbugs/issue22781.go | 29 + gcc/testsuite/go.test/test/fixedbugs/issue22794.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue22822.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue22881.go | 117 + gcc/testsuite/go.test/test/fixedbugs/issue22904.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue22921.go | 18 + .../go.test/test/fixedbugs/issue22941.dir/a.go | 7 + .../go.test/test/fixedbugs/issue22941.dir/b.go | 30 + .../go.test/test/fixedbugs/issue22941.dir/main.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue22941.go | 7 + .../go.test/test/fixedbugs/issue22962.dir/a.go | 11 + .../go.test/test/fixedbugs/issue22962.dir/b.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue22962.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue23093.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue23116.go | 15 + .../go.test/test/fixedbugs/issue23179.dir/a.go | 13 + .../go.test/test/fixedbugs/issue23179.dir/b.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue23179.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue23298.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue23305.go | 28 + .../go.test/test/fixedbugs/issue23311.dir/main.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue23311.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue23414.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue23504.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue23521.go | 43 + gcc/testsuite/go.test/test/fixedbugs/issue23522.go | 46 + gcc/testsuite/go.test/test/fixedbugs/issue23545.go | 31 + gcc/testsuite/go.test/test/fixedbugs/issue23546.go | 22 + gcc/testsuite/go.test/test/fixedbugs/issue23586.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue23719.go | 42 + gcc/testsuite/go.test/test/fixedbugs/issue23732.go | 42 + gcc/testsuite/go.test/test/fixedbugs/issue23734.go | 32 + gcc/testsuite/go.test/test/fixedbugs/issue23780.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue23781.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue23812.go | 34 + gcc/testsuite/go.test/test/fixedbugs/issue23823.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue24120.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue24173.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue24187.go | 33 + gcc/testsuite/go.test/test/fixedbugs/issue24419.go | 51 + gcc/testsuite/go.test/test/fixedbugs/issue24449.go | 62 + gcc/testsuite/go.test/test/fixedbugs/issue24470.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue24488.go | 38 + gcc/testsuite/go.test/test/fixedbugs/issue24503.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue24547.go | 46 + gcc/testsuite/go.test/test/fixedbugs/issue24760.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue24763.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue24799.go | 58 + .../go.test/test/fixedbugs/issue24801.dir/a.go | 9 + .../go.test/test/fixedbugs/issue24801.dir/main.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue24801.go | 5 + gcc/testsuite/go.test/test/fixedbugs/issue24817.go | 64 + gcc/testsuite/go.test/test/fixedbugs/issue24937.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue24939.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue25006.go | 30 + gcc/testsuite/go.test/test/fixedbugs/issue25101.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue25322.go | 23 + .../go.test/test/fixedbugs/issue25322.out | 1 + gcc/testsuite/go.test/test/fixedbugs/issue25507.go | 29 + gcc/testsuite/go.test/test/fixedbugs/issue25516.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue25727.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue25741.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue25776.go | 99 + .../go.test/test/fixedbugs/issue25897a.go | 34 + .../go.test/test/fixedbugs/issue25897b.go | 38 + gcc/testsuite/go.test/test/fixedbugs/issue25958.go | 17 + .../go.test/test/fixedbugs/issue25984.dir/p.go | 15 + .../go.test/test/fixedbugs/issue25984.dir/q.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue25984.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue26024.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue26043.go | 32 + gcc/testsuite/go.test/test/fixedbugs/issue26097.go | 47 + gcc/testsuite/go.test/test/fixedbugs/issue26105.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue26116.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue26120.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue26153.go | 29 + gcc/testsuite/go.test/test/fixedbugs/issue26248.go | 39 + .../go.test/test/fixedbugs/issue26341.dir/a.go | 11 + .../go.test/test/fixedbugs/issue26341.dir/b.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue26341.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue26407.go | 58 + gcc/testsuite/go.test/test/fixedbugs/issue26411.go | 92 + gcc/testsuite/go.test/test/fixedbugs/issue26416.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue26438.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue26495.go | 36 + gcc/testsuite/go.test/test/fixedbugs/issue26616.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue26855.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue27143.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue27232.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue27267.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue27278.go | 63 + gcc/testsuite/go.test/test/fixedbugs/issue27289.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue27356.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue27695.go | 62 + .../go.test/test/fixedbugs/issue27695b.go | 64 + .../go.test/test/fixedbugs/issue27695c.go | 65 + gcc/testsuite/go.test/test/fixedbugs/issue27718.go | 102 + gcc/testsuite/go.test/test/fixedbugs/issue27829.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue27938.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue27961.go | 35 + gcc/testsuite/go.test/test/fixedbugs/issue28055.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue28058.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue28078.go | 34 + .../go.test/test/fixedbugs/issue28079a.go | 20 + .../go.test/test/fixedbugs/issue28079b.go | 17 + .../go.test/test/fixedbugs/issue28079c.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue28268.go | 30 + gcc/testsuite/go.test/test/fixedbugs/issue28390.go | 39 + .../go.test/test/fixedbugs/issue28390.out | 2 + gcc/testsuite/go.test/test/fixedbugs/issue28430.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue28445.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue28450.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue28616.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue28688.go | 31 + gcc/testsuite/go.test/test/fixedbugs/issue28797.go | 53 + .../go.test/test/fixedbugs/issue29013a.go | 24 + .../go.test/test/fixedbugs/issue29013b.go | 43 + gcc/testsuite/go.test/test/fixedbugs/issue29190.go | 37 + gcc/testsuite/go.test/test/fixedbugs/issue29215.go | 35 + gcc/testsuite/go.test/test/fixedbugs/issue29218.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue29220.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue29264.go | 22 + gcc/testsuite/go.test/test/fixedbugs/issue29304.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue29312.go | 70 + gcc/testsuite/go.test/test/fixedbugs/issue29329.go | 107 + gcc/testsuite/go.test/test/fixedbugs/issue29350.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue29362.go | 42 + .../go.test/test/fixedbugs/issue29362b.go | 53 + gcc/testsuite/go.test/test/fixedbugs/issue29389.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue29402.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue29562.go | 26 + .../go.test/test/fixedbugs/issue29610.dir/a.go | 15 + .../go.test/test/fixedbugs/issue29610.dir/b.go | 17 + .../go.test/test/fixedbugs/issue29610.dir/main.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue29610.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue29735.go | 33 + gcc/testsuite/go.test/test/fixedbugs/issue29855.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue29870.go | 15 + .../go.test/test/fixedbugs/issue29870b.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue29943.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue30041.go | 63 + gcc/testsuite/go.test/test/fixedbugs/issue30061.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue30085.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue30087.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue30243.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue30430.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue30476.go | 30 + .../go.test/test/fixedbugs/issue30566a.go | 23 + .../go.test/test/fixedbugs/issue30566b.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue30606.go | 20 + .../go.test/test/fixedbugs/issue30606b.go | 51 + gcc/testsuite/go.test/test/fixedbugs/issue30679.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue30709.go | 33 + .../go.test/test/fixedbugs/issue30709.out | 4 + .../go.test/test/fixedbugs/issue30862.dir/a.go | 15 + .../go.test/test/fixedbugs/issue30862.dir/b.go | 29 + .../go.test/test/fixedbugs/issue30862.dir/main.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue30862.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue30898.go | 19 + .../go.test/test/fixedbugs/issue30907.dir/a.go | 19 + .../go.test/test/fixedbugs/issue30907.dir/b.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue30907.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue30956.go | 32 + .../go.test/test/fixedbugs/issue30956.out | 1 + gcc/testsuite/go.test/test/fixedbugs/issue30977.go | 52 + gcc/testsuite/go.test/test/fixedbugs/issue31010.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue31060.go | 30 + .../go.test/test/fixedbugs/issue31252.dir/a.go | 13 + .../go.test/test/fixedbugs/issue31252.dir/b.go | 13 + .../go.test/test/fixedbugs/issue31252.dir/c.go | 26 + .../go.test/test/fixedbugs/issue31252.dir/main.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue31252.go | 7 + .../go.test/test/fixedbugs/issue31412a.go | 32 + .../go.test/test/fixedbugs/issue31412b.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue31419.go | 58 + gcc/testsuite/go.test/test/fixedbugs/issue31573.go | 49 + .../go.test/test/fixedbugs/issue31637.dir/a.go | 15 + .../go.test/test/fixedbugs/issue31637.dir/b.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue31637.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue31777.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue31782.go | 24 + .../go.test/test/fixedbugs/issue31782.out | 1 + gcc/testsuite/go.test/test/fixedbugs/issue31987.go | 22 + gcc/testsuite/go.test/test/fixedbugs/issue32175.go | 22 + .../go.test/test/fixedbugs/issue32175.out | 1 + gcc/testsuite/go.test/test/fixedbugs/issue32288.go | 48 + gcc/testsuite/go.test/test/fixedbugs/issue32347.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue32454.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue32560.go | 51 + .../go.test/test/fixedbugs/issue32595.dir/a.go | 9 + .../go.test/test/fixedbugs/issue32595.dir/b.go | 15 + .../go.test/test/fixedbugs/issue32595.dir/main.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue32595.go | 7 + gcc/testsuite/go.test/test/fixedbugs/issue32680.go | 23 + .../go.test/test/fixedbugs/issue32680.out | 1 + .../go.test/test/fixedbugs/issue32680b.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue32723.go | 22 + .../go.test/test/fixedbugs/issue32778.dir/a.go | 18 + .../go.test/test/fixedbugs/issue32778.dir/b.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue32778.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue32959.go | 17 + .../go.test/test/fixedbugs/issue33020a.dir/a.go | 13 + .../go.test/test/fixedbugs/issue33020a.dir/b.go | 14 + .../go.test/test/fixedbugs/issue33020a.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue33275.go | 34 + .../go.test/test/fixedbugs/issue33275_run.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue33308.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue33355.go | 147 + gcc/testsuite/go.test/test/fixedbugs/issue33386.go | 29 + gcc/testsuite/go.test/test/fixedbugs/issue33438.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue33460.go | 37 + gcc/testsuite/go.test/test/fixedbugs/issue33555.go | 81 + gcc/testsuite/go.test/test/fixedbugs/issue33724.go | 45 + .../go.test/test/fixedbugs/issue33866.dir/a.go | 18 + .../go.test/test/fixedbugs/issue33866.dir/b.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue33866.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue33903.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue34123.go | 43 + gcc/testsuite/go.test/test/fixedbugs/issue34395.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue34520.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue34968.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue35027.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue35073.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue35157.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue35291.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue35576.go | 16 + .../go.test/test/fixedbugs/issue35576.out | 1 + .../go.test/test/fixedbugs/issue35586.dir/a.go | 9 + .../go.test/test/fixedbugs/issue35586.dir/b.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue35586.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue35652.go | 28 + .../go.test/test/fixedbugs/issue36085.dir/a.go | 3 + .../go.test/test/fixedbugs/issue36085.dir/b.go | 8 + gcc/testsuite/go.test/test/fixedbugs/issue36085.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue36259.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue36437.go | 49 + gcc/testsuite/go.test/test/fixedbugs/issue36516.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue36705.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue37246.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue37716.go | 32 + gcc/testsuite/go.test/test/fixedbugs/issue37753.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue37975.go | 54 + gcc/testsuite/go.test/test/fixedbugs/issue38093.go | 49 + gcc/testsuite/go.test/test/fixedbugs/issue38117.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue38356.go | 54 + gcc/testsuite/go.test/test/fixedbugs/issue38359.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue38690.go | 65 + gcc/testsuite/go.test/test/fixedbugs/issue38745.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue38746.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue38905.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue38916.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue39292.go | 29 + gcc/testsuite/go.test/test/fixedbugs/issue39459.go | 22 + gcc/testsuite/go.test/test/fixedbugs/issue39505.go | 31 + .../go.test/test/fixedbugs/issue39505b.go | 183 + gcc/testsuite/go.test/test/fixedbugs/issue39541.go | 33 + gcc/testsuite/go.test/test/fixedbugs/issue39651.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue40367.go | 41 + gcc/testsuite/go.test/test/fixedbugs/issue40629.go | 69 + gcc/testsuite/go.test/test/fixedbugs/issue40746.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue40917.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue40954.go | 35 + gcc/testsuite/go.test/test/fixedbugs/issue41247.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue41440.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue41500.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue41575.go | 36 + gcc/testsuite/go.test/test/fixedbugs/issue41680.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue41736.go | 105 + gcc/testsuite/go.test/test/fixedbugs/issue41780.go | 39 + gcc/testsuite/go.test/test/fixedbugs/issue41872.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue42032.go | 27 + .../go.test/test/fixedbugs/issue42058a.go | 13 + .../go.test/test/fixedbugs/issue42058b.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue42075.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue42076.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue4215.go | 53 + gcc/testsuite/go.test/test/fixedbugs/issue42568.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue42587.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue42703.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue42727.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue42784.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue42876.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue43099.go | 34 + gcc/testsuite/go.test/test/fixedbugs/issue43111.go | 70 + gcc/testsuite/go.test/test/fixedbugs/issue43112.go | 41 + gcc/testsuite/go.test/test/fixedbugs/issue4365.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue5373.go | 71 + gcc/testsuite/go.test/test/fixedbugs/issue5793.go | 36 + .../go.test/test/fixedbugs/issue6295.dir/p0.go | 13 + .../go.test/test/fixedbugs/issue6295.dir/p1.go | 26 + .../go.test/test/fixedbugs/issue6295.dir/p2.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue6295.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue6402.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue6403.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue6406.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue6703a.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue6703b.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue6703c.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue6703d.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue6703e.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue6703f.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue6703g.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue6703h.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue6703i.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue6703j.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue6703k.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue6703l.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue6703m.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue6703n.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue6703o.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue6703p.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue6703q.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue6703r.go | 28 + gcc/testsuite/go.test/test/fixedbugs/issue6703s.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue6703t.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue6703u.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue6703v.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue6703w.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue6703x.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue6703y.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue6703z.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue6772.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue6847.go | 85 + gcc/testsuite/go.test/test/fixedbugs/issue6866.go | 80 + gcc/testsuite/go.test/test/fixedbugs/issue6889.go | 111 + gcc/testsuite/go.test/test/fixedbugs/issue6902.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue6964.go | 11 + .../go.test/test/fixedbugs/issue7023.dir/a.go | 10 + .../go.test/test/fixedbugs/issue7023.dir/b.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue7023.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue7044.go | 43 + gcc/testsuite/go.test/test/fixedbugs/issue7050.go | 19 + gcc/testsuite/go.test/test/fixedbugs/issue7083.go | 22 + gcc/testsuite/go.test/test/fixedbugs/issue7129.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue7150.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue7153.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue7223.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue7272.go | 48 + gcc/testsuite/go.test/test/fixedbugs/issue7310.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue7316.go | 37 + gcc/testsuite/go.test/test/fixedbugs/issue7346.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue7366.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue7405.go | 51 + gcc/testsuite/go.test/test/fixedbugs/issue7419.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue7538a.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue7538b.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue7547.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue7550.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue7590.go | 21 + .../go.test/test/fixedbugs/issue7648.dir/a.go | 11 + .../go.test/test/fixedbugs/issue7648.dir/b.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue7648.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue7740.go | 35 + gcc/testsuite/go.test/test/fixedbugs/issue7742.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue7746.go | 133 + gcc/testsuite/go.test/test/fixedbugs/issue7760.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue7794.go | 12 + gcc/testsuite/go.test/test/fixedbugs/issue7863.go | 60 + gcc/testsuite/go.test/test/fixedbugs/issue7867.go | 43 + gcc/testsuite/go.test/test/fixedbugs/issue7884.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue7921.go | 57 + gcc/testsuite/go.test/test/fixedbugs/issue7944.go | 40 + gcc/testsuite/go.test/test/fixedbugs/issue7995.go | 25 + .../go.test/test/fixedbugs/issue7995b.dir/x1.go | 12 + .../go.test/test/fixedbugs/issue7995b.dir/x2.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue7995b.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue7996.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue7997.go | 53 + gcc/testsuite/go.test/test/fixedbugs/issue7998.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue8004.go | 59 + gcc/testsuite/go.test/test/fixedbugs/issue8011.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue8017.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue8028.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue8036.go | 45 + gcc/testsuite/go.test/test/fixedbugs/issue8039.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue8047.go | 29 + gcc/testsuite/go.test/test/fixedbugs/issue8047b.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue8048.go | 107 + .../go.test/test/fixedbugs/issue8060.dir/a.go | 7 + .../go.test/test/fixedbugs/issue8060.dir/b.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue8060.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue8073.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue8074.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue8076.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue8079.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue8132.go | 32 + gcc/testsuite/go.test/test/fixedbugs/issue8139.go | 50 + gcc/testsuite/go.test/test/fixedbugs/issue8154.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue8155.go | 48 + gcc/testsuite/go.test/test/fixedbugs/issue8158.go | 41 + gcc/testsuite/go.test/test/fixedbugs/issue8183.go | 23 + .../go.test/test/fixedbugs/issue8280.dir/a.go | 3 + .../go.test/test/fixedbugs/issue8280.dir/b.go | 5 + gcc/testsuite/go.test/test/fixedbugs/issue8280.go | 9 + gcc/testsuite/go.test/test/fixedbugs/issue8311.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue8325.go | 31 + gcc/testsuite/go.test/test/fixedbugs/issue8336.go | 29 + gcc/testsuite/go.test/test/fixedbugs/issue8347.go | 27 + gcc/testsuite/go.test/test/fixedbugs/issue8385.go | 42 + gcc/testsuite/go.test/test/fixedbugs/issue8438.go | 17 + gcc/testsuite/go.test/test/fixedbugs/issue8440.go | 11 + gcc/testsuite/go.test/test/fixedbugs/issue8475.go | 25 + gcc/testsuite/go.test/test/fixedbugs/issue8501.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue8613.go | 38 + gcc/testsuite/go.test/test/fixedbugs/issue8620.go | 30 + gcc/testsuite/go.test/test/fixedbugs/issue8745.go | 13 + gcc/testsuite/go.test/test/fixedbugs/issue8761.go | 26 + gcc/testsuite/go.test/test/fixedbugs/issue8836.go | 24 + gcc/testsuite/go.test/test/fixedbugs/issue8947.go | 53 + gcc/testsuite/go.test/test/fixedbugs/issue8961.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue9006.go | 37 + gcc/testsuite/go.test/test/fixedbugs/issue9017.go | 57 + gcc/testsuite/go.test/test/fixedbugs/issue9036.go | 31 + gcc/testsuite/go.test/test/fixedbugs/issue9076.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue9083.go | 23 + gcc/testsuite/go.test/test/fixedbugs/issue9110.go | 91 + gcc/testsuite/go.test/test/fixedbugs/issue9321.go | 37 + .../go.test/test/fixedbugs/issue9355.dir/a.go | 16 + gcc/testsuite/go.test/test/fixedbugs/issue9355.go | 67 + gcc/testsuite/go.test/test/fixedbugs/issue9370.go | 127 + gcc/testsuite/go.test/test/fixedbugs/issue9432.go | 15 + gcc/testsuite/go.test/test/fixedbugs/issue9521.go | 18 + .../go.test/test/fixedbugs/issue9537.dir/a.go | 25 + .../go.test/test/fixedbugs/issue9537.dir/b.go | 43 + gcc/testsuite/go.test/test/fixedbugs/issue9537.go | 10 + gcc/testsuite/go.test/test/fixedbugs/issue9604.go | 29 + gcc/testsuite/go.test/test/fixedbugs/issue9604b.go | 180 + .../test/fixedbugs/issue9608.dir/issue9608.go | 82 + gcc/testsuite/go.test/test/fixedbugs/issue9608.go | 14 + gcc/testsuite/go.test/test/fixedbugs/issue9634.go | 18 + gcc/testsuite/go.test/test/fixedbugs/issue9691.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue9731.go | 21 + gcc/testsuite/go.test/test/fixedbugs/issue9738.go | 20 + gcc/testsuite/go.test/test/fixedbugs/issue9862.go | 15 + .../go.test/test/fixedbugs/issue9862_run.go | 27 + gcc/testsuite/lib/target-supports.exp | 2 +- gcc/tree-switch-conversion.c | 13 +- gcc/tree-vect-loop.c | 85 +- gcc/tsan.c | 6 + gcc/varasm.c | 66 +- gcc/vec.h | 120 + libcody/ChangeLog | 85 + libcody/Makefile.in | 8 +- libcody/buffer.cc | 1 - libcody/cody.hh | 4 + libcody/config.m4 | 24 +- libcody/configure | 87 +- libcody/configure.ac | 50 +- libcody/fatal.cc | 3 +- libcody/internal.hh | 15 +- libstdc++-v3/ChangeLog | 199 + libstdc++-v3/Makefile.in | 6 +- libstdc++-v3/acinclude.m4 | 29 - libstdc++-v3/config.h.in | 61 +- libstdc++-v3/config/abi/pre/gnu.ver | 4 +- libstdc++-v3/config/os/djgpp/error_constants.h | 28 +- libstdc++-v3/config/os/generic/error_constants.h | 28 +- .../config/os/gnu-linux/ldbl-ieee128-extra.ver | 53 + .../config/os/mingw32-w64/error_constants.h | 36 +- libstdc++-v3/config/os/mingw32/error_constants.h | 14 +- libstdc++-v3/configure | 762 +- libstdc++-v3/configure.ac | 38 +- libstdc++-v3/doc/Makefile.in | 6 +- libstdc++-v3/fragment.am | 8 +- libstdc++-v3/include/Makefile.am | 6 + libstdc++-v3/include/Makefile.in | 12 +- libstdc++-v3/include/bits/c++config | 41 +- libstdc++-v3/include/bits/locale_classes.h | 4 + libstdc++-v3/include/bits/locale_facets.h | 43 +- libstdc++-v3/include/bits/locale_facets.tcc | 27 + libstdc++-v3/include/bits/locale_facets_nonio.h | 24 +- libstdc++-v3/include/bits/locale_facets_nonio.tcc | 61 +- libstdc++-v3/include/bits/semaphore_base.h | 2 +- libstdc++-v3/include/bits/std_thread.h | 12 + libstdc++-v3/include/experimental/random | 4 +- libstdc++-v3/include/experimental/source_location | 4 +- libstdc++-v3/include/experimental/utility | 4 +- libstdc++-v3/include/ext/numeric_traits.h | 32 + libstdc++-v3/include/ext/throw_allocator.h | 16 + libstdc++-v3/include/std/thread | 12 - libstdc++-v3/include/std/utility | 16 +- libstdc++-v3/libsupc++/Makefile.in | 6 +- libstdc++-v3/po/Makefile.in | 6 +- libstdc++-v3/python/Makefile.in | 6 +- libstdc++-v3/src/Makefile.am | 47 +- libstdc++-v3/src/Makefile.in | 57 +- libstdc++-v3/src/c++11/Makefile.in | 6 +- .../src/c++11/compatibility-ldbl-alt128-cxx11.cc | 102 + .../src/c++11/compatibility-ldbl-alt128.cc | 244 + .../src/c++11/compatibility-ldbl-facets-aliases.h | 128 + libstdc++-v3/src/c++11/cow-locale_init.cc | 1 + libstdc++-v3/src/c++11/cxx11-locale-inst.cc | 6 +- libstdc++-v3/src/c++11/cxx11-wlocale-inst.cc | 8 +- libstdc++-v3/src/c++11/locale-inst-monetary.h | 69 + libstdc++-v3/src/c++11/locale-inst-numeric.h | 133 + libstdc++-v3/src/c++11/locale-inst.cc | 200 +- libstdc++-v3/src/c++11/mutex.cc | 3 +- libstdc++-v3/src/c++11/wlocale-inst.cc | 45 +- libstdc++-v3/src/c++17/Makefile.am | 7 + libstdc++-v3/src/c++17/Makefile.in | 11 +- libstdc++-v3/src/c++17/floating_from_chars.cc | 38 +- libstdc++-v3/src/c++20/Makefile.in | 6 +- libstdc++-v3/src/c++98/Makefile.in | 6 +- libstdc++-v3/src/c++98/locale_init.cc | 17 +- libstdc++-v3/src/c++98/localename.cc | 16 +- libstdc++-v3/src/filesystem/Makefile.in | 6 +- .../19_diagnostics/headers/system_error/93151.cc | 23 + .../headers/system_error/errc_std_c++0x.cc | 32 +- .../testsuite/26_numerics/complex/abi_tag.cc | 4 +- libstdc++-v3/testsuite/Makefile.in | 6 +- .../testsuite/experimental/feat-lib-fund.cc | 93 +- libstdc++-v3/testsuite/lib/libstdc++.exp | 2 +- .../performance/29_atomics/atomic_flag.cc | 71 + libstdc++-v3/testsuite/util/testsuite_abi.cc | 20 +- maintainer-scripts/ChangeLog | 5 + maintainer-scripts/update_version_git | 19 +- 1285 files changed, 47162 insertions(+), 16880 deletions(-) diff --cc ChangeLog.modules index 5389f5900cf,00000000000..1a60860c81f mode 100644,000000..100644 --- a/ChangeLog.modules +++ b/ChangeLog.modules @@@ -1,17824 -1,0 +1,8079 @@@ ++2020-12-18 Nathan Sidwell ++ ++ Merge trunk 35b8d268746 ++ +2020-12-15 Nathan Sidwell + + Merge trunk 433703843b3 + + Merge trunk 0feb237657c + +2020-12-14 Nathan Sidwell + + gcc/ + * diagnostic-core.h (progname): Remove comment. + + Merge trunk 62c5ea52288 + preprocessor: Deferred macro support + + Named pipe support + gcc/cp + * mapper-client.cc (module_client::open_module): Allow named pipes. + gcc/ + * doc/invoke.texi (C++ Module Mapper): Document. + + libcpp/ + * include/cpplib.h (struct cpp_macro): Rename imported field. + (struct cpp_hashnode): Update deferred doc. + * macro.c (_cpp_new_macro): Adjust. + (cpp_get_deferred_macro, get_deferred_or_lazy_macro): Assert more. + gcc/cp/ + * module.cc (module_state::read_define): Adjust. + (module_state::install_macros): Likewise. + +2020-12-11 Nathan Sidwell + + Merge trunk 9324f7a25c7 + c++: Avoid considering some conversion ops + + gcc/cp/ + * decl2.c (c_parse_final_cleanups): Refactor. + + Merge trunk 1c6b86b50d4 + c++: module test harness + +2020-12-10 Nathan Sidwell + + Merge trunk e6e4b20de33 + c++: name lookup API for modules + + Merge trunk 4f1d8bd5096 + c++: modules & using-decls + + Merge trunk afc14c8d0a9 + c++: modularize spelling suggestions + +2020-12-09 Nathan Sidwell + + gcc/cp/ + * name-lookup.c (member_vec_dedup): Remove gratuitous chaining. + (check_local_shadow): No need to check for clone. + + Merge trunk e4c3ec980fa + c++: Module-specific error and tree dumping + + gcc/cp/ + * module.cc (maybe_attach_decl): Use modules_p. + (module_preprocess_options): Likewise. + * pt.c (lookup_template_class_1) + (instantiate_template_specializations): Likewise. + * parser.c (cp_lexer_new_main): Rename confusing variable. + + Merge trunk cf97b970fe5 + c++: Decl module-specific semantic processing + +2020-12-08 Nathan Sidwell + + Merge trunk 570c312c03e + c++: Originating and instantiating module + + Merge trunk dded5f78ccb + c++: template and clone fns for modules + + Merge trunk 0bd4fecbea3 + c++: Fix MODULE_VERSION breakage + +2020-12-07 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (comparing_typenames): Replace with ... + (map_context_from, map_context_to): ... this. + * typeck.c (structural_comptypes): Adjust. + * pt.c (comparing_typenames): Delete. + (spec_hasher::equal): Adjust. + * tree.c (cp_tree_equal): Check map_context_from & to for failed + parameter context. + * module.cc (map_context_from, map_context_to): Define. + (check_mergeable_decl): Set & unset map_context vars. + (trees_in::is_matching_decl): Likewise. + (module_state::read_cluster): Set & unset + comparing_specializations, not comparing_typenames. + + Merge trunk ffb268ffcf9 + c++: Adjust array type construction + +2020-12-04 Nathan Sidwell + + Merge trunk 5a26d4a204c + c++: Revert dependent-array changes + + Merge trunk 97eaf8c92f9 + c++: Module API declarations + +2020-12-03 Nathan Sidwell + + Merge trunk 62fb1b9e0da + c++: Fix array type dependency [PR 98107] + + c++tools/ + * configure.ac: Need ACX_NONCANONICAL_TARGET + * configure: Rebuilt. + + c++tools/ + * Makefile.in (libexecdir): Fix typo. + +2020-12-02 Nathan Sidwell + + gcc/ + * doc/invoke.texi (C++ Modules): Add CMI section. + + gcc/cp/ + * cp-tree.h (DECL_MODULE_PURVIEW_P, DECL_MODULE_IMPORT_P) + (DECL_MODULE_ENTITY_P): New. + (DECL_MODULE_PENDING_SPECIALIZATIONS_P): New. + (DECL_MODULE_PENDING_MEMBERS_P): New. + (DECL_MODULE_ATTACHMENTS_P): New. + (DECL_MODULE_EXPORT_P): New. + (struct lang_decl_base): Shrink sel field. Add new + module-specific fields. + + gcc/cp/ + * cp-tree.h (DECL_MODULE_PENDING_SPECIALIZATIONS_P) + (DECL_MODULE_PENDING_MEMBERS_P): Use same module_pending_p field. + (DECL_ATTACHED_DECLS_P): Rename to ... + (DECL_MODULE_ATTACHEMENTS_P): ... this. Use module_pending_p + field. + (struct lang_decl_base): Replace module_pending_specializations_p, + module_pending_members_p, attached_decls_p fields with single + module_pending_p field. + * module.cc (trees_{in,out}::lang_decl_bools): Only stream + module_pending_p for vars & fns. + (trees_{in,out}::decl_value): Adjust DECL_MODULE_ATTACHMENTS_P + changes. + (trees_out::get_merge_kind): Likewise. + (trees_in::key_mergeable, maybe_attach_decl): Likewise. + * lex.c (cxx_dup_lang_specific_decl): Directly clear some module flags. + + Merge trunk 05f7a2afe8f + C++ Module Binding Vector + + Merge trunk 41676a36a04 + C++ Module keywords + + gcc/cp/ + * name-lookup.h: Rename MODULE_VECTOR and associated structs & + macros to BINDING_VECTOR. + * cp-tree.h: Adjust. + * cp-tree.def: Adjust. + * decl.c: Adjust. + * module.cc: Adjust. + * name-lookup.c: Adjust. + * ptree.c: Adjust. + * decl.c: Adjust. + + gcc/cp/ + * cp-tree.h (struct tree_module_vec): Move to ... + * name-lookup.h (struct tree_module_vec): ... here. + + gcc/cp/ + * lex.c (struct token_coro): Rename to ... + (struct module_token_filter): ... here. Adjust through out. + +2020-12-01 Nathan Sidwell + + libcody/ + Update from upstream, removing deprecated functions. + + Merge trunk 855bb43f6d0 + + Merge trunk eae68c434f2 + testsuite: Adjust pruning + + Merge trunk 83a1beee276 + libstdc++: Add C++2a synchronization support + + gcc/cp/ + * module.cc (trees_{in,out}::decl_container): Stream template as + well as container. Do not strip (no nudity!) + gcc/testsuite/ + * g++.dg/modules/noexcept-1{.h,_[ab].[HC]}: New. + +2020-11-30 Nathan Sidwell + + gcc/ + * doc/invoke.texi: Updates from review. + +2020-11-24 Nathan Sidwell + + Merge trunk 89d9c634dc5 + +2020-11-23 Nathan Sidwell + + gcc/cp/ + * Make-lang.in: Don't depend VERSION on src dir. + * module.cc: Note some potential issues. + + gcc/ + * doc/invoke.texi (-flang-include-translate-not): Document. + gcc/cp/ + * module.cc (maybe_translate_include): Add not-translate noting. + gcc/c-family/ + * c.opt (flang-include-translate-not): New. + + libcody/ + Update from upstream, INCLUDE_TRANSLATE response meaning change + +2020-11-20 Nathan Sidwell + + gcc/ + * doc/invoke.texi: Fixes. + + libcody/ + Update from upstream. + + gcc/ + * doc/invoke.texi: Update + * doc/cppopts.texi: Update + + gcc/cp/ + * cp-tree.h (match_mergeable_specialization): Take a spec_entry. + * pt.c (match_mergeable_specialization): Likewise. + * module.cc (trees_in::decl_value): Adjust. + (trees_{in,out}::key_mergeable): Adjust. + (specialization_add): Adjust. + + gcc/ + * doc/invoke.texi: Update + * doc/cppopts.texi: Update + + Merge trunk 5bba2215c23 + c++: Template hash access ( + + Merge trunk bf425849f1d + preprocessor: main-file cleanup + +2020-11-18 Nathan Sidwell + + gcc/cp/ + * cp-lang.c (LANG_HOOKS_PREPROCESS_UNDEF): Do not override here. + * cp-tree.h (module_cpp_undef): Do not declare. + * module.cc (module_cpp_undef): Delete. + (handle_module_option): Store cpp_main_search code in flag_header_unit. + (module_preprocess_options): Set main_search option here. + Conditionally set preprocess_undef lang hook here. + + libcpp/ + * include/cpplib.h (enum cpp_main_search): Add CMS_header value. + * internal.h (cpp_in_system_header): Rename to ... + (_cpp_in_system_header): ... here. + (cpp_in_primary_file): Rename to ... + (_cpp_in_main_source_file): ... here. Compare main_file equality + and check main_search value. + * lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust. + * macro.c (_cpp_builtin_macro_text): Adjust. + (replace_args): Likewise. + * directives.c (do_include_next): Adjust. + (do_pragma_once, do_pragma_system_header): Likewise. + * files.c (struct _cpp_file): Delete main_file field. + (pch_open): Check pfile->main_file equality. + (make_cpp_file): Drop cpp_reader parm, don't set main_file. + (_cpp_find_file): Adjust. + (_cpp_stack_file): Check pfile->main_file equality. Drop + main_file clearing. + (struct report_missing_guard_data): Add cpp_reader field. + (report_missing_guard): Check pfile->main_file equality. + (_cpp_report_missing_guards): Adjust. + + Merge trunk 92648faa1cb + 08-cpp-mkdeps.diff + 05-cpp-files.diff + 04a-cpp-lexer.diff + 32-aix-fixincl.diff + + Merge trunk d3ae802402b + 01-langhooks.diff + 02-cpp-line-maps.diff + 03-cpp-callbacks.diff + 19-global-trees.diff + 21a-int-cst.diff + +2020-11-16 Nathan Sidwell + + Adjust lang hooks + gcc/c-family/ + * c-opts.c (c_common_init): Drop preprocess_undef + gcc/cp/ + * cp-lang.c (LANG_HOOKS_PREPROCESS_DEFERRED_MACRO): Delete. + * cp-tree.h (module_cpp_deferred_macro): Do not declare. + * module.cc (module_cpp_deferred_macro): Delete. + (module_preprocess_options): Set deferred macro and undef + callbacks here. + gcc/ + * langhooks-def.h (LANG_HOOKS_PREPROCESS_UNDEF): Delete. + * langhooks.h (struct lang_hooks): Delete + preprocess_deferred_macro. + + Constrained partial variable templates + gcc/cp/ + * module.cc (trees_{in,out}::key_mergeable): Variable templates + can be partially specialized and constrained. + (finish_module_processing): Point at module decl, so ICEs blame + that. + gcc/testsuite/ + * g++.dg/modules/var-tpl-concept-1{.h,_[ab].C}: New. + + Merge trunk 63496cbea58 + + using enum support + gcc/cp/ + * module.cc (trees_out::mark_class_def): Mark cloned enum consts + gcc/testsuite/ + * g++.dd/modules/using-enum-1_[ab].[HC]: New. + +2020-11-13 Nathan Sidwell + + Merge trunk d50310408f5 + c++: Implement C++20 'using enum'. + + Merge trunk e3b3b59683c + + Fix libiberty linking + * g++tools/Makefile.in (LIBIBERTY): New. + + Merge trunk 5fa821bba73 + +2020-11-12 Nathan Sidwell + + Merge trunk 7f851c33411 + libstdc++: Fix __numeric_traits_integer<__int20> [PR 97798] + + Enum dedup ODR check fix + gcc/cp/ + * tree.c (cp_tree_equal): Allow NON_LVALUE_EXPR & + VIEW_CONVERT_EXPR with NULL types. + gcc/testsuite/ + * g++.dg/modules/loc-wrapper-1{.h,_a.H,_b.C}: New. + + * Makefile.def: Fix g++ check implications. + * Makefile.in: Rebuilt. + gcc/ + * config.in: Rebuilt. + * configure: Rebuilt. + * configure.ac: Remove unneeded checks + gcc/cp/ + + Merge trunk 3c3beb1a813 + +2020-11-11 Nathan Sidwell + + c++tools/ + * resolver.h (module_resolver): Update to new API. + * resolver.cc (module_resolver): Likewise. + +2020-11-10 Nathan Sidwell + + Adjust c++tools + * Makefile.def (c++tools): Depends on gcc + * Makefile.in: Rebuilt + c++tools/ + * mapper.h: Rename to ... + * resolver.h: ... here. Move mapper-client to + gcc/cp/mapper-client.h + * resolver.cc: Adjust. + * configure.ac: Fix extraneous ] + * configure: Rebuilt. + gcc/cp/ + * mapper-client.h: New, split from c++tools/mapper.h. + * mapper-client.cc: Adjust. + * mapper-resolver.cc: Adjust. + * module.cc: Adjust. + + c++tools/ + * mapper.h (class mapper_client): Add flag support. + gcc/cp/ + * mapper-client: Likewise. + * module.cc (maybe_translate_include): Likewise. + (preprocessed_module): Likewise. + + libcody/ + Rebase on upstream -- $flag support. + + Create c++tools dir + * Makefile.def: Add c++tools + * Makefile.tpl: Likewise. + * configure.ac: Likewise. + * Makefile.in: Regenerated. + * configure: Regenerated. + c++tools/ + * Makefile.in: New. + * configure.ac: New. + * config.h.in: Generated + * configure: Generated + * mapper.h: Moved from gcc/cp. + * resolver.cc: Moved from gcc/cp/mapper-resolver.cc + * server.cc: Moved from gcc/cp/mapper-server.cc + gcc/ + * configure.ac: Remove mapper-server-specific checks + * config.in: Rebuilt. + * configure: Rebuilt. + gcc/cp/ + * Make-lang.in: Remove mapper-server. + * mapper-client.cc: Adjusted. + * mapper-resolver.cc: Moved to c++tools/resolver.cc, replaced with + stub here. + * mapper.h: Moved to c++tools, replaced with stub here. + * module.cc: Adjust. + gcc/testsuite/ + * g++.dg/modules/extern-tpl-1_b.C: Adjust invocation. + * g++.dg/modules/inc-xlate-1_e.C: Likewise. + * g++.dg/modules/legacy-2_b.H: Likewise. + * g++.dg/modules/legacy-6_c.C: Likewise. + * g++.dg/modules/legacy-6_d.C: Likewise. + +2020-11-09 Nathan Sidwell + + Merge trunk e38cd64ac6c + c++: ADL refactor + + Address review comments + libcpp/ + * lex.c (cpp_maybe_module_directive): Add asserts and comments + about initial and final state. Remove __builtin_expects. + (_cpp_lex_token): Remove __builtin_expect. + +2020-11-06 Nathan Sidwell + + Merge trunk 4b5f564a5d9 + libcpp: Provide date routine + + gcc/ + * tree.c (cache_integer_cst): Document API. + + gcc/cp/ + * Make-lang.in: Drop git hash collection. + gcc/ + * REVISION: New. + + gcc/cp/ + * parser.c (cp_parser_diagnose_invalid_type_name): Revert local + changes. + + libcpp/ + * include/cpplib.h (enum CPP_time_kind): New. + (cpp_get_date): Declare. + * internal.h (struct cpp_reader): Replace source_date_epoch with + time_stamp and time_stamp_kind. + * init.c (cpp_create_reader): Initialize them. + * macro.c (_cpp_builtin_macro_text): Use cpp_get_date. + (cpp_get_date): Broken out from _cpp_builtin_macro_text and + genericize. + gcc/cp/ + * module.cc (module_state_write_readme): Use new libcpp API. + +2020-11-05 Nathan Sidwell + + gcc/cp/ + * module.cc (module_state::write_Readme): Add cpp_reader parm, use + cb_get_source_date_epoch to see if the time is locked. + + gcc/cp/ + * module.cc (enum merge_kind): Minor remapping. + (merge_kind_name): Adjust. + + gcc/cp/ + * module.cc (depset::fini_partial_redirect): Delete. + (depset::hash::add_partial_redirect): Delete. + (depset::hash::init_partial_redirect): Delete. + (enum merge_kind): Delete MK_tmpl_partial_mask, + MK_type_partial_spec. + (trees_out::get_merge_kind): Adjust. + (trees_{in,out}::key_mergeable): Delete tmpl_partial case. + (depset::hash::make_dependency): Directly create the redirect here. + (depset::hash::add_specializations): Do not detect partial + specializations here. + + gcc/cp/ + * module.cc (enum depset::entity_kind): Add EK_PARTIAL, + EK_DIRECT_HWM. + (enum depset::disc_bits): Delete DB_PARTIAL_BIT. + (depset::is_partial): Delete. + (depset::fini_partial_redirect): Assert EK_PARTIAL. + (depset::entity_kind_name): Add EK_PARTIAL. + (trees_out::decl_node): Adjust redirect asserts. + (trees_out::get_merge_kind): No partial template. + (depset::hash::make_dependency): Partials create EK_PARTIAL. + (depset::hash::add_partial_entities): Adjust, + (depset::hash::add_specializations): Adjust. + (depset::hash::add_mergeable): Adjust. + (sort_cluster, module_state::write_cluster): Likewise. + (module_state::write_{entities,pendings}): Adjust. + gcc/testsuite/ + * g++.dg/modules/tpl-spec-5_a.C: Adjust scan. + + gcc/cp/ + * module.cc (depset::hash::add_partial_redirect): Break out + helpers ... + (depset::fini_partial_redirect): ... this and ... + (depset::hash::init_partial_redirect): ... this. Call them. + (partial_specializations): New vector. + (depset::hash::make_dependency): Deal with partial + specializations. + (depset::hash::add_partial_entities): New. + (deset::hash::add_specializations): We may have added a partial. + (module_state::write_cluster): Count partials. + (module_state::write_pendings): Likewise. + (module_state::write): Add partials. + (set_defining_module): Append explicit specializations. + gcc/testsuite/ + * g++.dg/modules/constrained-partial-1_[ab].C: New. + + gcc/cp/ + * mapper-client.cc (spawn_mapper_program): Use @ to indicate + looking in install dir. + gcc/ + * doc/invoke.texi (fmodule-mapper): Document behaviour. + gcc/testsuite/ + * g++.dg/modules/extern-tpl-1_b.C: Adjust options. + * g++.dg/modules/inc-xlate-1_e.C: Adjust options. + * g++.dg/modules/legacy-2_b.H: Adjust options. + * g++.dg/modules/legacy-6_[cdef].C: Adjust options. + +2020-11-04 Nathan Sidwell + + gcc/testsuite/ + * g++.dg/modules/builtin-3_[ab].C: Adjust for i686 + + gcc/cp/ + * mapper-resolved.cc: define INCLUDE_ALGORITHM. + +2020-11-03 Nathan Sidwell + + Merge trunk a52bf016433 + c++: using-decl instantiation + + Cleanup unnecessary or stale changes. + gcc/cp/ + * class.c (clone_cdtor): Fix erroneous comment. + * decl.c (finish_enum_value_list): Revert local change. + gcc/ + * doc/cppopts.texi (EE): Delete stale info. + libcpp. + * files.c (cpp_main_controlling_macro): Delete. + * include/cpplibc.h (cpp_main_controlling_macro): Delete. + * mkdeps.c: Rename bmi->cmi + + Merge trunk 444655b6f02 + c++: cp_tree_equal cleanups + +2020-11-02 Nathan Sidwell + + libcpp/ + * include/cpplib.h (cpp_enable_filename_token): Delete. + * macro.c (cpp_enable_filename_token): Delete. + + Merge trunk b2a31e2c341 + + gcc/cp/ + * module.cc (module_state::write_elf): Remove obsolete FIXME. + +2020-10-30 Nathan Sidwell + + Add DECL_ACCESS support + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Stream using_decl decls. + (trees_out::lang_decl_vals): Do not stream DECL_ACCESS that is + actually an access alterer. + (trees_in::read_class_def): Reconstruct DECL_ACCESS. + gcc/testsuite/ + * g++.dg/modules/access-1_[abc].C: New. + + gcc/cp/ + * module.cc: Address more FIXMES. + + gcc/cp/ + * cp-tree.h (maybe_check_all_macros): Declare. + * module.cc (slurping::release_macros): New. + (slurping::~slurping): Use it. + (module_state::maybe_completed_reading): Use it. + (maybe_check_all_macros): New, broken out of ... + (finish_module_processing): ... here. DO NOT CALL. + * parser.c (cp_lexer_new_main): Call it here. + + Cache Path Of Instantiation + gcc/cp/ + * cp-tree.h (struct tinst_level): Add path and visible bitmaps. + * module.cc (path_of_instantiation): New recursive helper broken + out of ... + (module_visible_instantiation): ... here. Call it. + * pt.c (push_tinst_level_loc): Nullify path and visible bitmaps. + +2020-10-29 Nathan Sidwell + + gcc/cp/ + * module.cc: Address a bunch of FIXMEs. + + Prague anon-enum keying by underlying type + gcc/cp/ + * module.cc (trees_{in,out}::key_mergeable): Stream MK_enum + underlying type decl. + (check_mergeable_decl): The enum itself is on the ovl list. + * name-lookup.c (init_global_partition): Copy the enum for the + first member of an anonymous enum. + gcc/testsuite/ + * g++.dg/modules/enum-8_[abcd].[CH]: New. + + gcc/cp/ + * module.cc (trees_out::get_merge_kind): Resolve FIXMEs. + (trees_out::key_mergeable): Likewise. + + gcc/cp/ + * module.cc (trees_out::get_merge_kind): Only function-scope + entities we meet are implicit TYPE_DECLs. + + Merge trunk 9703b8d98c1 + c++: Stop (most) function-scope entities having a template header + + Merge trunk bafcf452c79 + opts: Sanity check for param names. + gcc/ + * params.opt: Fixup lazy-load parm name. + gcc/testsuite/ + * g++.dg/modules/freeze-1_d.C: Adjust. + * g++.dg/modules/nest-1_c.C: Adjust. + + Merge trunk 53dede0f04b + CSE conversions within sincos [Alexandre Oliva] + +2020-10-28 Nathan Sidwell + + Merge trunk 4289e488ddd + c++: Make OMP UDR DECL_LOCAL_DECL_P earlier + + Merge trunk 7d5f38e49e5 + c++: Refactor push_template_decl + + gcc/cp/ + * module.cc: More FIXME addressing. + (trees_out::get_merge_kind): Assert function-scope entities are + not unexpected. + + gcc/cp/ + * module.cc: More FIXME fixing. + + gcc/cp/ + * lang-specs.h: Fix -xc++-{,user-,system-}header. + +2020-10-27 Nathan Sidwell + + No special anon-namespace naming + gcc/cp/ + * name-lookup.h (add_imported_namespace): Drop anon name parm. + * name-lookup.c (anon_name): Delete. + (make_namespace): Nothing special for anonymous namespace. + (add_imported_namespace): Likewise. + * module.cc (module_state::{read,write}_namespaces): Anon + namepspace does not need naming. + + gcc/testsuite/ + * g++.dg/modules/xtreme-tr1{.h,_a.H,_b.C}: New. + + gcc/cp/ + * module.cc (trees_out::vec_chained_decls): Detect anonymous + struct with typedef name. + (trees_{in,out}::add_indirect): Assert TYPE_DECL is typedef or + type's TYPE_NAME. + (trees_{in,out}::{read,write}_class_def): Cope with anon-structs + with typedef names. + gcc/testsuite/ + * g++.dg/modules/tdef-8_[ab].C: New. + + gcc/cp/ + * module.cc (depset_cmp): Decide strcmp question. + (module_state::write_prepare_maps): Document pruning question. + + gcc/cp/ + * module.cc (trees_{in,out}::{read,write}_class_def): Remove + nested udt FIXMEs. They are no longer a thing. + + Merge trunk 54380d42e6f + c++: Kill nested_udts + +2020-10-26 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_{in,out{::type_node): Stream attribs. + + gcc/cp/ + * module.cc (trees_out::type_node): Stream alignment. + (trees_in::type_node): Alignment is a log. + gcc/testsuite/ + * g++.dg/modules/align-type-1_[ab].C: New. + + gcc/cp/ + * module.cc (trees_{in,out}::tree_list): Address more Fixmes, + either by obsoleting them, or coding around their confusion. + + libcody/ + Rebase on upstream, robustify enable-checking. + + gcc/cp/ + * module.cc (trees_{in,out}::tree_list): New streamers. + (trees_{in,out}::{read,write}_class_def): Use them. + + gcc/cp/ + * module.cc: Remove or clarify more now-obsolete FIXMEs. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Document + middle-endy/debugy BLOCK fields. Document OPTIMIZATION_NODE & + TARGET_OPTION_NODE issue. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): RESULT_DECL is like PARM_DECL. + + libcody/ + Rebase on upstream, fix enable-checking & bootstrap + + gcc/cp/ + * module.cc (trees_in::chained_decls): Chain should always be null. + + libcody/ + Rebase on upstream, collect new autoconf bits. + +2020-10-23 Nathan Sidwell + + gcc/cp/ + * module.cc: Address 3 now-irrelevant FIXMES. + + gcc/cp/ + * module.cc (enum merge_kind): Reorder. + (merge_kind_name): Likewise. + + Merge trunk cd8b7d7b24c + Link with the configured net lib on vxworks7 + + Merge trunk e957b86ca26 + libstdc++: Rebase include/pstl to current upstream + gcc/testsuite/ + PR 97549 workaround + * g++.dg/modules/xtream-header{,-2}.h: Don't include . + + Merge trunk 310fe80babe + Fortran: class.c - update vtable comment + + gcc/cp/ + * mapper-server.cc: Disable networking when not available. + +2020-10-22 Nathan Sidwell + + libcody/ 9e71a7c Avoid fstatat when unavailable + gcc/ + * configure.ac: Check for fstatat & O_CLOEXEC. + * configure: Regenerated. + * config.in: Regenerated. + gcc/cp/ + * mapper-resolver.cc: Include config.h, system.h. Cope with lack + of fstatat. + * module.cc: Workaround lack of O_CLOEXEC. + + Block-scope structures, like wow, why worked so far? + gcc/cp/ + * module.cc (trees_{in,out}::decl_value): Stream local struct + definitions. + gcc/testsuite/ + * g++.dg/modules/local-struct-1_[ab].C: New. + + gcc/cp/ + * module.cc (trees_in::is_matching_decl): Add builtin data + copying. + (trees_in::read_function_def): Recontextualize parms. + * decl.c (duplicate_decls): Refactor builtin copying. + gcc/testsuite/ + * g++.dg/modules/builtin-7_[ab].[HC]: New. + + libcody/ + * fatal.cc: noexcept fix from Iain Sandoe. + + gcc/cp/ + * gcc/cp/decl.c (duplicate_decls_): Return error_mark_node for + extern "C" collision. + * gcc/cp/module.cc (check_mergeable_decl): Check extern "C"-ness. + (trees_in::is_matching_decl): Check extern "C" builtin mismatch. + Propagate flags on smashing a builtin. + gcc/testsuite/ + * g++.dg/modules/builtin-6_[ab].[HC]: New. + + gcc/cp/ + * mapper-client.cc: Enable networking only when CODY_NETWORKING + * mapper-server.cc: Likewise. + libcody/ + Rebase b26a54f | Enable networking only on known-good systems + +2020-10-21 Nathan Sidwell + + * Makefile.def: Don't build libcody for build. Do not install it + either. + * Makefile.in: Rebuilt. + + gcc/testsuite/ + * g++.dg/modules/builtin-3_[ab].C: Scans for darwin, thanks Iain + + AIX fixinclude + fixincludes/ + * inclhack.def (aix_physadr_t): New. + * fixincl.x: Regenerated. + + Vector bools + gcc/cp/ + * module.cc (trees_{in,out}::type_node): Deal with non-standard bools. + gcc/testsuite/ + * g++.dg/modules/bool-1{,_[abc]}.[CHh]: New. + + AIX test fix + gcc/testsuite/ + * g++.dg/modules/literals-1_[ab].C: Add -Wno-psabi + +2020-10-20 Nathan Sidwell + + gcc/ + * Makefile.in (INCLUDES): Add $(CODYINC). + + gcc/cp/ + * Make-lang.in (GIT_INFO): Support stricter seds. + + Local-extern fix + gcc/cp + * name-lookup.c (push_local_extern_decl_alias): Fix default arg bug. + + Local-extern fix + gcc/cp + * name-lookup.c (push_local_extern_decl_alias): Recontextualize + alias' parms, drop any default args. + gcc/testsuite/ + * g++.dg/modules/local-extern-2.H: New. + + Libcody by value + * Makefile.def: Add libcody as a component library. + * Makefile.in: Change libcody from an external library to a + component. + * Makfile.tpl: Likewise. + * configure.ac: Likewise. + * configure: Regenerated. + gcc/ + * Makefile.in: Likewise. + * configure.ac: Likewise. + * configure: Regenerated. + + * libcody/: Import by value. + + gcc/cp/ + * module.cc (elf_in::begin): Fix madvise on AIX. + +2020-10-19 Nathan Sidwell + + gcc/cp/ + * module.cc: Add testing for non-mmapped access. + (elf_out::grow): Assert aligned at start. + (elf_out::write): Align afterwards. + + gcc/testsuite/ + * g++.dg/modules/sym-subst-3_a.C: Some assemblers say .global. + + gcc/cp/ + * module.cc (module_state::write_macro_locs): Macro loc count is a + count. + (module_state::read_prepare_maps): Adjust. + gcc/testsuite/ + * g++.dg/modules/macloc-2_[ab].[HC]: New. + +2020-10-16 Nathan Sidwell + + Merge trunk ccb4f20cbee + + gcc/cp/ + * name-lookup.c (do_nonmember_using_decl): Fix duplication case. + +2020-10-14 Nathan Sidwell + + gcc/cp/ + * name-lookup.h (enum WMB_Flags): New. + (walk_module_binding): Adjust. + * name-lookup.c (walk_module_binding): Replace callbacks, bool + args by single flags arg. + * module.cc (depset::hash::add_binding): Replace bool args by + flags. + + gcc/cp/ + * module.cc (trees_out::core_bools): Adjust initialized var + handling. + (has_definition): Likewise. + (trees_{in,out}::{read,write}_var_def): Likewise. + (module_state::{read,write}_inits): Just stream the decls. + gcc/testsuite/ + * g++.dg/modules/hdr-init-1_[abc].[HC]: New. + + gcc/cp/ + * module.cc (depset::hash::finalize_dependencies): Remove + pre-p2003 kludge. + + p2003 internal linkage & header units + gcc/cp/ + * name-lookup.c (get_fixed_binding_slot): Promote internal GM + entities to global slot. + * module.cc (has_definition): Add internal linkage fns/vars in GM. + (depset::hash::make_dependency): Internal linkage in GM is ok. + + gcc/cp/ + * pt.c (lookup_template_class_1): Delete erroneous fixme. + (tsubst_template_decl): Delete questioning fixme, problem, if any, + is on trunk. + (get_mergeable_specialization_flags): Optimize specialization scan. + + Merge trunk 068644a1497 + c++: DECL_FRIEND_P cleanup + + Merge trunk 06bec55e80d + + gcc/cp/ + * decl.c (duplicate_decls): Remove obsolete FIXME. + * pt.c (push_template_decl): Remove about-to-be obsolete FIXME. + + gcc/cp/ + * decl.c (xref_tag_1): Refactor module handling. Push imported + decl into TU's slot + * name-lookup.c (lookup_elaborated_type_1): Fixme fixed. + * module.cc (set_instantiating_module): Accept template_decls. + gcc/testsuite/ + * g++.dg/modules/part-7_[abc].C: New. + * g++.dg/modules/hdr-1_[abc].[HC]: New. + +2020-10-09 Nathan Sidwell + + libcpp/ + * lex.c (do_peek_module): Update plan for unicode. + + gcc/cp/ + * decl.c (grokmethod): Remove comment about -fmodule-implicit-inline. + + Block-scope externs disallowed + gcc/cp/ + * decl.c (start_decl): Reject block-scope extern in module + purview. + gcc/testsuite/ + * g++.dg/modules/local-extern-1.C: New. + + Remove unused code + gcc/cp/ + * friend.c (add_friend): Remove #if'd out code + + Cleanup name-lookup interface + gcc/cp/ + * name-lookup.h (get_field_ident, lookup_field_ident): Don't + declare. + (mergeable_class_entities): Rename to ... + (lookup_class_binding): ... here. + * name-lookup.c (mergeable_class_entities): Rename to ... + (lookup_class_binding): ... here. + (get_field_ident, lookup_field_ident): Move to module.cc + * module.cc (get_field_ident, lookup_field_ident): Moved here. + Only deal with anon fields. + (trees_{in,out}::tree_node): Adjust. + (trees_in::key_mergeable): Adjust. + + Remove unneeded decls + gcc/cp/ + * name-lookup.c (lookup_class_member, void set_class_bindings) + (tree lookup_all_conversions): Delete unused decls. + (insert_late_enum_def_bindings): Delete duplicate decl. + + Clean up mangling documentation + gcc/cp/ + * mangle.c (write_module): Update grammar description. + * module.cc (module_state::mangle): Clarify why partitions might + be significant. + + Clean up some c-family pieces + gcc/ + * langhooks.h (struct lang_hooks): Replace + preprocess_translate_include with preprocess_options. + * langhooks-def.h: Replace LANG_HOOKS_PREPROCESS_INCLUDE_TRANSLATE + with LANG_HOOKS_PREPROCESS_OPTIONS. + gcc/c-family/ + * c-cppbuiltins.c (c_cpp_builtins): Comment __cpp_modules. + * c-opts.c (c_common_post_options): Replace include_translate hook + with more general preprocess_options hook. + gcc/cp/ + * cp-lang.c: Replace LANG_HOOKS_PREPROCESS_TRANSLATE_INCLUDE with + LANG_HOOKS_PREPROCESS_OPTIONS. + * cp-tree.h (module_translate_include): Don't declare. + (module_preprocess_options): Declare. + * module.cc (module_translate_include): Rename to .. + (maybe_translate_include): ... here. Make static. + (module_preprocess_options): New. + +2020-10-08 Nathan Sidwell + + Merge trunk d1c566d72d9 + + Undeclared builtin merging + gcc/cp/ + * module.cc (trees_in::is_matching_decl): Merge into undeclared + builtin. + * name-lookup.cc (check_module_override): Rename is_friend parm. + (do_pushdecl): Ignore hidden imports. + gcc/testsuite/ + * g++.dg/modules/builtin-5_[ab].[HC]: New. + +2020-10-07 Nathan Sidwell + + Streamed classes always have a member vector. + gcc/cp/ + * module.cc (trees_out::decl_value): Assert no pmfs. + (trees_in::decl_value): Ensure existing duplicate class has member + vector. + (tree_out::write_class_def): Ensure there's a method vector. + * name-lookup.c (set_class_bindings): Extra can be negative, + meaning always. Return the member vector. + (mergeable_class_entities): Simplify. + (lookup_field_ident): Simplify. + + gcc/cp/ + * module.cc (module_state::read_prepare_maps): Only inform of + location shortage once. + + Fix -save-temps & header units + gcc/cp/ + * module.cc (loc_spans::maybe_init): New. + (loc_spans::init): Allow NULL map. + (preprocess_module, preprocessed_module): Call maybe_init. + gcc/libcpp/ + * internal.h (enum include_type): Rename IT_MAIN_INJECT to IT_PRE_MAIN. + * init.c (cpp_read_main): Adjust _cpp_stack_file call. Adjust + first line marker if no preprocessed marker found. + (read_original_filename): Peek characters in buffer, not token. + (read_original_directory): Likewise. + * files.c (_cpp_stack_file): Adjst. + gcc/testsuite/ + * g++.dg/modules/preproc-2_[ab].[HC]: New. + + Merge trunk 4e62aca0e05 + c++: block-scope externs get an alias [PR95677,PR31775,PR95677] + + Merge trunk e089e43365f + + Merge trunk 255aa06d40d + + Merge trunk bf490f06360 + +2020-10-05 Nathan Sidwell + + Pick 255aa06d40d (c++: Make spell corrections consistent) + +2020-10-02 Nathan Sidwell + + Merge trunk 679dbc9dcec + c++: Kill DECL_ANTICIPATED + + Merge trunk 7ee1c0413e2 + c++: Hash table iteration for namespace-member spelling + gcc/cp/ + * name-lookup.c (consider_binding): New, broken out of ... + (consider_binding_level): ... here. Use it, add MODULE_VECTOR + support. + + Merge trunk 9340d1c97b8 + c++: cleanup ctor_omit_inherited_parms + gcc/cp/ + * module.cc (trees_out::decl_value): Adjust for new ctor_omit API. + + Merge trunk 31584824665 + + Merge trunk dfaa24c974b + c++: Kill DECL_HIDDEN_P + + gcc/cp/ + * name-lookup.c (walk_module_binding): Update for new HIDDEN markers. + + Merge trunk c2978b34058 + +2020-10-01 Nathan Sidwell + + Merge trunk c2978b34058 + + Merge trunk 734eed68537 + c++: Kill DECL_HIDDEN_FRIEND_P + + Merge trunk 65167982efa + + Merge trunk 7cbfe0894de + + Merge trunk adcf8a11c77 + + Merge trunk cc61827b55e + +2020-09-30 Nathan Sidwell + + Merge trunk 39a27bb01aa + + Merge trunk c74e6f7cfd7 + + Apply trunk 7cbfe0894de + c++: Hiddenness is a property of the symbol table + + Apply trunk adcf8a11c77 + c++: Name lookup simplifications + + Apply trunk cc61827b55e + c++: Identifier type value should not update binding + + Apply trunk c74e6f7cfd7 + c++: Adjust pushdecl/duplicate_decls API + + gcc/cp/ + * tree.h (ovl_insert): Make usingness unsigned. + * tree.c (ovl_insert): Make usingness unsigned, change semantics. + * name-lookup.c (do_nonmember_using_decl): Adjust ovl_insert call. + + Merge trunk 00aaae03db2 + c++: Replace tag_scope with TAG_how + + Merge trunk 0d8f3f612d6 + +2020-09-24 Nathan Sidwell + + Merge trunk d13c0ae859f + +2020-09-14 Nathan Sidwell + + Merge trunk cd6743e9c41 + + gcc/cp/ + * module.cc (trees_out::get_merge_kind): Add asserts & FIXMEs. + + gcc/cp/ + * pt.c (primary_template_specialization_p): Use + VAR_OR_FUNCTION_DECL_P. + (push_template_decl_real): Likewise. + * module.cc (trees_out::chained_decls): Use + VAR_OR_FUNCTION_DECL_P. + (trees_out::get_merge_kind, trees_in::is_matching_decl) + (depset::hash::make_dependency, depset::hash::add_binding_entity) + (specialization_add): Likewise. + + Merge trunk d106029c2aa + + Merge trunk 10f51543bb8 + libstdc++: Add compile-time checks to__glibcxx_assert [PR 71960] + +2020-09-11 Nathan Sidwell + + Concepts and local externs + gcc/cp/ + * decl.c (grokfndecl): Don't attach to local extern. + gcc/testsuite/ + * concepts/local-extern.C: New. + + Local extern fns do not get template header + gcc/cp/ + * module.cc (trees_out::chained_decls): Also mark local fns for + by-value walking. + (trees_out::decl_node): Assert we don't meet a local var or fn. + (trees_out::get_merge_kind): Local fns are also unique. + * pt.c (push_template_decl_real): Local fns also lack a header. + (tsubst_function_decl): Cope with local fns. + (tsubst_decl): Adjust VAR_DECL tsubsting. + gcc/testsuite/ + * g++.dg/modules/tpl-extern-{var,fn}-1_{a.H,b.C}: New. + +2020-09-09 Nathan Sidwell + + Local extern vars do not get template header + gcc/cp/ + * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Replace with ... + (DECL_DECLARED_CONSTINIT_P): ... here, decl_lang_flag 7. + * decl.c (start_decl): Set DECL_DECLARED_CONSTINIT_P as necessary. + (cp_finish_decl): Likewise. + * pt.c (push_template_decl_real): Don't add a header for + DECL_LOCAL_DECL_P VAR_DECLS. + (tsubst_decl): Check for VAR_DECLS lacking template info are + local. No need to handle TINFO_VAR_DECLARED_CONSTINIT specially. + (tsubst_expr): Likewise. + (instantiate_decl): Likewise. + + DECL_LOCAL_DECL_P + gcc/cp/ + * cp-tree.h (DECL_LOCAL_FUNCTION_P): Rename to ... + (DECL_LOCAL_DECL_P): ... here. Apply to VAR_DECLS too. + * decl.c (start_decl): Set DECL_LOCAL_DECL_P as approriate. + (start_decl_1): Reformat. + (omp_declare_variant_finalize_one): Use DECL_LOCAL_DECL_P. + (local_variable_p): Simplify. + * module.cc (trees_out::chained_decls): Stream DECL_LOCAL_DECL_P + by value. + (trees_out::get_merge_kind): DECL_LOCAL_DECL_P decls are unique. + * name-lookup.c (set_decl_context_in_fn): Assert DECL_LOCAL_DECL_P + as expected, don't set it here. + (do_pushdecl): Don't call it for friends or dependent types. + (is_local_extern): Simplify. + * parser.c (cp_parser_postfix_expression): Use DECL_LOCAL_DECL_P. + (cp_parser_omp_declare_reduction): Set DECL_LOCAL_DECL_P. + Refactor. + * pt.c (check_default_tmpl_args): Use DECL_LOCAL_DECL_P. + (tsubst_expr): Adjust omp reduction case. + (tsubst_omp_udr): Add comments. + (type_dependent_expression_p): Adjust. + * call.c (equal_functions): Adjust. + * semantics.c (finish_call_expr): Adjust. + libcc1/ + * libcp1plugin.cc (plugin_build_call_expr): Use DECL_LOCAL_DECL_P. + +2020-09-08 Nathan Sidwell + + Change cxx_int_tree_map to cxx_decl_tree_map. + gcc/cp/ + * cp-tree.h (struct cxx_int_tree_map): Rename to ... + (struct cxx_decl_tree_map): ... here. + * cp-gimplify.c (cxx_int_tree_map_hasher): Rename to ... + (cxx_decl_tree_map_hasher): ... here. Update member fns + (cp_genericize_r): Adjust extern_decl_map lookup. + * name-lookup.c (set_local_extern_decl_linkage): Adjust + extern_decl_map insertion. + +2020-09-12 Nathan Sidwell + + FLAG DAY! Mapper reponse format change in LibCody + gcc/cp/ + * mapper-client.cc (module_client::open_module_client): Use + Client::PC_PATHNAME. + * mapper-resolver.cc (module_resolver::ModuleRepoRequest): Use + PathnameResponse. + (module_resolver::cmi_response): Likewise. + (module_resolver::IncludeTranslateRequest): Use BoolResponse and + PathnameResponse. + * module.cc (module_state::set_filename): Use Client::PC_PATHNAME. + (module_translate_include): Use Client::PC_BOOL and + Client::PC_PATHNAME. + +2020-09-03 Nathan Sidwell + + Merge trunk 8bc0f24d7a2. + + Instantiation after extern instantiation. + gcc/cp/ + * module.cc (trees_in::read_class_def): Maybe set + CLASSTYPE_INTERFACE. + gcc/testsuite/ + * g++.dg/modules/extern-tpl-2_[abc].[CH]: New. + +2020-09-02 Nathan Sidwell + + libcpp/ + * files.c (_cpp_stack_file): Don't try and xlate include-next. + + Extern instantiations. + gcc/cp/ + * module.cc (trees_{in,out}::core_bools): Drop duplicate comdat + flag. + (trees_in::is_matching_decl): Don't propagate not-really-extern + here. + (trees_{in,out}::{read,write}_function_def): Stream + not-really-extern here. + gcc/testsuite/ + * g++.dg/modules/extern-tpl-1_[abc].[CH]: New. + + Rename -fnote-include-translate to -flang-info-include-translate. + gcc/cp/ + * (module_translate_include): Check if matches trailing part of + header name. + (handle_module_option): Adjust. + gcc/c-family/ + * c.opt (-fnote-include-translate{,=}): Rename to ... + (-flang-info-include-translate{,=}): ... here. + (-fnote-include-translate=query): Delete. + gcc/ + * doc/invoke.texi: Update documentation. + +2020-08-31 Nathan Sidwell + + gcc/cp/ + * lang-specs.h: c++headers always do directives-only preprocessing + in modules mode. + + Deal with running out of locations. + gcc/cp/ + * module.cc (module_state::read_prepare_maps): New. + (module_state::write_{ordinary,macro}_maps): Adjust. + (struct module_state_config): Record number of locations needed. + (module_state::read_location): Deal with lack of locations. + (module_state::{read,write}_config): Adjust. + (module_state::read_initial): Adjust. + + gcc/cp/ + * mapper.h (module_resolver): Default to no xlation. + * mapper-resolver.cc (module_resolver::read_tuple_file): Don't + fail on zero-length files. + + Add control for default header translation rules. + gcc/cp/ + * mapper-client.cc (module_client::open_module_client): Better + error reporting. + * mapper-resolver.cc (module_resolver::module_resolver): Specify + default translate behavior. + (module_resolver::IncludeTranslateRequest): Check it. + * mapper-server.cc (flag_xlate): New. + (process_args): Rename -f->-m add -t + (main): Adjust. + * mapper.h (module_resolver): Add default_xlate field. + gcc/testsuite/ + * g++.dg/modules/inc-xlate-1_e.C: Adjust. + * g++.dg/modules/legacy-2_b.H: Adjust. + * g++.dg/modules/legacy-6.map: Adjust. + * g++.dg/modules/legacy-6_[cd].C: Adjust. + * g++.dg/modules/map-2.C: Adjust. + + gcc/cp/ + * name-lookup.c (get_fixed_binding_slot): Don't stat-hack a + namespace. + * module.cc (trees_in::assert_definition): Header units are + module_purview, but ok. + gcc/testsuite/ + * g++.dg/modules/ns-dup-1_[ab].C: New. + +2020-08-28 Nathan Sidwell + + Fix pushing imported namespaces. + gcc/cp/ + * module.cc (depset::hash_add_namespace): Don't mark bindings + special. + (struct add_binding_data): Record finding a namespace. + (depset::hash::add_binding_entity): Make namespaces idempotent. + (depset::hash::add_namespace_entities): Clear met_namespace. + (module_state::write): Zap partitions bitmap if empty. + * name-lookup.c (push_namespace): Ensure namespace is in + MODULE_SLOT_CURRENT. + * ptree.c (cxx_print_xnode): Show more detail on MODULE_VECTOR. + gcc/testsuite/ + * g++.dg/modules/ns-imp-1_[abc].C: New. + * g++.dg/modules/ns-part-1_[abc].C: New. + + gcc/testsuite/ + * lib/prune.exp (prune_ices): Adjust regexp. + + Merge trunk cb3c3d63315. + Whee, all up to date! + + Merge trunk f1612b8ae8a. + c++: Check satisfaction before non-dep convs. [CWG2369] + gcc/testsuite/ + * g++.dg/modules/concept-[13]_b.C: Adjust. + + Merge trunk e6e01618e83. + +2020-08-27 Nathan Sidwell + + Stream MEM_REFs, who knew? + gcc/cp/ + * module.cc (trees_{in,out}::start): Permit MEM_REFs. + (trees_{in,out}::core_bools): Likewise. + gcc/testsuite/ + * g++.dg/modules/memref-1_[ab].C: New. + +2020-08-27 Nathan Sidwell + Jeff Chapman II + + Fix hash table breakage. + gcc/cp/ + * name-lookup.c (push_namespace): Do not create slot on first + lookup. + gcc/testsuite/ + * g++.dg/modules/string-view1.C: New test. + * g++.dg/modules/string-view2.C: Ditto. + +2020-08-27 Nathan Sidwell + + Merge trunk 708b3600d04. + +2020-08-26 Nathan Sidwell + + Merge trunk 17abcc77341. + libstdc++: Replace operator>>(istream&, char*) [LWG 2499] + + Fix type lang specific changing. + gcc/cp/ + * lex.c (copy_lang_type): Split allocation & assignment to be + conditional-breakpoint friendly. + * module.cc (trees_in::read_class_def): Update variants if we + alter TYPE_LANG_SPECIFIC. + * name-lookup.c (maybe_lazily_declare): Look at main variant's + decl. + gcc/testsuite/ + * g++.dg/modules/tdef-inst-1{.h,_[ab].C}: New. + + Fix int_cst caching + gcc/ + * tree.c (cache_integer_cst): Fix pointer type indices. + + Cherry pick 794275711bd. + gcc/cp/ + * name-lookup.c (op_unqualified_lookup): Don't check if matches + global lookup. + gcc/testsuite/ + * g++.dg/lookup/operator-[12].C: New. + +2020-08-25 Nathan Sidwell + + Operator function lookups in templates + gcc/cp/ + * decl.c (poplevel): A local-binding tree list holds the name in + TREE_PURPOSE. + * name-lookup.c (update_local_overload): Add id to TREE_PURPOSE. + (lookup_name_1): Deal with local-binding error_mark_node marker. + (op_unqualified_lookup): Return error_mark_node for 'nothing + found'. Do other short circuiting here. + (maybe_save_operator_binding): Reimplement to always cache a + result. + (push_operator_bindings): Deal with 'ignore' marker. + gcc/testsuite/ + * g++.dg/modules/operator-1_[ab].C: New. + +2020-08-20 Nathan Sidwell + + Friend specialization overhaul part 1 + gcc/cp/ + * module.cc + gcc/testsuite/ + * g++.dg/modules/tpl-friend-[12]_a.C: Adjust scan. + * g++.dg/modules/tpl-friend-merge-1*: New. + + Do not stream hidden_friend_p. + gcc/cp/ + * module.cc (trees_{in,out}::lang_decl_bools): Do not stream + anticipated_p or hidden_friend_p. + * name-lookup.c (name_lookup::adl_class_fns): DECL_ANTICIPATED is + not informative. + + Reimplement module binding extraction. + gcc/cp/ + * module.cc (depset::clear_hidden_binding): New. + (depset::hash::add_binding): Delete. + (struct add_binding_data): New. + (depset::hash::add_binding_entity): New. + (writable_cmp): Delete. + (depset::hash::add_namespace_entities): Reimplement. + (module_state::write_cluster): Adjust for unscoped enums. + * name-lookup.h (extract_module_binding): Replace with ... + (walk_module_binding): ... this. + * name-lookup.c (STAT_TYPE_HIDDEN): New. + (extract_module_binding): Replace with ... + (walk_module_binding): ... this. + +2020-08-19 Nathan Sidwell + + ODR-check enums! + gcc/cp/ + * module.cc (trees_in::maybe_duplicate): New. + (trees_in::read_enum_def): ODR check duplicate. + gcc/testsuite/ + * g++.dg/modules/enum-bad-1_[ab].[HC]: New. + +2020-08-18 Nathan Sidwell + + Cherry pick 634046d1a81. + gcc/cp/ + * name-lookup.c (qualify_lookup): Drop lambda checking here. + Reorder namespace & type checking. + (lookup_name_1): Do hidden lambda checking here. + + Fix -save-temps issue. + libcpp/ + * lex.c (cpp_maybe_module_directive): Increment prevent_expansion + if not expanding. + +2020-08-17 Nathan Sidwell + + gcc/ + * doc/invoke.texi (C++ Module Mapper): Update documentation. + + Fix disable checking build. + gcc/cp + * module.cc (note_def_cache_hasher): GTY needs this even when + unused. + (not_defs_table_t, note_defs): Likewise. + gcc/ + * gcc.c (driver::maybe_print_and_exit): Warn about disable-checking. + +2020-08-14 Nathan Sidwell + + Cherry pick e97201385a9. + gcc/cp/ + * name-lookup.h (lookup_name_real, lookup_name_nonclass): Rename + to ... + (lookup_name): ... these new overloads. + * name-lookup.c (identifier_type_value_1): Rename lookup_name_real + call. + (lookup_name_real_1): Rename to ... + (lookup_name_1): ... here. + (lookup_name_real): Rename to ... + (lookup_name): ... here. Rename lookup_name_real_1 call. + (lookup_name_nonclass): Delete. + * call.c (build_operator_new_call): Rename lookup_name_real call. + (add_operator_candidates): Likewise. + (build_op_delete_call): Rename lookup_name_nonclass call. + * parser.c (cp_parser_lookup_name): Likewise. + * pt.c (tsubst_friend_class, lookup_init_capture_pack): Likewise. + (tsubst_expr): Likewise. + * semantics.c (capture_decltype): Likewise. + libcc1/ + * libcp1plugin.cc (plugin_build_dependent_expr): Rename + lookup_name_real call. + + Cherry pick db1c2a89db0. + gcc/cp/ + * cp-tree.h (LOOKUP_HIDDEN): Delete. + (LOOKUP_PREFER_RVALUE): Adjust initializer. + * name-lookup.h (enum class LOOK_want): Add HIDDEN_FRIEND and + HIDDEN_LAMBDA flags. + (lookup_name_real): Drop flags parm. + (lookup_qualified_name): Drop find_hidden parm. + * name-lookup.c (class name_lookup): Drop hidden field, adjust + ctors. + (name_lookup::add_overload): Check want for hiddenness. + (name_lookup::process_binding): Likewise. + (name_lookup::search_unqualified): Likewise. + (identifier_type_value_1): Adjust lookup_name_real call. + (set_decl_namespace): Adjust name_lookup ctor. + (qualify_lookup): Drop flags parm, use want for hiddenness. + (lookup_qualified_name): Drop find_hidden parm. + (lookup_name_real_1): Drop flags parm, adjust qualify_lookup + calls. + (lookup_name_real): Drop flags parm. + (lookup_name_nonclass, lookup_name): Adjust lookup_name_real + calls. + (lookup_type_scope_1): Adjust qualify_lookup calls. + * call.c (build_operator_new_call): Adjust lookup_name_real call. + (add_operator_candidates): Likewise. + * coroutines.cc (morph_fn_to_coro): Adjust lookup_qualified_name + call. + * parser.c (cp_parser_lookup_name): Adjust lookup_name_real calls. + * pt.c (check_explicit_specialization): Adjust + lookup_qualified_name call. + (deduction_guides_for): Likewise. + (tsubst_friend_class): Adjust lookup_name_real call. + (lookup_init_capture_pack): Likewise. + (tsubst_expr): Likewise, don't look in namespaces. + * semantics.c (capture_decltype): Adjust lookup_name_real. Don't + look in namespaces. + libcc1/ + * libcp1plugin.cc (plugin_build_dependent_exp): Adjust + lookup_name_real call. + + Cherry pick c38f8785205. + gcc/cp/ + * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES) + (LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY) + (LOOKUP_QUALIFIERS_ONL): Delete. + (LOOKUP_HIDDEN): Adjust. + * name-lookup.h (enum class LOOK_want): New. + (operator|, operator&): Overloads for it. + (lookup_name_real): Replace prefer_type & namespaces_only with + LOOK_want parm. + (lookup_qualified_name): Replace prefer_type with LOOK_want. + (lookup_name_prefer_type): Replace with ... + (lookup_name): ... this. New overload with LOOK_want parm. + * name-lookup.c (struct name_lookup): Replace flags with want and + hidden fields. Adjust constructors. + (name_lookyp::add_overload): Correct hidden stripping test. Update + for new LOOK_want type. + (name_lookup::process_binding): Likewise. + (name_lookup::search_unqualified): Use hidden flag. + (identifier_type_value_1): Adjust lookup_name_real call. + (set_decl_namespace): Adjust name_lookup ctor. + (lookup_flags): Delete. + (qualify_lookup): Add LOOK_want parm, adjust. + (lookup_qualified_name): Replace prefer_type parm with LOOK_want. + (lookup_name_real_1): Replace prefer_type and namespaces_only with + LOOK_want parm. + (lookup_name_real): Likewise. + (lookup_name_nonclass, lookup_name): Adjust lookup_name_real call. + (lookup_name_prefer_type): Rename to ... + (lookup_name): ... here. New overload with LOOK_want parm. + (lookup_type_scope_1): Adjust qualify_lookup calls. + * call.c (build_operator_new_call) + (add_operator_candidates): Adjust lookup_name_real calls. + * coroutines.cc (find_coro_traits_template_decl) + (find_coro_handle_template_decl, morph_fn_to_coro): Adjust + lookup_qualified_name calls. + * cp-objcp-common.c (identifier_global_tag): Likewise. + * decl.c (get_tuple_size, get_tuple_decomp_init): Likewise. + (lookup_and_check_tag): Use lookup_name overload. + * parser.c (cp_parser_userdef_numeric_literal): Adjust + lookup_qualified_name call. + (prefer_arg_type): Drop template_mem_access parm, return LOOK_want + value. + (cp_parser_lookup_name): Adjust lookup_member, lookup_name_real + calls. + * pt.c (check_explicit_specialization): Adjust lookup_qualified_name + call. + (tsubst_copy_and_build, tsubst_qualified_name): Likewise + (deduction_guides_for): Likewise. + (tsubst_friend_class): Adjust lookup_name_real call. + (lookup_init_capture, tsubst_expr): Likewise. + * rtti.c (emit_support_tinfos): Adjust lookup_qualified_name call. + * semantics.c (omp_reduction_lookup): Likewise. + (capture_decltype): Adjust lookup_name_real call. + libcc1/ + * libcp1plugin.cc (plugin_build_dependent_expr): Adjust + lookup_name_real & lookup_qualified_name calls. + +2020-08-13 Nathan Sidwell + + Cherry pick 0c5f6bbfe2e + gcc/cp/ + * name-lookup.h (enum class LOOK_where): New. + (operator|, operator&): Overloads for it. + (lookup_name_real): Replace NONCLASS & BLOCK_P parms with WHERE. + * name-lookup.c (identifier_type_value_w): Adjust + lookup_name_real call. + (lookup_name_real_1): Replace NONCLASS and BLOCK_P parameters + with WHERE bitmask. Don't search namespaces if not asked to. + (lookup_name_real): Adjust lookup_name_real_1 call. + (lookup_name_nonclass, lookup_name) + (lookup_name_prefer_type): Likewise. + * call.c (build_operator_new_call) + (add_operator_candidates): Adjust lookup_name_real calls. + * parser.c (cp_parser_lookup_name): Likewise. + * pt.c (tsubst_friend_class, lookup_init_capture_pack) + (tsubst_expr): Likewise. + * semantics.c (capture_decltype): Likewise. + libcc1/ + * libcp1plugin.cc (plugin_build_dependent_expr): Likewise. + +2020-08-07 Nathan Sidwell + + Merge trunk d21252de6c8. + + Address 2 FIXMEs. + gcc/cp/ + * name-lookup.c (finish_nonmember_using_decl): Here. + (lookup_type_scope_1): Here. + + Global decls. + gcc/cp/ + * name-lookup.c (get_fixed_binding_slot): Skip internal decls when + creating vector. + (record_mergeable_decl): Replace with ... + (maybe_record_mergeable_decl): Skip internal decls. + (do_pushdecl): Adjust. + * decl.c (start_decl): Templated vars are not + internal. (Incomplete fix of PR 96523) + + Shadowed type. + gcc/cp/ + * name-lookup.c (check_module_override): No need to deal with + shadowed type here. + gcc/testsuite/ + * g++.dg/modules/shadowed-1_[ab].C: New. + + Simplify binding extraction. + gcc/cp/ + * name-lookup.h (extract_module_binding): Drop NS arg. + * name-lookup.c (extract_module_binding): Reimplement. + * module.cc (depset::hash::add_namespace_entities): Adjust. + +2020-08-06 Nathan Sidwell + + Remove now-unneeded dedup bits. + gcc/cp/ + * module.cc (module_state::read_cluster): Don't set dedup for + partition or header unit. + + Determine deduplication via slot flags. + gcc/cp/ + * module.cc (module_state::read_cluster): Disable dedup here. + * name-lookup.cc (get_fixed_binding_slot): Set + MODULE_BINDING_GLOBAL_P if necessary. + (name_lookup::search_bitmap_only): Inspect MODULE_BINDING_$foo_P. + (name_lookup::adl_namespace_fns): Likewise. + (set_module_binding): Always stat hack if mod_glob. + + gcc/cp/ + * module.cc (module_state::read_cluster): Pay attention to hidden + decls even in same module. + * name-lookup.c (name_lookup:adl_namespace_fns): Drop unused parm. + +2020-08-05 Nathan Sidwell + + Note binding slot origin. + gcc/cp/ + * cp-tree.h (MODULE_BINDING_{GLOBAL,PARTITION}_P): New. + * module_cc (module_state::read_cluster): Adjust + set_module_binding call. + * name-lookup.c (set_module_binding): Replace inter_p with + mod_glob parm. Adjust and set origin. + * name-lookup.h (set_module_binding): Adjust prototype. + + Note duplicates on symbol vector. + gcc/cp/ + * cp-tree.h (MODULE_VECTOR_{GLOBAL,PARTITION}_DUPS_P): New. + * name-lookup.h (mergeable_namespace_entities): Replace with ... + (mergeable_namespace_slots): ... this. + * module.cc (trees_in::key_mergeable): Set dups flag when alread + existing. + * name-lookup.c (mergeable_namespace_entities): Replace with ... + (mergeable_namespace_slots): ... this. Return the vector too. + +2020-08-04 Nathan Sidwell + + Fix alias templates. + gcc/cp/ + * pt.c (lookup_template_class_1): Fix alias resetting of + ti_template. + gcc/testsuite/ + * g++.dg/template/pr95263.C: Re-enable. + + Merge trunk 1790d13dc8f. + +2020-08-03 Nathan Sidwell + + Revert local paranoid change. + gcc/cp/ + * cp-tree.h (build_cdtor_clones, clone_cdtor): Drop via_using parm. + * class.c (build_cdtor_clones): Drop via_using parm. + (clone_cdtor): Likewise. + (clone_constructors_and_destructors): Adjust. + * module.cc (trees_in::decl_value): Adjust build_cdtor_clones parms. + + Add private module fragment parsing (only). + gcc/cp/ + * parser.c (enum module_preamble): Replace with ... + (enum module_parse): Update all uses. Add PMF values. + (cp_parser_module_declaration): Add private-module-fragment grammar. + gcc/testsuite/ + * g++.dg/modules/pmp-[123]{,_[ab]}.C: New. + + Fix save-temps & header-units + gcc/cp/ + * lang-specs.h (@c++-{,system-,user-}header): Directives-only + preprocessing for saving temps with modules. + + Merge trunk d1773f58f3a. + + Add c++-user-header c++-system-header languages. + gcc/cp/ + * lang-specs.h (@c++-header): Map -fmodules-ts to -fmodule-header, + inhibit PCH. + (@c++-user-header, @c++-system-header): New. + gcc/ + * doc/invoke.texi (C++ Modules): Document. + +2020-07-31 Nathan Sidwell + + Preserve reserved locations. + gcc/cp/ + * module.cc (enum loc_kind): Add LK_RESERVED. + (module_state::{read,write}_location): Preserve reserved + locations. + (module_State::{read,write}_macro_maps): Default to + UNKNOWN_LOCATION. + gcc/testsuite/ + * g++.dg/modules/part-mac-1_[abc].[CH]: New. + + Fix location of imports of partitions. + * module.cc (loc_spans::maybe_propagate): New. + (module_state::read_{ordinary,macro}_maps): Use it. + gcc/testsuite/ + * g++.dg/modules/part-hdr-1_[abc].[CH]: New. + + Fix import location reparenting. + gcc/cp/ + * module.cc (preprocess_module): Reparent here, if we're already + imported. + gcc/testsuite/ + * g++.dg/modules/reparent-1_[abc].C: New. + +2020-07-30 Nathan Sidwell + + Unspellable module control-line tokens. + libcpp/ + * internal.h (struct spec_nodes): Add M__IMPORT. + * init.c (post_options): Adjust module token spelling. + * lex.c (cpp_maybe_module_directive): Adjust. + * macro.c (cpp_get_token_1): Reset to zero. + gcc/c-family/ + * c-common.c (c_common_reswords): Adjust module token spelling. + gcc/testsuite/ + * g++.dg/modules/dir-recovery.C: New. + * g++.dg/modules/cpp-[25]_c.C: Adjust. + * g++.dg/modules/dep-2.C: Adjust. + * g++.dg/modules/dir-only-[234]{,_b}.C: Adjust. + * g++.dg/modules/inc-xlate-1_b.H: Adjust. + * g++.dg/modules/legacy-[36]_[bcd].[HC]: Adjust. + + Fix implicit fns from modules. + gcc/cp/ + * cp-tree.h (build_cdtor_clones): Add parms. + * class.c (build_cdtor_clones): Swallow clone_cdtor's member insertion. + (clone_cdtor): Move member insertion to build_cdtor_clones. + * module.cc (trees_in::decl_value): Insert clones, if there's + already a member vec. + gcc/testsuite/ + * g++.dg/modules/sv-1{.h,_[ab].C}: New. + +2020-07-28 Nathan Sidwell + + Merge trunk f3665bd1111. + + gcc/cp/ + * class.c (layout_class_type): Restore trunk for unnamed classes. + * cp-tree.h (lang_tree_node): Retore trunk GTY. + (cp_tree_node_structure): Restore trunk API. + * decl.c (cp_tree_node_structure): Restore trunk API. + * diagnostic.c (progname): Restore trunk comment. + gcc/ + * doc/invoke.texi (Precompiled Headers): Restore trunk index + capitalization. + (C++ Modules): Adjust to match. + + Merge trunk 134051f16bd. + + libcpp/ + * directives.c (_cpp_do_file_change): Check we're moving to line + zero of the same file. + +2020-07-22 Nathan Sidwell + + gcc/c-family/ + * c-ada-spec.c (decl_sloc): Revert to trunk. + + Merge trunk 6e1e0decc9e. + + Unbreak Ada + gcc/ + * gcc.c (execute): Disable argv[0] munging. + +2020-07-21 Nathan Sidwell + + Sadly Ada still broken :( + gcc/c-family/ + * c-ada-spec.c (decl_sloc): Actually return the field's loc. + +2020-07-20 Nathan Sidwell + + gcc/cp/ + * rtti.c (init_rtti_processing): Unbreak bootstrap. + + Merge trunk a926eeedf43. + +2020-07-17 Nathan Sidwell + + libcpp/ + * files.c (_cpp_stack_file): Remove FIXME. + * include/cpplib.h (cpp_main_loc): Declare. + * init.c (cpp_read_main_file): Set main loc. + (cpp_main_loc): New. + * internal.h (struct cpp_reader): Add main_loc. + gcc/cp/ + * module.cc (main_source_loc): Delete. + (module_translate_include): Use cpp_main_loc. + (begin_header_unit, preprocess_module, preprocessed_module) + (init_modules, finish_module_processing): Likewise. + (fini_modules): Adjust. + +2020-07-16 Nathan Sidwell + + gcc/cp/ + * module.cc (module_may_redeclare): Deal with declaring a builtin + in a header unit. + * rtti.c (init_rtti_processing): The type is not exported. + + libcpp/ + * directives.c (do_include_common): Drop FIXME question. + * lex.c (cpp_maybe_module_directive): C++ keywords are not a thing + here. + (cpp_directive_only_process): Add assert. + + libcpp/ + * include/cpplib.h (struct cpp_callbacks): Adjust + translate_include's return type. + * files.c (_cpp_stack_file): Push the buffer returned by the hook. + * lex.c (_cpp_clean_line): Fix buffer overrun. + gcc/ + * langhooks.h (struct lang_hooks): Change + preprocess_translate_include's return type. + gcc/cp/ + * cp-tree.h (module_translate_include): Change return type. + * module.cc (module_translate_include): Return a buffer, don't + push it. + + libcpp/ + * include/cpplib.h (enum cpp_main_search): New. + (struct cpp_options): Adjust. + * init.c (cpp_read_main_file): Adjust. + * macro.c (cpp_get_token_1): Remove FIXME. + gcc/cp/ + * module.cc (handle_module_option): Adjust. + + gcc/cp/ + * pt.c (tsubst_expr): Do not process using decls again. + gcc/testsuite/ + * g++.dg/modules/using-6_a.C: Enable elided code. + * g++.dg/modules/using-8_[ab].C: New. + +2020-07-15 Nathan Sidwell + + Merge trunk 765fbbf9bb3. + +2020-07-14 Nathan Sidwell + + Merge trunk 5f809982e8e. + +2020-07-13 Nathan Sidwell + + Delete now-unused new pieces. + gcc/ + * toplev.h (original_argc, original_argv): Delete. + * toplev.c (original_argc, original_argv): Delete. + gcc/cp/ + * cp-tree.h (DECL_CHECK): Delete. + gcc/c-family + * c-pragma.h (C_LEX_STRING_IS_HEADER): Delete. + + gcc/cp/ + * module.cc (module_state::set_filename): New. + (module_state::do_import): Drop fname arg. + (module_state::read_imports): Set filename here. + (module_state::write_locations): Drop duplicate FIXME. + (module_state::read_macros): Drop out of date FIXME. + (direct_import): Adjust. + (module_translate): Set filename if we're told it. + (preprocess_module): Copy if filename already known. + (preprocessed_module, init_modules): Adjust. + + gcc/cp/ + * module.cc (module_state::read_cluster): Add FIXME about + unnecessary deduping. + * name-lookup.c (name_lookup::process_module_binding): Remove + FIXME. + (name_lookup::adl_namespace_fns): Likewise. + (name_lookup::search_adl): Likewise. + (do_push_nested_namespace): Likewise. + + gcc/testsuite/ + * lib/scanlang.exp (scan-lang-dump-not): Fix 3-arg case. + * g++.dg/modules/builtin-3_a.C: Remove unnecessary bracing. + + Merge trunk a1faa8e2470. + + Fix polymorphic type info emission and key-function confusion + gcc/cp/ + * module.cc (trees_out::core_bools): Calculate externalness from + POV of importer. + (trees_{in,out{::lang_decl_bools): Do not stream + not_really_extern. + (trees_in::read_{var,function}_def): Recalculate + not_really_extern. + (trees_in::read_class_def): The key_method might become non-key. + gcc/testsuite/ + * g++.dg/modules/sym-subst-3_a.C: Adjust regexp. + * g++.dg/modules/virt-1_[ab].C: Adjust. + * g++.dg/modules/virt-2_[abc].C: New. + +2020-07-09 Nathan Sidwell + + gcc/cp/ + * modules.cc (trees_out::type_node [VECTOR_TYPE]): poly_int's + to_constant already does the checking we need. + + gcc/testsuite/ + * g++.dg/modules/sym-subst-3_a.C: Adjust scan for other ABIs + + gcc/testuite/ + * g++.dg/modules/builtin-3_[ab].C: Add va_list scans for + aarch64 and powerpc ABIs. + +2020-07-08 Nathan Sidwell + + gcc/testsuite/ + * g++.dg/modules/module.exp: Remove tcl 8.6ism + + Merge trunk 6bf2ff0d52a. + +2020-07-03 Nathan Sidwell + + Merge trunk ce0f842492c + +2020-07-03 Iain Sandoe + + gcc/cp/ + * name-lookup.c (name_lookup::adl_namespace_fns): Last param is + unused, and bootstrap complains :( [Nathan left it like that so + he'd be reminded to remove it if it really turned out not needed] + +2020-07-02 Nathan Sidwell + + p1779 ABI isolation + gcc/cp/ + * cp-tree.h (named_module_purview_p): New. + * decl.c (grokmethod): Don't always implicitly inline. + * module.cc (module_state_config::get_dialect): Add + module_implicit_inline. + gcc/ + * doc/invoke.texi (fmodule-implicit-inline): Document. + gcc/c-family/ + * c.opt (-fmodule-implicit-inline): New. + gcc/testsuite/ + * g++.dg/modules/imp-member-[12]_b.C: Add some inlines. + * g++.dg/modules/vmort-1_a.C: Likewise. + * g++.dg/modules/imp-inline-1_[ab].C: New. + +2020-07-01 Nathan Sidwell + + GMF entities are not findable by name + gcc/cp/ + * modules.cc (enum depset::disc_bits): Remove DB_GLOBAL_BIT. + (depset::is_global): Delete + (depset::hash::make_dependency): Drop reachable GMF binding + insertion. + gcc/testsuite/ + * g++.dg/modules/builtin-[13]_[ab].C: Adjust scans. + * g++.dg/modules/mod-sym-2.C: Adjust scans. + + Implement FR039 -- dependent ADL and friend fns + gcc/cp/ + * name-lookup.c (name_lookup::adl_namespace): Instantiation path + is not important here. + (name_lookup::search_adl): Reimplement dependent adl for modules. + gcc/testsuite/ + * g++.dg/modules/adl-[12]_b.C: export. + * g++.dg/modules/adl-[45]_[abcd].C: New. + +2020-06-30 Nathan Sidwell + + gcc/cp/ + * class.c (copyfndecl_with_name): Drop inadvertent + DECL_CLONED_FUNCTION setting. Pass 0 for top_level to + rest_of_decl_compiulation. + + gcc/cp/ + * class.c (copy_fndecl_with_name): Add tree code parm. Adjust + callers. + + libcc1/ + * libcp1plugin.cc (plugin_build_decl): Adjust. + + Unify copy_fndecl_with_name and clone_decls. + gcc/cp/ + * class.c (DECL_NEEDS_VTT_PARM_P): Delete. + (copy_fndecl_with_name): Add ctor booleans, use them. Make static. + (copy_operator_fn): New wrapper. + (build_clone): Adjust to use copy_fndecl_with_name. + (build_clones): Rename to ... + (build_cdtor_clones): ... here. + (clone_function_decl): Rename to ... + (clone_cdtor): ... here. + (clone_constructors_and_destructors): Adjust. + * cp-tree.h (build_clones): Rename to build_cdtor_clones. + (clone_function_decl): Rename to clone_cdtor. + (copy_fndecl_with_name): Rename to copy_operator_fn. Change arg + type. + * method.c (implicitly_declare_fn): Adjust. + (lazily_declare_fn): Likewise. + * module.c (trees_in::decl_value): Adjust. + * pt.c (tsubst_function_Decl, instantiate_template_1): Adjust. + +2020-06-29 Nathan Sidwell + + Merge master 9a33c41fe42 + + Merge master 44492e248cb + c++: implicit operator== adjustments from P2002. [Jason Merrill] + gcc/cp/ + * class.c (build_clone): Retain old version for the moment. + (DECL_NEETS_VTT_PARM_P): Resurrect, before we kill it again. + +2020-06-25 Nathan Sidwell + + gcc/cp/ + * mapper-server.cc (process_server): We should Write when writing. + (server): Fix off-by-one error. + + Merge master 68df8e8c343 + + Merge master 502d63b6d61 + Lower VEC_COND_EXPR into internal functions. [Martin Liska] + Apply d11c9841d54 Add missing check for gassign. [Martin Liska] + Apply 9435fb9668e Fix typo in tree-ssa-reassoc.c. [Martin Liska] + + Merge master 2021af0c23a + + Merge master 668ef28fbb4 + c++: Clean up previous change [PR41437] [Patrick Palka] + gcc/cp/ + * module.cc (trees_{in,out}::code_vals [TEMPLATE_INFO]): Adjust + access checking streaming. + + Merge master 92bed036098 + c++: Improve access checking inside templates [PR41437] [Patrick Palka] + + Merge master a97e49a89d1 + +2020-06-24 Nathan Sidwell + + Merge master f2242ec0d3f + Over the hump! + + Constrained partial specializations + gcc/cp/ + * module.cc (depset::hash::add_partial_redirect): Add slot parm. + (enum merge_kind): Add MK_partial. + (merge_kind_name): Likewise. + (trees_out::decl_node): A redirect may be for an EK_DECL. + (trees_out::get_merge_kind): Determine MK_partial. + (trees_{in,out}::key_mergeable): Deal with MK_partial. + (depset::hash::make_dependency): Deal with discovering a partial + specialization. + * pt.c (maybe_new_partial_specialization): Add module bits to the + new typedef. + (tsubst_template_decl): Relax module import assert. + (tsubst_template_decl): Refactor, add fixme to check. + gcc/testsuite/ + * g++.dg/modules/nested-constr-1.h: New. + * g++.dg/modules/nested-constr-1_a.H: New. + * g++.dg/modules/nested-constr-1_b.C: New. + * g++.dg/modules/nested-constr-2_a.C: New. + * g++.dg/modules/nested-constr-2_b.C: New. + * g++.dg/modules/nested-constr-2_c.C: New. + * g++.dg/modules/tmpl-part-req-1.h: New. + * g++.dg/modules/tmpl-part-req-1_a.H: New. + * g++.dg/modules/tmpl-part-req-1_b.C: New. + * g++.dg/modules/tmpl-part-req-2.h: New. + * g++.dg/modules/tmpl-part-req-2_a.H: New. + * g++.dg/modules/tmpl-part-req-2_b.C: New. + +2020-06-11 Nathan Sidwell + + Merge master b825a228907 + +2020-06-10 Nathan Sidwell + + Merge master ac9face8d26 + PR c++/95263 + gcc/cp/ + * pt.c (lookup_template_class_1): Do not apply reversion + gcc/testsuite/ + * g++.dg/template/pr95263.C: New (XFAIL) + + Merge master 6c8e16aea85 + +2020-06-10 Iain Sandoe + + Fixes for darwin + gcc/cp/ + * mapper-server.cc: Reorder includes. + (server): Block scope potentially empty if clause. + * module.cc (get_mapper): Don't use C++14. + gcc/testsuite/ + * g++.dg/modules/bad-mapper-3: Adjust error. + +2020-06-05 Nathan Sidwell + + Install V1 module protocol goop + gcc/cp/ + * Make-lang.in: Remove mapper-server2 hack. + * mapper-client.cc: Add additional mechanisms to get a server. + * mapper-client.h: Delete. + * mapper-resolver.cc: Fix file reading bugs + * mapper-server.cc: Original deleted. + * mapper-server2.cc: Renamed to mapper-server.cc. + * mapper.h: Adjust. + * module.cc: Adjust. + gcc/testsuite/ + * g++.dg/modules/bad-mapper-1.C: Adjust expected errors. + * g++.dg/modules/bad-mapper-2.C: Likewise. + * g++.dg/modules/bad-mapper-3.C: Likewise. + * g++.dg/modules/map-2.C: Likewise. + + Add libcody as an external library + * libcody: Delete + * Makefile.def: Revert. + * configure.ac: Revert. Add --with-libcody. + * Makefile.tpl: Add CODYLIB, CODYLIBINC, HOST_CODYLIB, HOST_CODYLIBINC. + * Makefile.in: Rebuilt. + * configure: Rebuilt. + gcc/ + * Makefile.in: Revert. Add CODYLIB, CODYLIBINC. + * configure.ac: Add CODYLIB, CODYLIBINC. + * configure: Rebuilt. + gcc/cp + * Make-lang.in: Revert. + +2020-06-02 Nathan Sidwell + + Add libcody with stub users + * libcody: New. Currently a symlink to cody repo. + * Makefile.def: Add libcody. + * configure.ac: Add libcody. + * Makefile.in: Rebuilt. + * configure: Rebuilt. + gcc/ + * Makefile.in: Add libcody. + gcc/cp/ + * Make-lang.in: Add libcody + * mapper.h: New stub/ + * mapper-resolver.cc: New stub. + * mapper-server2.cc: New stub. + +2020-05-21 Nathan Sidwell + + FR39 ... + + Merge master 149c8c7c27a + + Premerging Patrick's c++/95223 fix. + gcc/cp/ + * cp-tree.h (comparing_typenames): Declare. + (module_streaming): Delete. + * modules.cc (module_streaming): Delete. + (module_state::read_cluster): Increment comparing_typenames, not + module_streaming. + * pt.c (comparing_typenames): Define. + (spec_hasher::equal): Increment it. + * typeck.c (structural_comptypes): Check it here for typedefs. + + libcpp/ + * files.c, init.c, internal.h: Adjust file_find_kind names from trunk. + + libcpp/ + * line-map.c (linemap_add): Set range and column bits to zero. + gcc/c-family/ + * c-opts.c (c_common_post_options): Add comment. + (c_finish_options): Call linemap_line_start to start line. + +2020-05-20 Nathan Sidwell + + libcpp/ + * include/cpplib.h (cpp_read_main): Document preamble arg. + * internal.h (IT_MAIN_{ZERO,REAL}): Rename to ... + (IT_MAIN_PREAMBLE, IT_MAIN): ... these. + * files.c (_cpp_stack_file): Adjust. + * init.c (cpp_read_main_file): Adjust. + + libcpp/ + * directives.c (_cpp_do_file_change): Optimize rewinding one line + to line zero. + gcc/c-family/ + * c-opts.c (c_finish_options): Set locations to zero. + * c-ppoutput.c (cb_define): Always advance line number. + + libcpp/ + * files.c (cpp_push_include): Pass highest_line for loc. + (cpp_push_default): Likewise. + * line-map.c (linemap_add): Set range and column bits to what we + used to figure start location. + +2020-05-19 Nathan Sidwell + + libcpp/ + * internal.h (enum _find_file_kind): New. + (_cpp_find_file): Use it, not 3 bools. + * files.c (_cpp_find_file): Use _find_file_kind enum, not bools. + (_cpp_stack_include, cpp_find_header_unit, _cpp_fake_include) + (_cpp_do_file_change, _cpp_compare_file_date): Adjust. + * init.c (cpp_read_main): Adjust _cpp_find_file call. + +2020-05-18 Iain Sandoe + + gcc/testsuite/ + * g++.dg/modules/sym-subst-3_a.C: Adjust scan asm for Darwin. + * g++.dg/modules/init-2_b.C: Adjust scan-asms for Darwin. + * g++.dg/modules/init-2_c.C: Likewise. + + gcc/cp/ + * mapper-client.cc: Move fallback typedef for sighandler_t + from here ... + * mapper-client.h: ... to here. + +2020-05-19 Nathan Sidwell + + Merge master ed63c387aa0 + + gcc/cp/ + * name-lookup.c (add_imported_namespace): Clarify + inline/non-inline error message. + + libcpp/ + * lex.c (do_peek_module): Permit non-ascii char sets. + +2020-05-15 Nathan Sidwell + + Enumerate load states. + gcc/cp/ + * module.cc (enum module_loadedness): New. + (module_state::load_state): Rename to .. + (module_state::loadedness): ... this, change type. + (module_state::read_{imports,preprocessor,language}): Adjust, + (module_State::{load_section,do_mport}): Likewise, + (direct_import, {import,declare,preprocess}_module): Likewise. + + Remove {,purview_,partition_}direct_p flags. + gcc/cp/ + * module.cc (module_state::{,purview_,partition_}_direct_p): + Remove flags. + (module_state::is{,purview_,partition_}direct_p}): Adjust. + (module_state::{read,write}_imports): Remove direct flag handling. + (module_state::write): Likewise. + (direct_import, process_module): Likewise. + + Duplicate {,purview_,partition_}direct_p flags in an enum. + gcc/cp/ + * module.cc (enum module_directness): New. + (module_state): Add it. + (module_state::is{,purview_,partition_}direct_p}): Consistency + asserts. + (module_state::{read,write}_imports): Adjust and add Consistency + asserts. + (module_state::write): Likewise. + (direct_import, preprocess_module): Likewise. + +2020-05-14 Nathan Sidwell + + Stop GMF leakage from interface to implementation + gcc/cp/ + * cp-tree.h (preprocess_module): Add in_purview param. + * lex.c (token_coro::resume): Adjust. + * module.cc (module_state::purview_direct_p): New flag. + (module_state::{read,write}_imports): Pay attention to it for + invisible imports. + (begin_header_unit): Adjust preprocess_module call. + (preprocess_module): Set purview_direct_p as appropriate. + gcc/testsuite/ + * g++.dg/modules/gmf-2_[abcd].[CH]: New. + + Merge master f497e36ae56 + +2020-05-13 Nathan Sidwell + + Implement P1874 Dynamic Initialization Order + gcc/cp/ + * cp-tree.h (module_initializer_kind) + (module_add_import_initializers): Declare. + (mangle_module): Add include_partition parm. + (init_module_processing): Rename to init_modules. + (fini_modules): Declare. + (mangle_identifier): Add prefix char. + (mangle_module_global_init): Declare. + * decl.c (cxx_init_decl_processing): Adjust for module init + rename. + * decl2.c (start_objects): Maybe mangle module initializer name. + Add module initializers. + (generate_ctor_or_dtor_function): Add module init support. + (c_parse_final_cleanups): Likewise, adjust for module fini + addition. + * mangle.c (mangle_identifier): Add prefix char. + (write_module): New, broken out of ... + (maybe_write_module): ... here. Call it. + (mangle_module_global_init): New. + * module.cc (module_state): Add call_init_p flag. + (num_init_calls_needed): New global. + (module_state::mangle): Add include_partition parm. + (mangle_module): Likewise. + (module_initializer_kind): New. + (module_add_import_initializers): New. + (init_module_processing): Rename to ... + (init_modules): ... here. + (finish_module_processing): Calculate call_init_p. + (fini_modules): New, broken out of finish_module_processing. + gcc/testsuite/ + * g++.dg/modules/init-[12]_[abc].C: New. + +2020-05-12 Nathan Sidwell + + Merge master 2a0225e4786. + +2020-05-08 Nathan Sidwell + + Merge master b224c3763e0. + + EOF has a location + gcc/cp/ + * parser.c (cp_lexer_set_source_position_from_token): Don't + special-case EOF. + gcc/testsuite/ + * c-c++-common/raw-string-6.c: Adjust expected locations: + * g++.dg/cpp0x/decltype63.C: Likewise. + * g++.dg/cpp0x/gen-attrs-64.C + * g++.dg/cpp0x/pr68726.C: Likewise. + * g++.dg/cpp0x/pr78341.C: Likewise. + * g++.dg/cpp1y/pr65202.C: Likewise. + * g++.dg/cpp1z/class-deduction44.C: Likewise. + * g++.dg/diagnostic/unclosed-extern-c.C: Likewise. + * g++.dg/diagnostic/unclosed-function.C: Likewise. + * g++.dg/diagnostic/unclosed-namespace.C: Likewise. + * g++.dg/diagnostic/unclosed-struct.C: Likewise. + * g++.dg/ext/pr84598.C: Likewise. + * g++.dg/other/switch4.C: Likewise. + * g++.dg/parse/crash10.C: Likewise. + * g++.dg/parse/crash18.C: Likewise. + * g++.dg/parse/crash35.C: Likewise. + * g++.dg/parse/crash59.C: Likewise. + * g++.dg/parse/crash61.C: Likewise. + * g++.dg/parse/crash67.C: Likewise. + * g++.dg/parse/ctor3.C: Likewise. + * g++.dg/parse/error14.C: Likewise. + * g++.dg/parse/error5.C: Likewise. + * g++.dg/parse/error56.C: Likewise. + * g++.dg/parse/invalid1.C: Likewise. + * g++.dg/parse/parameter-declaration-1.C: Likewise. + * g++.dg/parse/parser-pr28152-2.C: Likewise. + * g++.dg/parse/parser-pr28152.C: Likewise. + * g++.dg/parse/pr68722.C: Likewise. + * g++.dg/pr46852.C: Likewise. + * g++.dg/pr46868.C: Likewise. + * g++.dg/template/crash115.C: Likewise. + * g++.dg/template/crash43.C: Likewise. + * g++.dg/template/error-recovery1.C: Likewise. + * g++.dg/template/error57.C: Likewise. + * g++.old-deja/g++.other/crash31.C: Likewise. + +2020-05-07 Nathan Sidwell + + Merge master ab2952c77d0 + +2020-05-05 Nathan Sidwell + + Just push the eh decls. + gcc/cp/ + * except.c (declare_library_fn_1): Don't look at current binding. + Just make the decl and push it. + * name-lookup.h (get_global_module_decls): Delete decl. + * name-lookup.c (get_global_module_decls): Delete defn. + + Fix eh specs + gcc/testsuite/ + * g++.dg/eh/builtin{5,7,9,10,11}.C: Fix eh specs on __cxa fn decls. + + Fix libitm's decls + libitm/ + * eh_cpp.cc (__cxa_allocate_exception, __cxa_free_exception) + (__cxa_begin_catch, __cxa_tm_cleanup, __cxa_eh_globals): Fix + exception specification. + (_ITM_cxa_allocate_exception, _ITM_cxa_free_exception) + (_ITM_cxa_begin_catch): Likewise. + * libitm.h (_ITM_NOTHROW): New define. + (_ITM_cxa_allocate_exception, _ITM_cxa_free_exception) + (_ITM_cxa_begin_catch): Use it. + * testsuite/lib/libitm.exp (libitm_init): Add + -fdiagnostics-color=never. + +2020-05-04 Nathan Sidwell + + Simplify except fn helper pushing part 1 + gcc/cp/ + * decl.c (push_library_fn): Return the decl pushdecl_toplevel returns. + * except.c (verify_library_fn): Replace with ... + (declare_library_fn_1): ... this fn. + (declare_library_fn): Call it. + (build_throw): Call declare_library_fn_1. + * name-lookup.h (get_global_module_decls): Declare. + * name-lookup.c (get_namespace_binding): Return this TU's + bindings. + (get_global_module_decls): New. + gcc/testsuite/ + * g++.dg/eh/builtin10.C: Adjust expected errors. + * g++.dg/eh/builtin11.C: Likewise. + * g++.dg/eh/builtin6.C: Likewise. + * g++.dg/eh/builtin7.C: Likewise. + * g++.dg/eh/builtin9.C: Likewise. + * g++.dg/parse/crash55.C: Likewise. + +2020-05-01 Nathan Sidwell + + Fix macro expansion of header-unit names + libcpp/ + * macro.c (cpp_get_token_1): Pay attention to arg parsing mode, + and the existence of padding/comment tokens. + gcc/testsuite/ + * g++.dg/modules/cpp-6_[abc].[CH]: New. + +2020-04-30 Nathan Sidwell + + Set TREE_USED on stream in. + gcc/cp/ + * module.cc (trees_in::unused): New field. + (trees_in::tree_node): Add defaulted off is_use arg, set TREE_USED + on streamed in obect. Adjust callers to set it. + (trees_{in,out}::core_bools): Do not stream base.used_flag. + (trees_{in,out}::core_vals): Reorder BINFO fields. Increment + unused around vtbl pieces. + (trees_in::decl_value): Save and reset unused field. + (trees_in::read_var_def): Increment unsused for vtbl initializers. + gcc/testsuite/ + * g++.dg/modules/used-1_[abc].C: New. + + Tweak builtin fn hack + gcc/cp/ + * name-lookup.c (get_namespace_binding): Strip singleton + overloads. + gcc/testsuite/ + * g++.dg/modules/libfn-1_[ab].C: New. + +2020-04-28 Nathan Sidwell + + Partition pending indirection fixes + gcc/cp/ + * module.cc (trees_in::install_entity): Treat pending flags + independently, adjust indirection installation. + (pendset_lazy_load): Add specialization_p arg. Use for + indirection adjustment. + (get_primary_module): Look at implementation unit's parent. + (lazy_load_{specializations,members}): Adjust. + gcc/testsuite/ + * g++.dg/modules/part-6_[abcde].C: New. + +2020-04-23 Nathan Sidwell + + Stream definitions after decls. + gcc/cp + * module.cc (module_state::write_cluster): Break out definition + streaming to separate loop. + gcc/testsuite/ + * g++.dg/modules/member-def-[12]_c.C: Adjust scans, oh for CHECK-DAG. + + Stream node types last + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Move type streaming to + end. + gcc/testsuite/ + * g++.dg/modules/indirect-4_c.C: Adjust scan. + +2020-04-22 Nathan Sidwell + + Stream imports at start of cluster + gcc/cp/ + * module.cc (trees_out::importedness): New checker. + (depset::hash::add_dependency): Add imports. + (depset::tarjan::connect): Skip imports. + (module_state::{read,write}_cluster): Seed imports before the + cluster itself. + gcc/testsuite/ + * g++.dg/modules/class-3_[bd].C: Adjust scans. + * g++.dg/modules/imp-member-[12]_[ce].C: Adjust scans. + * g++.dg/modules/member-def-2_c.C: Adjust scans. + * g++.dg/modules/vmort-2_c.C: Adjust scans. + + +2020-04-21 Nathan Sidwell + + Don't stream DECL_ODR_USED or TREE_ASM_WRITTEN + gcc/cp/ + * module.cc (trees_{in,out}::core_values): Don't stream + base.asm_written_flag. + (trees_{in,out}::lang_decl_bools): Don't stream u.base.odr_used. + + Remove DECL_MODULE_PARTITION_P, it is not needed. + gcc/cp/ + * cp-tree.h (DECL_MODULE_PARTITION_P): Delete. + (lang_decl_base): Remove module_partition_p bitfield. + * decl.c (duplicate_decls): No need to check or reset it. + * lex.c (cxx_dup_lang_specific): No need to reset it. + * pt.c (build_template_decl): No need to check it. + (tsubst_template_decl): Likewise, or reset it. + * module.cc (trees_in::decl_value): No need to set it. + (trees_out::decl_node): No need to check it. + (depset::hash::make_dependency): Likewise, Adjust import marking + code. + (set_instantiating_module): No need to reset it. + +2020-04-17 Nathan Sidwell + + Merge master a28edad3da5c59f09565d3d42e20be1a924986c4 + + gcc/cp/ + * cxx-mapper.cc: Rename to ... + * mapper-server.cc: ... here. + * Make-lang.in: Adjust. + * module.cc (make_mapper): Adjust. + gcc/testsuite/ + * g++.dg/modulex/inc-xlate-1_e.C: Adjust. + * g++.dg/modulex/legacy-[26]_[bcdef].[CH]: Likewise. + + gcc/cp/ + * module.cc (mapper_{import_export,export_done}): Revert + 2020-04-13 change. + + gcc/cp/ + * mapper-client.{h,cc}: New, broken out of ... + * module.cc: ... here. + (maybe_remove_cmi_prefix): Delete. + * Make-lang.in: Add mapper-client. + + gcc/cp/ + * module.cc (module_mapper::{get,make}): Replace with ... + (get_mapper, make_mapper): ... these. + (module_mapper:(kill,fini): Delete. + (module_mapper::{import_export,export_done}): Replace with ... + (mapper_import_export, mapper_export_done): ... these. + + gcc/cp/ + * module.cc (module_mapper::to): Drop unneeded field. + + gcc/cp/ + * module.cc (module_mapper::{open,close}): New methods, use them. + + gcc/cp/ + * module.cc (module_mapper): Break more stuff out of ctor. + +2020-04-13 Nathan Sidwell + + gcc/cp/ + * module.cc (module_mapper): Remove knowledge of module_state, + update all callers. + +2020-04-08 Nathan Sidwell + + gcc/testsuite/ + * g++.dg/modules/hello-1_[ab].C: New. + + gcc/cp/ + * module.cc (trees_in::decl_value): Need to retrofit lang for + inner. + gcc/testsuite/ + * g++.dg/modules/gmf-1_[ab].C: New. + + gcc/testsuite/ + * g++.dg/modules/xtreme-header-[1-6]_c.C: New. + + gcc/cp/ + * module.cc (trees_in::key_mergeable): Avoid null deref. + (direct_import): Create attachment table. + gcc/testsuite/ + * g++.dg/modules/lambda-[23]_c.C: New. + + Merge master 50c7853216e8511971c55b51d7fe29173db4749b + +2020-04-07 Nathan Sidwell + + C++20 Ranges! + gcc/testsuite/ + * g++.dg/modules/xtreme-header-2.h: Enable in c++20 mode. + + gcc/cp/ + * module.cc (trees_{in,out}::tpl_parm_value): Stream auto + placeholder & constraints. + gcc/testsuite/ + * g++.dg/modules/lambda-4{,_[ab]}.[hHC]: New. + + _FUN with recursive types (pun intended) + gcc/cp/ + * module.cc (trees_out::key_mergeable): A lambda's static _FUN has + a recursive return type. + (trees_in::is_matching_decl): Likewise. + gcc/testsuite/ + * g++.dg/modules/lambda-4{,_[ab]}.[hHC]: New. + * g++.dg/modules/concept-6_b.C: Remove xfail. + + gcc/ + * print-tree.c (print_node): Explicitly show CALL_EXPR null arguments. + + gcc/cp/ + * module.cc (trees_out::key_mergeable): Instantiations can have + requires. Not just the template. + gcc/testsuite/ + * g++.dg/modules/concept-6{,_[ab]}.[hHC]: New. + + gcc/cp/ + * tree.c (cp_tree_equal): [CALL_EXPR] Directly check number of + arguments to a call. Assert they exist. + * typeck.c (structural_comptypes): [DECLTYPE_TYPE] Break apart if + conditional. + +2020-04-06 Nathan Sidwell + + gcc/cp + * module.cc (depset::hash::make_dependency): Imported namespaces + from a partition don't have PARTITION_P set. + (module_state::write): Likewise. + gcc/testsuite/ + * g++.dg/modules/part-5_[abc].C: New. + +2020-04-03 Nathan Sidwell + + PR c++/94476 + gcc/cp/ + * class.c (layout_class_type): Zap NSDMI of as_base fields. + gcc/testsuite/ + * g++.dg/modules/nsdmi-2.C: New. + + Merge master bcafd8748cf9eb83a9e71bf67c4e2a7c5c8f513c + + NSDMIs + WARNING causes ICES in the STL header tests. There's a trunk + NSDMI parsing bug (pr94476) + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Write FIELD_DECL initial + value. + gcc/testsuite/ + * g++.dg/modules/nsdmi-1_[ab].C: New. + + gcc/testsuite/ + * g++.dg/modules/xtreme-header-[123456]{,_[ab]}.[hHC]: New. + + gcc/ + * gcc.c (driver::maybe_print_and_exit): Shout about + experimentalness. + (driver::final_actions): Likewise. + * diagnostic.c (diagnostic_action_after_output): Likewise. + gcc/testsuite/ + * lib/prune.exp (prune_gcc_output): Prune the shouting. + + Template vars inited to lambdas + gcc/cp/ + * module.cc (depset::hash::find_dependencies): Adjust dump + predicate. + gcc/testsuite/ + * g++.dg/modules/lambda-3{,_[ab]}.[hHC]: New. + + Resurrect topological key-order sort for clusters + gcc/cp/ + * module.cc (depset::hash): Add chain, is_key_order. + (trees_out::is_key_order): New. + (trees_out::decl_value): Adjust for key-order walk. + (trees_out::{get_merge_kind,key_mergeable}): Likewise. + (depset::hash::add_dependency): Deal with key-order dependency. + (depset::hash::add_mergeable): New. + (depset::hash::find_dependencies): Adjust for key-order walk. + (cluster_cmp): Delete. + (sort_cluster): New. + (module_state::write): Call sort_cluster, not qsort (cluster_cmp). + gcc/testsuite/ + * g++.dg/modules/indirect-[234]_b.C: Adjust final scan. + * g++.dg/modules/late-ret-3_a.H: Likewise. + * g++.dg/modules/member-def-[12]_c.C: Likewise. + * g++.dg/modules/tpl-alias-1_a.H: Likewise. + * g++.dg/modules/tpl-friend-1_a.C: Likewise. + * g++.dg/modules/tpl-spec-3_[ab].C: Likewise. + * g++.dg/modules/using-7.C: Likewise. + +2020-04-02 Nathan Sidwell + + gcc/cp/ + * modules.cc (trees_out::decl_node): Treat namespaces like other + decls. + (module_state::write): When checking, insert non-imported + namespace-decls into the entity map here. + + gcc/cp/ + * modules.cc (trees_out::decl_value): Public. + (trees_out::decl_node): Do not expect by-value namespaces. + (depset::hash::find_dependencies): Deal with namespaces here. + +2020-04-01 Nathan Sidwell + + gcc/testsuite/ + * g++.dg/modules/tpl-alias-1_[ab].[HC]: Fix unresolved tests. + * g++.dg/modules/vtt-2_b.C: Likewise. + + Lambdas attached to namespace-scope non-template vars + gcc/cp/ + * cp-tree.h (DECL_ATTACHED_DECLS_P): New. + (struct lang_decl_base): Add attached_decls_p. + (maybe_attach_decl): Declare. + * lambda.c (record_lambda_scope): Call maybe_attach_decl. + * lex.c (cxx_dup_lang_specific): Clear DECL_ATTACHED_DECLS_P. + * module.c (uintset::hash::create): New member function. + (attachset, attached_tables): Declare. + (enum merge_kind): Add MK_attached. Adjust. + (trees_{in,out}::lang_decl_bools): Stream attached_decls_p. + (trees_{in,out}::decl_value): Stream attached decls. + (trees_out::get_merge_kind): Determine if MK_attached. + (trees_{in,out}::key_mergeable): Stream MK_attached. + (depset::hash::make_dependency): You can get anonymous templatey + things (lambdas). + (maybe_attach_decl): New. + (finish_module_processing): Delete attached_table. + gcc/testsuite/ + * g++.dg/modules/lambda-2_[ab].[HC]: Remove xfail, add dump scans. + +2020-03-31 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (module_streaming): Declare. + * module.cc (module_streaming): Define. + (cluster_cmp): Do not strip template off an alias instantiation. + (module_state::read_cluster): Increment module_streaming around + the loading. + * typeck.c (structural_comptypes): Do not resolve typename types + when module_streaming. + + gcc/cp/ + * pt.c (tsubst_lambda_expr): Set extra scope after creating the + lambda struct. + +2020-03-30 Nathan Sidwell + + gcc/cp/ + * modules.cc (template uintset): New template created from ... + (pendset): ... this. Use it. Adjust all uses. + +2020-03-27 Nathan Sidwell + + Merge master 62ede14d30f5d083f1ab23bcab6e0e3c9c649006 + +2020-03-26 Nathan Sidwell + + STL headers header-unity (except C++ 20 ranges) + gcc/testsuite/ + * g++.dg/modules/xtreme-header-{,_[ab]}.[hHC]: New. + + Alias templates working (properly) + gcc/cp/ + * modules.cc (enum depset::disc_bits): Add DB_ALIAS_TMPL_INST_BIT, + Replace DB_BOTH_SPEC_BIT with DB_ALIAS_SPEC_BIT. + (enum merge_kind): Replace MK_tmpl_both_mask with + MK_tmpl_alias_mask. Add MK_alias_spec. + (merge_kind_name): Adjust. + (trees_out::core_vals): DECL_TEMPLATE_RESULT might not be visited. + (trees_{in,out}::decl_value): Cope with alias template + instantiations. + (trees_out::get_merge_kind): Add alias support. + (trees_{in,out}::ket_mergeable): Add alias support. + (check_mergeable_decl): Likewise. + (trees_in::is_matching_decl): Drop inner parm, adjust. + (depset::hash::make_dependency): Add alias suport. + (depset::hash::add_specializations): Detect and mark aliases. + gcc/testsuite/ + * g++.dg/modules/tpl-alias-1{,_[ab]}.[hHC]: New. + + gcc/cp/ + * module.cc (trees_{in,out}::decl_value): Instantiations are + merged things too. + + gcc/cp/ + * module.cc (trees_{in,out}::install_entity): New, broken out of ... + (trees_{in,out}::decl_value): ... here. Call them. + +2020-03-25 Nathan Sidwell + + WARNING: This breaks lots of modules tests because an inconsistent + invariant wrt alias templates is now consistently different. This + is intended. gcc/cp/ + * cp-tree.h (SET_TYPE_TEMPLATE_INFO): Not for aliases. + * pt.c (lookup_template_class_1): Type alias's template info + should already be correct. + (tsubst_template_decl): Don't reset TI_TEMPLATE of an alias. + +2020-03-24 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (SET_TYPE_TEMPLATE_INFO): Only expand VAL once. + * pt.c (perform_typedefs_access_check) + (append_type_to_template_for_access_check): Move G_T_N_A_C call + out of loop. + (get_types_needing_access_check): Simplify. + +2020-03-23 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_{in,out}::tpl_parms_fini): Determine + contextness requirement from TPI. + + Merge master a3586eeb88414e77c7cccb69362b8d04562536b6. + +2020-03-20 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_{in,out}::tpl_parms_fini): Flag whether + tpl-tpl-parm context is non-null. + +2020-03-19 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_in::decl_value): No need to install constraints + for duplicate. + (trees_in::is_matching_decl): Open code comparison, don't use + decls_match. + + gcc/cp/ + * module.cc (trees_{in,out}::{read,write}_function_def): Potential + cexprs have result == error_mark_node. + + gcc/cp/ + * module.cc (trees_in::decl_value): Template instantiations are + never implicit member fns. + (module_state_config::get_dialect): Check exceptions, rtti, + inheriting ctors. + gcc/testsuite/ + * g++.dg/modules/inh-tmpl-ctor-1{,_[ab]}.[hHC]: New. + + Merge master 3512dc0108afbed3bece2e9fa1719fb3ce1d73d9 + +2020-03-18 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::type_node): Do ptr-mem-fns after typedef + detection. + gcc/testsuite/ + * g++.dg/modules/pmf-2{,_[ab]}.[hHC]: New. + + gcc/cp/ + * module.cc (trees_out::key_mergeable): Do not perform + requirements stubstutition. + (check_mergeable_decl): Likewise. + + gcc/cp/ + * decl.c (decls_match): Use fndecl_declared_return_type for + newdecl too. + * module.cc (trees_out::key_mergeable): Use + fndecl_declared_return_type. + (check_mergeable_decl): Likewise. + gcc/testsuite/ + * g++.dg/modules/auto-1{,_[ab]}.[hHC]: New. + +2020-03-17 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_in::is_matching_decl): Propagate instantiated + noexcept specifications. + gcc/testsuite/ + * g++.dg/modules/except-3{,_[ab]}.[hHC]: New. + + gcc/cp/ + * module.cc (lazy_snum, recursive_lazy): New. + (module_state::read_language): Set lazy_snum. + (lazy_load_{binding,specializations}): Call recursive_lazy. + +2020-03-16 Nathan Sidwell + + gcc/cp/ + * module.cc (elf_in::defrost): Return bool. + (module_state::from): May return NULL. + (module_state::maybe_completed_reading): New, broken out of + check_read. + (pendset::lazy_load): Likewise. + (module_state::write): Do not read partitions here. + (module_state::read_initial): Do not create slurp or elf_in here. + (module_state::load_{preprocessor,language}): Return bool, add + outermost flag. Adjust check_read calls. + (module_state::load_section): Reimplement, check mc_slot, issue + errors here. + (module_state::check_read): Reimplement for use by config loaders. + (module_state::do_import): Add outermost flag, alloc slurping + here. Adjust check_read call. + (module_state::lazy_load): Thin wrapper on load_section. + (module_state::lazy_load_binding): Check error emission here and + diagnose. + (module_state::lazy_load_specializations): Likewise. + (direct_import, preprocess_module): Adjust. + gcc/testsuite/ + * g++.dg/modules/leg-merge-4_c.C: Adjust regexp matching + + gcc/cp/ + * doc/invoke.texi (C++ Modules): Clarify a couple of things. + +2020-03-13 Nathan Sidwell + + gcc/cp/ + * name-lookup.c (lookup_field_ident): Check TYPE_LANG_SPECIFIC + before getting the member vector. + gcc/testsuite/ + * g++.dg/modules/pmf-1{,_[ab]}.[hHC]: New. + + gcc/cp/ + * pt.c (template_args_equal): Slight refactor to clarify control + flow. + * tree.c (cp_tree_equal): Use comp_template_args for TREE_VEC. + * typeck.c (structural_comptypes): Comment about exception specs. + + Ranges, you were right, have a biscuit! + gcc/testsuite/ + * g++.dg/modules/odr-1{,_[ab]}.[hHC]: Moved to .. + * g++.dg/modules/lambda-2{,_[ab]}.[hHC]: ... here. Xfailed + + gcc/cp/ + * module.cc (trees_in::decl_value): Set and reset constraints on + duplicate decl. + (trees_in::is_matching_decl): Use decls_match to compare decls. + gcc/testsuite/ + * g++.dg/modules/except-2{,_[ab]}.[hHC]: New. + * g++.dg/modules/builtin-4_[ab].[HC]: New. + + gcc/cp/ + * mangle.c (find_substitution): Cleanup for c++/94027 fix. + + gcc/cp/ + * module.cc (module_state::read_config): Allow overriding the + version check. + gcc/c-family/ + * c.opt (fmodule-version-ignore): New undocumented option. + +2020-03-11 Nathan Sidwell + + Bad ranges, no biscuit! + gcc/testsuite/ + * g++.dg/modules/odr-1{,_[ab]}.[hHC]: New. + +2020-03-10 Nathan Sidwell + + Reconstruct deferred exception spec types + gcc/cp/ + * cp-tree.h (fixup_deferred_exception_variants): Declare. + * tree.c (fixup_deferred_exception_variants): New. + * parser.c (cp_parser_member_declaration): Comment about friends. + (cp_parser_class_specifier_1): Call it, don't generate a new type. + (cp_parser_noexcept_specification_opt): Reorder if conditional. + gcc/testsuite/ + * g++.dg/modules/deferred-1{,_[ab]}.[hHC]: New. + + Merge master 3654d49d0ff651b2a78401bc2430428711e7d2eb + +2020-03-09 Nathan Sidwell + + Function-scope using directives + gcc/cp/ + * cp-gimplify.c (cp_genericize_r): Set DECL_CONTEXT of + IMPORTED_DECL. + * module.cc (trees_{in.out}::core_vals): Stream IMPORTED_DECL's + initial. + (trees_out::decl_node): IMPORTED_DECLs are always by value. + + Namespace aliases + gcc/cp/ + * name-lookup.c (do_namespace_alias): Set originating module. + * module.cc (trees_out::tree_node_bools): Allow namespace aliases. + (depset::hash::make_dependency): Likewise. + (depset_hash::add_namespace_entities): Likewise. + (set_instantiating_module): Likewise. + gcc/testsuite/ + * g++.dg/modules/ns-alias-1_[abc].C: New. + + gcc/cp/ + * module.cc (trees_{in,out}::vec_chained_decls): New. + (trees_{in,out}::{read,write}_class_def): Use for fields and vtables. + gcc/testsuite/ + * g++.dg/modules/vtt-2{,_[ab]}.[hHC]: New. + + gcc/cp/ + * cp-tree.h (get_mergeable_specialization_flags) + (add_mergeable_specialization): Declare. + * module.cc (trees_{in,out}::key_mergeable): Stream specialization + flags and add them as necessary. + (enum ct_decl_flags): Delete. + (module_state::{read,write}_cluster): No decl flags. + (install_specialization): Delete. + * pt.c (get_mergeable_specialization_flags): New. + (add_mergeable_specialization): New. + gcc/testsuite/ + * g++.dg/modules/partial-1{,_[ab]}.[hHC]: New. + * g++.dg/modules/tpl-spec-5_b.C: Adjust scan. + +2020-03-05 Nathan Sidwell + + gcc/cp/ + * tree.c (set_array_type_canon): Add dependent parm. + (build_cplus_array_type, cp_build_qualified_type_real) + (strip_typedefs): Pass dependent_p on. + gcc/testsuite/ + * g++.dg/modules/tpl-ary-1.h: Try constifying. + + gcc/cp/ + * cp-tree.h (cplus_build_array_type): Add known-dependent default arg. + * tree.c (cplus_build_array_type): Only calculate dependent if + unknown. Set TYPE_DEPENDENT_P on dependent arys. + * module.cc (trees_{in,out}::type_node): Serialize dependentness + of array types. + gcc/testsuite/ + * g++.dg/modules/tpl-ary-1{,_[ab]}.[hHC]: New. + +2020-03-04 Nathan Sidwell + + gcc/cp/ + * name-lookup.c (mergeable_class_entities): Check TYPE_LANG_SPECIFIC. + + gcc/cp/ + * module.cc (depset::hash::add_dependency): Only unscoped enum + usings from the enum itself are mutual dependencies. + (cluster_cmp): Cope with using decls for the same entity. + gcc/testsuite/ + * g++.dg/modules/using-7.C: New. + + gcc/cp/ + * module.cc (trees_out::core_vals): Adjust typedef detection. + (trees_{in,out}::decl_value): Likewise. + gcc/testsuite/ + * g++.dg/modules/tdef-7{,_[ab]}.[hHC]: New. + + gcc/cp/ + * module.cc (trees__out::key_mergeable): NULL name more often. + (enum merge_match): Delete. + (check_mergeable_decl): Use merge_kind instead. + (trees_in::key_mergeable): Adjust. + gcc/testsuite/ + * g++.dg/modules/merge-6_b.C: Adjust scan. + + gcc/cp/ + * module.cc (struct merge_key): simplify. + (trees_{in,out}::key_mergeable): Optimize merge_key streaming. + +2020-03-03 Nathan Sidwell + + gcc/cp/ + * module.cc (enum merge_kind): Add more discriminators. + (merge_kind_name): Adjust. + (trees_{in,out}::key_mergeable): Partition via new discriminators. + (trees_in::decl_value): Remove bad formatting. + (trees_out::get_merge_kind): Select new discriminators. + (mergeable_namespace_entity, mergeable_class_member): Fold into + reimplemented key_mergeable. + gcc/testsuite/ + * g++.dg/modules/merge-[56]_b.C: Adjust scans. + + gcc/cp/ + * module.cc (struct merge_key): Remove index as tree hack ... + (merge_key::{read,write}): ... here. + (trees_{in,out}::key_mergeable): Adjust. + + gcc/cp/ + * module.cc (merge_key::read): Remove req qualifier hack. + (check_mergeable_decl): Use merge_key, not explicit args. + (mergeable_namespace_entity, mergeable_class_member): Likewise. + (trees_in::key_mergeable): Adjust. + + gcc/cp/ + * module.cc (trees_{in,out}::decl_container): New. + (trees_in::key_mergeable): Reimplement, swallowing the merging + logic of ... + (trees_in::decl_value): ... this. + gcc/testsuite/ + * g++.dg/modules/builtin-[13]_a.C: Adjust scans. + * g++.dg/modules/indirect-[234]_b.C: Likewise. + * g++.dg/modules/inst-[23]_a.C: Likewise. + + gcc/cp/ + * module.cc (trees_{in,out}::fn_arg_types): Delete. + (struct merge_key): New. + (trees_out::key_mergeable): Use merge_key. + (trees_out::key_mergeable): #ifdef out. + (trees_in::decl_value): Adjust key handling. + +2020-03-02 Nathan Sidwell + + gcc/cp/ + * name-lookup.h (mergeable_namespace_entity) + (mergeable_class_member): Don't declare. + * name-lookup.c (check_mergeable_decl, mergeable_namespace_entity) + (mergeable_class_member): Move to ... + * module.cc (check_mergeable_decl, mergeable_namespace_entity) + (mergeable_class_member): ... here. + + gcc/cp/ + * decl2.c (c_parse_final_cleanups): Revert previous change. + * name-lookup.h (mergeable_{namespace,class}_entities): Declare. + (add_mergeable_namespace_entity): Declare. + * name-lookup.c (member_vec_dedup): Link stat_hack chain. + (check_module_override): Do not use check_mergeable_decl. + (mergeable_{namespace,class}_entities): New. + (add_mergeable): Rename to ... + (add_mergeable_namespace_entitity): ... here. + (mergeable_{namespace,class}_entity): Use new accessors. + +2020-02-28 Nathan Sidwell + + gcc/cp/ + * module.cc (struct note_def_cache_hasher): New type. + (note_defs): Use it, set GTY((cache)). + (trees_{in,out}::assert_definition): Adjust. + (module_state::write, init_module_processing): Adjust note_defs + construction. + + gcc/cp/ + * module.cc (c_parse_final_c_cleanups): Don't complain about + unsynthesized defaulted members in a header unit, and pick a + privileged clone to complain about when we do. + gcc/testsuite/ + * g++.dg/modules/imp-member-3.H: New. + + gcc/cp/ + * module.cc (trees_(in,out)::fn_arg_types): Serialize ref + parmness. + (trees_out::key_mergeable): Adjust. + * name-lookup.c (check_mergeable_decl): Check ref parmness. + (mergeable_class_member): __as_base not found via name lookup. + gcc/testsuite/ + * g++.dg/modules/merge-15{,_[ab]}.[hHC]: New. + + Merge master 9d2d283367a407c1ba9ecdb8590f9295828e25f8 + +2020-02-27 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::decl_value): FIELD_DECLS can have + template_info. + (member_owned_by_class): Likewise. + gcc/testsuite/ + * g++.dg/modules/merge-14{,_[ab]}.[hHC]: New. + +2020-02-26 Nathan Sidwell + + gcc/cp/ + * decl.c (build_typename_type): Refactor. + * module.cc (trees_out::decl_value): Class-scope using-decls are + like fields. + (trees_out::key_mergeable): Using-decls are like anonymous fields. + (trees_{in,out}::{read,write}_class_def): Beware of + typename_type's TYPE_DECL in the member vec. + (trees_out::mark_class_def): Mark using-decls. + (depset::hash::make_dependency): Assert not a class-scope + using-decl. + * name-lookup.c (mergeable_class_member): Using-decls can be + indexed. + ({get,lookup}_field_ident): Using-decls are like fields. + gcc/testsuite/ + * g++.dg/modules/indirect-2_c.C: Adjust scans. + * g++.dg/modules/merge-13{,_[ab]}.[hHC]: New. + +2020-02-25 Nathan Sidwell + + gcc/testsuite/ + * g++.dg/modules/string-1_[ab].[CH]: Enable in c++20 mode. + + gcc/testsuite/ + * g++.dg/modules/merge-12{,_[ab]}.[hHC]: New. + + gcc/cp/ + * typeck.c (structural_comptypes): Deal with TYPE_ARGUMENT_PACK. + gcc/testsuite/ + * g++.dg/concepts/pack-1.C: New. + + PR c++/93761 + gcc/cp/ + * module.cc (begin_header_unit): New, broken out of ... + (module_begin_main_file): ... here. Call it when not + preprocessed. + (init_module_processing): Call it when preprocessed. + gcc/testsuite/ + * g++.dg/modules/preproc-1.C: New. + + gcc/testsuite/ + * g++.dg/modules/atom-decl-2.C: Use dg-prune. + * g++.dg/modules/atom-pragma-3.C: Likewise. + * g++.dg/modules/mod-decl-1.C: Likewise. + * g++.dg/modules/mod-decl-3.C: Likewise. + * g++.dg/modules/indirect-1_c.C: Remove dg-bogii. + * g++.dg/modules/part-3_c.C: Likewise. + + Global module constraint merging + gcc/cp/ + * module.cc (trees_out::decl_value): Always stream constraints. + (trees_in::decl_value): Likewise, deal with requires in merge key. + (trees_{in,out}::key_mergeable): Stream requires. + * name-lookup.c (check_mergeable_decl): Add & check requires. + (check_module_override): Get requires. + (mergeable_namespace_entity): Add requires. + (mergeable_class_member): Likewise. + (make_namespace_finish): Adjust. + * name-lookup.h (mergeable_namespace_entity): Add requires. + (mergeable_class_member): Likewise. + gcc/testsuite/ + * g++.dg/modules/concept-5{,_[ab]}.[hHC]: New. + +2020-02-24 Nathan Sidwell + + Implement US033 + gcc/cp/ + * module.cc (import_module): Check language-linkage depth. + * parser.c (cp_parser_import_declaration): Check if direct + language linkage. + gcc/testsuite/ + * g++.dg/modules/inc-xlate-1_d.C: Delete. + * g++.dg/modules/lang-1_[abc].[HC]: New. + * g++.dg/modules/lang-2_[ab].C: New. + + Merge master 3841739c29a54c0141c3156cdd47891c258b2b88 + +2020-02-22 Nathan Sidwell + + libcpp/ + * lex.c (cpp_directives_only): Commonize ' & " peeking, add + cpp-number vs raw-string detection. + gcc/testsuite/ + * c-c++-common/cpp/dir-only-7.c: Add test. + +2020-02-19 Nathan Sidwell + + libcpp/ + * lex.c (cp_directive_only_process): Deal with raw strings by + backtracking. + +2020-02-14 Nathan Sidwell + + libcpp/ + * lex.c (cpp_directive_only_process): Cope with number + punctuators. + gcc/testsuite/ + * c-c++-common/cpp/dir-only-8.c: New. + +2020-02-12 Nathan Sidwell + + gcc/cp/ + * Make-lang.in (MODULE_REVISION): Add branch name. + +2020-02-11 Nathan Sidwell + + gcc/c-family/ + * c-opts.c (c_finish_options): Builtins & command-line starts at + 1. + (cb_file_change): Alter detection of main file start. + * c-ppoutput.c (print_line_1): Don't nadger line zero. + gcc/testsuite/ + * g++.dg/modules/dir-only-3.C: Update line nos + * g++.dg/modules/dir-only-4.C: New. + + gcc/c-family/ + * c-optsc (c_common_post_options): Set module_directives + regardless of preprocessed state. + gcc/cp/ + * parser.c (cp_parser_skip_to_pragma_eol): Don't explode on + meeting actual EOF. + gcc/testsuite/ + * g++.dg/modules/dir-only-3.C: New. + + Merge master a6ee556c7659877bb59b719f11ca2153e86ded59 + +2020-02-10 Nathan Sidwell + + libcpp/ + lex.c (do_peek_prev): New. + (cpp_directive_only_process): Peek backwards from 'R' to check it + is a raw literal. + gcc/testsuite/ + * c-c++-common/cpp/dir-only-7.c: Extend. + +2020-02-08 Nathan Sidwell + + libcpp/ + lex.c (_cpp_lex_direct): PRAGMA_EOL is never pre-padded. + (cpp_directive_only_process): Emit line marker after module + control-line. + gcc/ + * langhooks.h (struct lang_hooks): Add PT_flags enum. + gcc/c-family/ + * c-ppoutput.c (token_streamer): Add begin_pragma. + (token_streamer::stream): Remove out-of-pragma EOL procesing. + Ignore pragma_eol location. + (scan_translation_unit): Pay attention to filter return flags. + (directives_only_cb): Likewise. + gcc/cp/ + * lex.c: Inlude langhooks. + (coro::resume): Return pragma begin flag. + gcc/testsuite/ + * g++.dg/modules/dir-only-2_b.c: Add broken line check. + + gcc/ + * langhooks (struct lang_hooks): preprocess_token takes and + returns a uintptr_t. + gcc/cp/ + * cp-tree.h (module_token_{pre,cdtor,lang}): Change cookie type. + * lex.c (module_token_{pre,cdtor,lang}): Change cookie type. + * parser.c (cp_lexer_new): Likewise. + gcc/c-family/ + * c-ppoutput.c (scan_translation_unit): Adjust lang hook use. + (class do_streamer): Likewise. + (scan_translation_unit_directives_only): Likewise. + +2020-02-08 Nathan Sidwell + + libcpp/ + * lex.c (cpp_directive_only_process): Relax raw string detection. + +2020-02-07 Nathan Sidwell + + libcpp/ + * lex.c (cpp_directive_only_process): Re-reimplement. + + libcpp/ + * lex.c (cpp_maybe_module_directive): Use 'module control-line' + here ... + gcc/cp/ + * parser.c (cp_parser_diagnose_invalid_type_name): ... here ... + (cp_parser_import_declaration): ... and here. + + libcpp/ + * internal/cpplib.h (cpp_clear_if_stack): Don't declare. + * directives.c (cpp_clear_if_stack): Delete. + + Merge master 82aee6dd61e2a5b4e4b124f896c8403169688f41 + + -fdirectives-only (a bit buggy) + gcc/c-family/ + * c-ppoutput.c (token_streamer::stream): Adust PRAGMA_EOL. + (class_do_streamer): New. + (directives_only_cb): Extend for token streaming. + (scan_translation_unit_directives_only): Pay attention to + preprocess lang_hook. + (print_line_1): Ignore UNKNOWN_LOCATIONs. + libcpp/ + * include/cpplib.h (cpp_directives_only): Add cpp_reader to + callback. + * lex.c (do_peek_{backslash,next,ident,module): New. + (cpp_directive_only_preprocess): Add module peeking. + gcc/testsuite/ + * g++.dg/modules/dir-only-2_[ab].[CH]: New. + + gcc/c-family/ + * c-ppoutput.c (class token_streamer): New class, swallow guts of + ... + (scan_translation_unit): ... this. Use it. + +2020-02-06 Nathan Sidwell + + libcpp/ + * include/cpplib.h (enum CPP_DO_task): New. + (cpp_directive_only_process): Adjust prototype. + * lex.c (cpp_directives_only_process): Take data pointer and + generic callback, adjust. + gcc/c-family/ + * c-ppoutput.c (print_lines_directives_only): Replace with ... + (directives_only_cb): ... this new function. + (scan_directive_only_preprocess): Adjust call. + + libcpp/ + * lex.c (cpp_directive_only_process): Simplify raw string lexing. + + libcpp/ + * lex.c (cpp_directive_only_process): Add raw string lexing. + gcc/testsuite/ + * c-c++-common/cpp/dir-only-7.c: New. + +2020-02-05 Nathan Sidwell + + Merge master fa0c6e297b22d5883857d0db4a6a8be0967cb16f + + libcpp/ + * directives-only.c: Delete. + * Makefile.in: Remove it. + * include/cpplib.h (cpp_directives_only_process): Declare. + * internal.h (struct _cpp_dir_only): Delete. + (_cpp_preprocess_dir_only): Delete. + * lex.c (cpp_directive_only_process): New implementation. + gcc/c-family/ + * c-ppoutput.c (print_lines_directive_only): lines is unsigned. + (scan_translation_unit_directives_only): Reimplement. + gcc/testsuite/ + * gcc.dg/cpp: Move directives-only tests to ... + * c-c++-common/cpp: ... here. + +2020-02-04 Nathan Sidwell + + gcc/cp/ + * parser.c (cp_parser_import_declaration): Be stricter about preamble. + gcc/testsuite/ + g++.dg/modules/atom-decl-2.C: Adjust diagnostics. + g++.dg/modules/atom-pragma-3.C: Likewise. + g++.dg/modules/exp-xlate-1_b.C: Likewise. + g++.dg/modules/inc-xlate-1_e.C: Likewise. + g++.dg/modules/atom-preamble-2_f.C: New. + + gcc/cp/ + * module.cc (preprocess_module): Don't load header unit if not + preprocessing. Always close and reopen the line map spans. + libcpp/ + * include/cpplib.h (cpp_get_options, cpp_get_callbacks) + (cpp_get_deps): Mark as PURE. + + gcc/cp/ + * module.cc (module_state::do_import): Drop deps handling here. + (preprocess_module): Mark interface. + (preprocessed_module): Correct dependency generation. + (finish_module_processing): Drop deps handling here. + libcpp/ + * mkdeps.c (make_write): Note Make 4.3's &: targets + + gcc/cp/ + * module.cc (MODULE_UNKNOWN_PARTITION): Delete. + (module_state::read_imports): Drop special partition detection. + (module_state::read_partitions): Drop special partition setting. + (module_translate_include): Use main_source_loc for mapper. + ({init,fini}_module_processing): Likewise. + + gcc/cp/ + * lex.c (module_token_cdtor): Call preprocessed_module on + teardown here ... + * parser.c (cp_lexer_new_main): ... not here. + * module.cc (struct module_state): Drop from_loc. Use loc in most + places. + (module_state::{maybe_create_loc,attach,is_detached): Delete. + (module_state::is_rooted): New. Use it in place of is_detached. + (module_state::imported_from): New. + (module_state::do_import): Create module loc here ... + (direct_import): ... not here ... + (preprocess_module): ... or here. + (import_module): Reparent here. + (module_cpp_undef): Check flag_header_unit. + (module_begin_main_file): Do not declare_module here ... + (preprocessed_module): ... do it here. + + gcc/cp/ + * module.cc (module_state::direct_import): Delete. + (module_state::do_import): Only ever do initial read. + (direct_import): New non-member fn. + ({import,declare}_module): Call it. + (preprocess_module): Call do_import. + + gcc/cp/ + * module.cc (struct module_state): Cleanly separate module kind + flags from module use flags. + +2020-02-03 Nathan Sidwell + + gcc/cp/ + * module.cc (struct module_state): Drop primary_p & + from_partition_p. Map uses to module_p and partition_direct_p. + + gcc/cp/ + * module.cc (struct module_state): Add load_state, not flags. + Remove imported_p, lazy_{preprocessor,language}_p. + (module_state::read_{imports,preprocessor,language}): Adjust. + (module_state::{check_read,{do,direct}_import}): Adjust. + ({declare,preprocess}_module): Adjust. + + gcc/cp/ + * cp-tree.h (module_normal_import_p): Delete. + * module.cc (struct module_state): Rationalize flags. + (module_normal_import_p): Delete. + (module_state::direct_import): Don't save and restore line state + here. + (import_module): Just for language. + (preprocess_module): Save line state here. + * parser.c (cp_parser_import_declaration): Adjust. + (cp_parser_declaration_seq_opt): Drop superflous pragma parsing. + + gcc/cp/ + * parser.c (cp_parser_import_declaration): Diagnose include + translation in purview. Emit not about module-directive control lines. + gcc/testsuite/ + * g++.dg/modules/inc-xlate-1_e.C: New. + +2020-02-02 Nathan Sidwell + + libcpp/ + * internal.h (struct spec_nodes): Transpose n_modules array. + * init.c (post_options): Adjust n_modules array access. + * lex.c (cpp_maybe_module_directive): Remove supurfluous state and + laziness. + gcc/ + * module.cc (module_translate_include): Add __translated attribute. + * parser.c (cp_parser_translation_unit): Move translated + diagnostic to ... + (cp_parser_import_declaration): ... here. Still disabled. + (cp_parser_module_export): Check for following module directive. + gcc/testsuite/ + * g++.dg/modules/exp-xlate-1_b.C: Remove xfail, adjust errors. + * g++.dg/modules/inc-xlate-1_b.H: Adjust final scans. + * g++.dg/modules/legacy-[35]_[bcd].[CH]: Adjust final scans. + +2020-01-31 Nathan Sidwell + + libcpp/ + * include/cpplib.h (NODE_MODULE): New. + (struct cpp_hashnode): Reserve another flag bit. + * internal.h (struct spec_nodes): Replace separate module spec + nodes by array. + (_cpp_setup_module_directive): Delete. + * init (post_options): Adjust module node initialization. + * directives.c (_cpp_setup_module_directive): Delete, move into ... + * lex.c (cpp_maybe_module_directive): ... here. New, absorb + peeking from ... + (_cpp_lex_token): ... here. Call it. + + Merge master b92709388b9aee52db3cd7c227818e0ecccda2e5 + + gcc/cp/ + * parser.c (cp_parser_skip_to_end_of_statement): Adjust pragma + skipping. + (cp_parser_skip_to_end_of_block_or_statement): Likewise. + + Fix PRAGMA_EOL location + libcpp/ + * lex.c (_cpp_lex_direct): Return CPP_PRAGMA_EOL at end of line. + gcc/cp/ + * lex.c (token_coro::resume): No need to handle in-pragma EOF. + * parser.c (cp_parser_skip_to_pragma_eol): Likewise. + (cp_parser_omp_declare_simd, cp_parser_omp_declare_reduction) + (cp_parser_oacc_routine, cp_parser_initial_pragma, pragma_lex): Likewise. + gcc/c-family/ + * c-ppoutput.c (scan_translation_unit): Ignore CPP_PRAGMA_EOL in + not a pragma. + gcc/testsuite/ + * c-c++-common/cpp/pragma-eof.c: New. + + Implement p1857, part 3 + gcc/cp/ + * cp-tree.h (module_preprocess, import_module_pre): Replace with ... + (preprocess_module): ... this. + (import_module_lang): Replace with ... + (import_module): ... this. + (preprocessed_module): Declare. + (process_deferred_imports): Delete. + * lex.c (struct token_coro): Report via preprocess_module. + (module_token_pre): Call preprocessed_module on teardown. + * module.cc (module_state::module_p): New flag. + (main_source_loc): New. + (pending_imports): Delete. + (module_state::direct_import): Do not get filename here. + (import_module_lang): Replace with ... + (import_module): Drop attach logic. + (declare_module): Adjust. + (module_preprocess, import_module_pre): Replace with ... + (preprocess_module): ... this. Do attach logic here. + (preprocessed_module): New. Do deps and module server name comms. + (process_deferred_imports): Delete. + * parser.c (cp_lexer_new_main): Call preprocessed_module when + done. + (cp_parser_translation_unit): Drop deferred imports logic. + (cp_parser_import_declaration): Adjust. + gcc/testsuite/ + * g++.dg/modules/atom-preamble-2_d.C: Remove xfail. + * g++.dg/modules/bad-mapper-1.C: Adjust diagnostic loc. + * g++.dg/modules/bad-mapper-2.C: Likewise. + * g++.dg/modules/bad-mapper-3.C: Likewise. + * g++.dg/modules/map-2.C: Likewise. + +2020-01-30 Nathan Sidwell + + Implement p1857, part 2 + libcpp/ + * include/line-map.h (linemap_module_reparent): Declare. + * line-map.c (linemap_module_reparent): New. + gcc/cp/ + * cp-lang.c (LANG_HOOKS_PREPROCESS_TOKEN): Adjust. + * cp-tree.h (module_preprocess_token): Rename to ... + (module_token_pre): ... here. + (module_token_{cdtor,lang}): Declare. + (module_map_header): Delete. + (module_preprocess): Adjust parameters. + (import_module): Delete, replace with ... + (import_modile_{pre,lang}): ... these. + (declare_module): Return void. + * lex.c (struct token_coro): New, broken out of ... + (module_preprocess_token): ... here. Replace with ... + (module_token_{pre,lang,cdtor}): ... these. + * module.cc (module_state::read_location): Deal with early-read + partition locations. + (module_state::direct_import): Always preserve line map. Take + for_cpp arg. + (import_module): Break into ... + (import_module_{pre,lang}): ... these. Disable pending imports. + (declare_module): Adjust. + (module_map_header): Delete. + (module_preprocess): Do not change module array. Return primary + module. + * parser.c (cp_lexer_tokenize): Delete. + (cp_lexer_new_main): New, resurrected from trunk. Tokenize the + whole buffer. Call the token coro. + (cp_parser_skip_to_closing_parenthesis_1): Deal with falling into + a module pseudo-pragma. + (cp_parser_skip_to_end_of_{,block_or_}statement): Likewise. + (cp_parser_translation_unit): Drop the incremental tokenization. + (cp_parser_module_name): Drop KIND parameter. + (cp_parser_module_directive_end): New. + (cp_parser_{import,module}_declaration): Adjust. + (cp_parser_declaration): Deal with (badly placed) import or module + declarations. + (cp_parser_toplevel_declaration): Restore PRAGMA parsing. + (c_parse_file): PCHness handled in cp_lexer_new_main, use it. + gcc/testsuite/ + * g++.dg/modules/atom-decl-2.C: Adjust expected error + * g++.dg/modules/atom-pragma-3.C: Likewise. + * g++.dg/modules/exp-xlate-1_b.C: Likewise. + * g++.dg/modules/mod-decl-1.C: Likewise. + * g++.dg/modules/p0713-2.C: Likewise. + * g++.dg/modules/p0713-3.C: Likewise. + * g++.dg/modules/atom-preamble-2_d.C: Temporary XFAIL + * g++.dg/modules/unnamed-1_b.C: Adjust output scan + + gcc/cp/ + * parser.c (cp_lexer_alloc): Remove pch finalizing. + (cp_parser_skip_to_closing_parenthesis_1): Deal with falling into + a CPP_PRAGMA. + (cp_parser_skip_to_end_of_{,block_or_}statement): Likewise. + (cp_parser_skip_to_pragma_eol): Don't consume CPP_EOF. + (cp_parser_new): Take a lexer, don't create it here. + (cp_parser_declaration): Just point at peeked tokens, don't copy. + (cp_parser_block_declaration): Likewise. + (cp_parser_initial_pragma): Don't get the first token. + (c_parse_file): Do it here, and finalize pch. + + libcpp/ + * lex.c (_cpp_lex_direct): Set location of PRAGMA_EOL. + gcc/testsuite/ + * g++.dg/modules/exp-xlate-1_b.C: Add xfailed bogus-error. + * g++.dg/modules/cpp-2_c.C: Adjust output scan. + * g++.dg/modules/cpp-5_c.C: Likewise. + * g++.dg/modules/legacy-3_b.H: Likewise. + * g++.dg/modules/legacy-3_c.H: Likewise. + * g++.dg/modules/legacy-6_c.C: Likewise. + * g++.dg/modules/legacy-6_d.C: likewise. + +2020-01-27 Nathan Sidwell + + gcc/ + * langhooks.h (preprocess_token): Take a const cpp_token pointer. + gcc/c-family/ + * (c-ppoutput.c (scan_translation_unit): Preprocess lang hook + doesn't alter the token. + + gcc/cp/ + * cp-tree.h (module_preprocess_token): Take const cpp_token + pointer. + * lex.c (module_preprocess_token): Take const cpp_token. + +2020-01-24 Nathan Sidwell + + Merge master a1f6eff20e3bb32c5051e77093ee28faec2abca0 + + gcc/c-family/ + * c-common.h (enum rid): Remove non-underbarred module RIDs. + * c-common.c (c_common_reswords): Remove non-underbarred module keywords. + gcc/cp/ + * lex.c (init_reswords): Module keywords are keywords. + * parser.c (cp_lexer_tokenize): Look for keywords. + (cp_parser_translation_unit): Likewise. + gcc/testsuite/ + * g++.dg/modules/exp-xlate-1_b.C: Remove bogus xfail. + +2020-01-23 Nathan Sidwell + + libcpp/ + * expr.c (parse_defined): Fixup for modules. + (parse_has_include): Remove controlling macro nonsense. + + Implement p1857, part 1 + libcpp/ + * internal.h (struct lexer_state): Add directive_file_token field. + (struct spec_nodes): Add module directive nodes. + (_cpp_setup_module_directive): Declare. + * include/cpplib.h (struct cpp_options): Add module_directives field. + * directives.c (_cpp_setup_module_directive): New. + * init.c (post_options): Provess module_directives option. + * lex.c (_cpp_lex_token): Add module directive handling. + * macro.c (cpp_get_token_1): Add directive_file_token handling. + gcc/cp/ + * lex.c (module_preprocess_token): Reimplement. + * parser.c (cp_lexer_tokenize): Module lines end in + CPP_PRAGMA_EOL. + (cp_lexer_not_macro): Delete. + (cp_parser_module_directive_end): New. + (cp_parser_diagnose_invalid_typename): Adjust. + (cp_parser_translation_unit): Adjust. + (cp_parser_{module,import}_declaration): Adjust. + gcc/c-family/ + * c-common.h (enum rid): Add RID__MODULE and co. + * c-common.c (c_common_reswords): Add __module and co. + * c-lex.c (c_lex_with_flags): Adjust CPP_HEADER_NAME handling. + * c-opts.c (c_common_post_options): Set module_directives option. + gcc/testsuite/ + * g++.dg/modules/anon-2_b.C: Adjust error/scans. + * g++.dg/modules/atom-preamble-1.C: Likewise. + * g++.dg/modules/atom-preamble-3.C: Likewise. + * g++.dg/modules/cpp-2_c.C: Likewise. + * g++.dg/modules/cpp-5_b.C: Likewise. + * g++.dg/modules/cpp-5_c.C: Likewise. + * g++.dg/modules/dep-2.C: Likewise. + * g++.dg/modules/keyword-1_b.C: Likewise. + * g++.dg/modules/legacy-3_b.H: Likewise. + * g++.dg/modules/legacy-3_c.H: Likewise. + * g++.dg/modules/legacy-6_c.C: Likewise. + * g++.dg/modules/legacy-6_d.C: Likewise. + * g++.dg/modules/mod-decl-0-2a.C: Likewise. + * g++.dg/modules/mod-decl-0.C: Likewise. + * g++.dg/modules/mod-decl-1.C: Likewise. + * g++.dg/modules/mod-decl-3.C: Likewise. + * g++.dg/modules/token-1.C: Likewise. + * g++.dg/modules/token-2_b.C: Likewise. + * g++.dg/modules/token-3.C: Likewise. + * g++.dg/modules/token-4.C: Likewise. + * g++.dg/modules/exp-xlate-1_b.C: XFAIL + * g++.dg/modules/inc-xlate-1_d.C: XFAIL + +2020-01-21 Nathan Sidwell + + gcc/cp/ + * modules.cc (slurping::remap_module): Return unsigned, use zero + for error case. + (trees_in::tree_node): Adjust. + (module_state::read_{namespace,pendings}): Likewise. + (module_state::read_{preprocessor,language}): Likewise. + + gcc/cp/ + * modules.cc (struct module_state): Add + lazy_{preprocessor,language}_p fields. + (module_state::read): Delete, move into do_import. + (module_state::read_preprocessor): Be idempotent. Read direct + imports here. Set header bitmap bits. + (module_state::read_language): Likwise, set import/export bits. + (module_state::check_read): Adjust file closing condition. + (module_state::set_import): Do not deal with header bitmaps here. + (module_state::do_import): Do the initial read (only) here. + (module_state::direct_import): Do the preprocessor and language + reading here. + + gcc/cp/ + * modules.cc (slurping::remap_module): Encode import directness in + remap array. + (module_state::read_imports): Adjust. + (module_state::read_initial): Likewise. + +2020-01-20 Nathan Sidwell + + Merge master 3a43459715e239fb8043bf64b830aaf1a9802180. + Coroutines committed. + +2020-01-17 Nathan Sidwell + + Merge master bf09d886a4be1031f7003073115af6cbc5575353. + +2020-01-16 Nathan Sidwell + + gcc/cp/ + * module.cc (module_state::write_macros): Always write a set of + defs. + (module_state::read_macros): Adjust. + (module_state::read): Only read preprocessor for header unit. + (module_state::read_preprocessor): Assert am header. + + gcc/cp/ + * module.cc (module_state::{read,write}_counts): New. Broken out + of ... + (module_state::{read,write}_config): ... here. + (enum module_state_counts): New. + (module_state::write_cluster): Take lwm,hwm pair. + (module_state::read_{bindings,entities,inits}): Adjust. + (module_state::write): Write counts. + (module_state::read_{preprocessor,language}): Read counts. + + gcc/cp/ + * module.cc (slurping::slurping): Set current to ~0u. + (module_state::read_{initial,preprocessor,language}): New, broken + out of ... + (module_state::read): ... here. Call them. + +2020-01-15 Nathan Sidwell + + Merge master. + gcc/cp/ + * module.cc (depset::traits): Add empty_zero_p. + +2020-01-13 Nathan Sidwell + + gcc/cp/ + * Make-lang.in (MODULE_REVISION): SVN's dead, man. + +2020-01-10 Nathan Sidwell + + Merge trunk r280131. + Bye bye SVN, I'm sure the farm upstate will be fine. + +2020-01-06 Nathan Sidwell + + Merge trunk r279868. + +2020-01-03 Nathan Sidwell + + Header unit deduplication milestone + gcc/testsuite/ + * g++.dg/modules/string-1_{a.H,b.C}: New. + + gcc/cp/ + * module.cc (trees_in::decl_value): Disambiguate entity_ary slots + from entuty_hash slots. + (trees_out::get_merge_kind): Check of + uninstantiated_template_friend even when there's a depset. + + gcc/cp/ + * module.cc (trees_in::tree_value): Return existing. + gcc/testsuite/ + * g++.dg/modules/merge-11{.h,_a.H,_b.C}: New. + + gcc/cp/ + * module.cc (trees_out::get_merge_kind): Detect bitfield storage + unit. + (trees_out::key_mergeable): Deal with anonymous bitfields. + * name-lookup.c (mergeable_class_member): Likewise. + gcc/testsuite/ + * g++.dg/modules/merge-10{.h,_a.H,_b.C}: New. + + gcc/ + * tree.h (DECL_ALIGN_RAW): New, use it in accessors. + (DCL_WARN_IF_NOT_ALIGN): Likewise. + gcc/cp/ + * cp-tree.h (CPTI_CONST_TYPE_INFO_TYPE,CPTI_TYPE_INFO_PTR_TYPE): + Move to after module hwm. + * module.cc (trees_out::write_class_def): Don't write empty thunk + lists. + (trees_in::read_class_def): Merge fields from a duplicate. + gcc/testsuite/ + * g++.dg/modules/tinfo-2_{a.h,b.C}: New. + * g++.dg/modules/member-def-1_c.C: Adjust scan. + * g++.dg/modules/merge-9.h: Add another builtin. + + gcc/cp/ + * module.cc (module_state::read_cluster): Set cfun->returns_struct + approprately. + + gcc/cp/ + * module.cc (import_entity_module): Cope with exported entities. + +2020-01-02 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (CPTI_ALIGN_TYPE): Not a global tree. + gcc/testsuite/ + * g++.dg/modules/merge-9{.h,_a.H,_b.C}: New. + + gcc/cp/ + * module.cc (nodel_decl_hash): Rename to ... + (duplicate_hash): ... here. Allow binfos. + (trees_{in,out}::binfo_mergeable): New. + (trees_{in,out}::tree_node): Use it for tt_binfo. + (trees_{in,out}::tree_value): Use to dedup binfos. + gcc/testsuite/ + * g++.dg/modules/merge-8{.h,_a.H,_b.C}: New. + + gcc/cp/ + * module.cc (trees_{in,out}::tree_binfo): Delete. + (trees_{in,out}::tree_node): Use binfo chain to find binfo. + + Merge trunk r279811. + Update all the years! + + Merge trunk r279809. + That's 2019 done. + + Merge trunk r279556. + gcc/ + * diagnostic-core.h (progname): Resolve conflict. + + Merge trunk r279555. + + Merge trunk r279473. + + Apply trunk r279473. + gcc/cp/ + * constexpr.cc (check_constexpr_fundef): Clear non-potential + result before registering. + + Merge trunk r279472. + +2019-12-19 Nathan Sidwell + + Typeof merging + gcc/cp/ + * ptree.c (cxx_print_type): Print TYPEOF_TYPE & BASES types. + * typeck.c (structural_comptypes): Add TYPEOF_TYPE. + gcc/testsuite/ + * g++.dg/modules/merge-7{.h,_a.H,_b.C}: New. + + Anonymous templates are a thing. + gcc/cp/ + * module.cc (trees_out::key_mergeable): Deal with anon templatey + members. + * name-lookup.c (mergeable_class_member): Likewise. + gcc/testsuite/ + * g++.dg/modules/merge-6{.h,_a.H,_b.C}: New. + + gcc/cp/ + * module.cc (trees_in::decl_value): Fix enum-context merging. + gcc/testsuite/ + * g++.dg/modules/merge-5{.h,_a.H,_b.C}: New. + + gcc/cp/ + * module.cc (trees_out::key_mergeable): Fix indentation. + + gcc/cp/ + * name-lookup.c (mergeable_class_member): Get to class template + correctly. + gcc/testsuite/ + * g++.dg/modules/merge-4{.h,_a.H,_b.C}: New. + + gcc/cp/ + * module.cc (trees_in::install_implicit_member): Fix parm type thinko. + gcc/testsuite/ + * g++.dg/modules/imp-member-1_a.C: Fix scan. + * g++.dg/modules/imp-member-2_[abc].C: New. + +2019-12-18 Nathan Sidwell + + Installation of implicit member fns. + gcc/cp/ + * module.cc (trees_in::install_implicit_member): New. + (trees_in::decl_value): Implicit member functions may be dups. + Call install_implicit_member. + gcc/testsuite/ + * g++.dg/modules/imp-member-1_[abcde].C: New. + +2019-12-17 Nathan Sidwell + + Out-of-class member function definitions + gcc/cp/ + * decl.c (begin_function_body): RAII. + * lex.c (cxx_dup_lang_specific): Clear IMPORT_P and PARTITION_P. + * module.cc (module_state::is_matching_decl): Add inner parm. + Propagate inline & externalness. + (module_state::write): Read all partition entities. + * parser.c (cp_parser_function_definition_after_decl): Set + defining module as appropriate. + gcc/testsuite/ + * g++.dg/modules/member-def-2_[abcd].C: New. + + Out-of-class member class definitions + gcc/cp/ + * cp-tree.h (DECL_MODULE_PENDING_MEMBERS_P): New. + (lang_decl_base): Add module_pending_members_p. + (lazy_load_members): Declare. + * module.cc (depset::entity_kind): Add EK_INNER_DECL. + (depset::disc_bits): Add DB_IS_MEMBER_BIT. + (depset::is_member): New. + (module_state::write_cluster): Take ref to module_state_config. + Adjust. + (module_state::{read,write}_specializations): Rename to ... + (module_stte::{read,write}_pendings): Generalize to pending + members. + (trees_in::decl_val): Deal with pending members. + (depset::hash::make_dependency): Adjust for EK_INNER_DECL. + (depset::hash::add_class_entities): Add them. + (struct module_state_config): Rename num_specializations -> + num_pendings. Adjust throughout. + (module_state::read_entities): Shift snum another bit. + (module_sttate::lazy_load): Likewise. + (lazy_load_members): New. + * name-lookup.c (maybe_lazily_declare): Load pending members. + gcc/testsuite/ + * g++.dg/modules/member-def-1_[abcd].C: New. + + gcc/cp/ + * cp-tree.h (set_defining_module): New. + * decl.c (xref_tag_1): Check can redeclare, set instantiating + module. + (start_enum): Likewise. + * module.c: Update doc preamble. + (module_may_redeclare): Get to the template. + (set_defining_module): New, broken out of ... + (set_instantiating_module): ... here. DO NOT CALL IT. + * rtti.c (init_rtti_processing): "type_info" has exportedness. + * semantics.c (begin_class_definition): Check can redeclare. Set + defining & instantiating. + gcc/testsuite/ + * g++.dg/modules/friend-5_[ab].C: New. + * g++.dg/modules/tdef-4_[bc].C: Add comments. + +2019-12-13 Nathan Sidwell + + Merge trunk r279384. + + gcc/cp/ + * module.cc: Rename specset to pendset. Document. + + Pending specializations keyed by ident + gcc/cp/ + * cp-tree.h (DECL_TEMPLATE_LAZY_SPECIALIZATIONS_P): Delete. + (MODULE_VECTOR_LAZY_SPEC_P): Delete. + (MODULE_VECTOR_PENDING_{SPECIALIZATIONS,IS_HEADER,IS_PARTITION}_P): New. + (DECL_MODULE_PENDINGSPECIALIZATIONS_P): New. + (lang_decl_base): Add module_specializations_p. + (lazy_specializations_p): Declare. + * name-lookup.h (note_pending_specializations): No return value. + (load_pending_specializations): Declare. + (note_loaded_specializations): Delete. + * module.cc (specset): Key is entity ident. Adjust throughout. + (trees_in::decl_value): Deal with pending specializations. + (specset::lazy_load): Deal with indirections. + (module_state::{read,write}_specializations): Reimplement. + (lazy_specializations_p): New. + (lazy_load_specializations): Reimplement. + * name-lookup.c (mark_pending_on_{decl,binding}): Delete. + (set_module_binding): Drop lazy specialization tagging here. + (note_pending_specializations): Reimplement. + (load_pending_specializations): New. + (note_loaded_specializations): Delete. + * pt.c (lookup_template_class_1): Reimplement lazy specialization + loading. + (instantiate_template_1): Likewise. + gcc/testsuite/ + * g++.dg/modules/inst-4_[ab].C: Adjust scans. + * g++.dg/modules/tpl-spec-[12345]_[abcd].C: Likewise. + + gcc/cp/ + * cp-tree.h (DECL_MODULE_ENTITY_P): New. + (lang_decl_bas): Add module_entity_p flag. + * module.cc (trees_in::decl_value): Insert according to + DECL_MODULE_ENTITY_P. + * lex.c (cxx_dup_lang_specific): Clear DECL_MODULE_ENTITY_P. + +2019-12-12 Nathan Sidwell + + gcc/cp/ + * module.cc (class specset): Make ns an mc_slot. + (specset::hash::add): Adjust. + (specset::hash::lookup): Rename to ... + (specset::hash::extract): ... here. Adjust. + (specset::lazy_load): New. + (module_state::read_entities): Adjust lazy setting. + (module_state::read_specializations): Adjust hash table adding. + (lazy_load_binding): Reorder dump stacking. + (lazy_load_specializations): Likewise, call specset::lazy_load. + + gcc/cp/ + * cp-tree.h (DECL_MODULE_PARTITION_P): Update doc. + * module.cc (trees_in::decl_value): Only set + DECL_MODULE_PARTITION_P when primary interface. + + gcc/cp/ + * decl.c (lookup_and_check_tag): Refactor. + + gcc/cp/ + * module.cc (import_entity_index): Use different fail value. + (dumper::impl::nested_name): Don't explode on bad import indices. + (module_state::write): Adjust. + gcc/testsuite/ + * g++.dg/modules/part-4_[abc].C: New. + +2019-12-06 Nathan Sidwell + + gcc/cp/ + * module.cc (maybe_strip_cmi_prefix): Simplify. + + gcc/cp/ + * module.cc (trees_out::key_mergeable): Remove unreachable code. + + gcc/cp/ + * module.cc (enum tree_tag): Delete tt_friend_template. + (trees_out::decl_node): Uninstantiated template friends are not + special. + (trees_in::tree_node): Delete tt_friend_template handling. + (trees_{in,out}::{read,write}_class_def): No need to stream + template friends specially. + (trees_out::mark_class_def): No need to mark class_def members. + (depset::hash::make_dependency): Do not confuse uninstantiated + template friends with scope members. + gcc/testsuite/ + * g++.dg/modules/tpl-friend-2_a.C: Adjust scan. + + gcc/cp/ + * module.cc (trees_out::mark_class_def): No need to mark friend + specializations. + + gcc/cp/ + * decl.c (duplicate_decls): Just zap the template's module info. + * pt.c (build_template_decl): No need to copy false module info. + (tsubst_tenplate_decl): Just zap the template's module info. + + gcc/cp/ + * module.cc (trees_out::decl_{node,value}): Remove cluster biasing. + (depset::hash::make_dependency): Likewise. + (module_state::write_{cluster,{namespace{,s}}): Likewise. + (module_state::write_{entities,specializations}): Likewise. + (module_state::write): Likewise. + + (gcc/cp/ + * module.cc (trees_out::decl_value): No need to look for dep again. + + gcc/cp/ + * module.cc (trees_out::decl_node): Get entity index & origin from + the depset. + (depset::hash::make_dependency): Stash the importing index & + origin in the depset. + (module_state::write_namespace): Get index & origin from the depset. + + Structured bindings, c++2a libstdc++ is back working + gcc/cp/ + * module.cc (trees_{in,out}::lang_decl_{bools,vals}): Handle + lds_decomp. + gcc/testsuite/ + * g++.dg/modules/decomp-1_[ab].C: New. + + Merge trunk r279023. + libstdc++ c++2a is now using structured bindings, and those don't + work :( + +2019-12-05 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::hash::add_namespace_context): New. + (trees_out::decl_node): Use it for namespace. + (depset::hash::make_dependency): Likewise for discovered GMF. + (depset::hash::add_binding): Use it. + (depset::tarjan::connect): Make sure we don't wander into imports. + (depset::hash::connect): Don't add imports to the graph. + (module_state::write_namespace{,s}): Never meet global namespace. + (module_state::write_entries): Handle namespace entries + separately. + (module_state::write): Reorganize cluster traversals. + + gcc/cp/ + * module.cc (depset::hash::add_dependency): Do not depend on + imports. + (depset::tarjen::connect): Assert more. + (depset::hash::connect): Add less. + (module_state::write): Fewer cases. + gcc/testsuite/ + * g++.dg/modules/vmort-2_b.C: Invert scan test. + + gcc/cp/ + * module.cc (depset::{make,add}_dependency): Drop is_import parm, + update all callers. + (will_be_import): Delete. + (trees_out::decl_node): Determine will be import locally. + (depset::make_dependency): Likewise. + + gcc/cp/ + * cp-tree.h (DECL_MODULE_PARTITION_P): New. + (lang_decl_base): Add module_partition_p. + * decl.c (duplicate_decls): Adjust. + * pt.c (build_template_decl, tsubst_template_decl): Adjust. + * module.cc (will_be_import): Assert consistency. + (trees_in::decl_value): Set module_partition_p. + (depset::hash::make_dependency): Assert consistency. + (set_instantiating_module): Clear it. + + One Beellion Modules! + gcc/cp/ + * cp-tree.h (lang_decl_base): Replace module_origin field with + module_import_p flag. + * modules.cc (MODULE_UNKNOWN{,_PARTITION}): Adjust. + (MODULE_LIMIT): Delete. + (module_state): Make mod & remap unsigneds. + (module_state::read): No need to check module overflow. + + gcc/cp/ + * module.cc (macro_import::slot) Adjust encoding to use fewer + bits. + (macro_import::append): Add defness parm. + (macro_import::exported): Always make definition. + (maybe_add_macro): Adjust. + (module_state::{write,install}_macros): Likewise. + (module_state::deferred_macro): Likewise. + + Module index no longer on the decl itself. + gcc/cp/ + * cp-tree.h (DECL_MODULE_ORIGIN): Delete. + (DECL_MODULE_IMPORT_P): New. + (get_importing_module): Declare. + * decl.c (duplicate_decls): Replace DECL_MODULE_ORIGIN with + DECL_MODULE_IMPORT_P. + * decl2.c (no_linkage_error): Likewise. + * module.cc + (will_be_import):Move later, use import_entity_{index,module}. + (import_entity_index): Add null_ok parm. + (dumper::impl::nested_name): Use import_entity_{index,module}. + (trees_in::decl_value): Set DECL_MODULE_IMPORT_P. + (trees_out::decl_node): Use will_be_import. + (depset::hash::make_dependency): Check import_p flag. + (depset::hash::add_specializations): Delete assert. + (module_state::{read,write}_namespaces): Check DECL_MODULE_IMPORT_P. + (module_state::write_specializations): Likewise. + (get_originating_module): Use get_importing_module. + (get_importing_module): New. + (module_may_redeclare): Lookup the module index. + (set_instantiating_module): Clear DECL_MODULE_IMPORT_P. + (finish_module_processing): Leep the entity_map. + * name-lookup.c (name_lookup::search_adl): Use + get_importing_module. + (add_imported_namespace): Set DECL_MODULE_IMPORT_P. + * pt.c (build_template_decl): Copy DECL_MODULE_IMPORT_P, not + ORIGIN. + (tsubst_template_decl): Likewise. + * ptree.c (cxx_print_decl): Use get_importing_module. + + gcc/cp/ + * name-lookup.h (add_imported_namespace): Origin is unsigned. + * name-lookup.c (add_imported_namespace): Origin is unsigned and + non-zero. Elide unreachable code. + + gcc/cp/ + * cp-tree.h (get_instantiating_module_decl): Delete. + (get_instantiating_module): Delete. + * module.cc (depset::hash::add_specialization): Remove assert. + (get_instantiating_module_decl): Delete. + (get_instantiating_module): Delete. + + gcc/cp/ + * module.cc (trees_in::{enum ,get_}{dup,ord}ness): Delete. + (trees_in::{odr,is}_duplicate): New. + (trees_in::read_{function,var,class,enum}_def): Adjust. + (module_state::read_cluster): Adjust. + + gcc/cp/ + * decl.c (duplicate_decls): Pass the old decl to + module_may_redeclare. + * module.cc (module_may_redeclare): Expect the decl, not its + owner. + + gcc/cp/ + * module.cc (trees_out::decl_node): Move is_import test into + non-streaming block. Check the decl, not the instantiator. + +2019-12-04 Nathan Sidwell + + Elrond is dead, long live Elrond! + + gcc/cp/ + * module.cc (trees_out::decl_node): Refactor, removing duplicate + code blocks. + + Delete unreachable code + gcc/cp/ + * module.cc (enum tree_tag): Delete tt_named, + tt_implicit_template. + (trees_out::decl_node): Remove #if'd out code. + (trees_in::tree_node): Remove tt_named, tt_implicit_template + handling. + (trees_out::key_mergeable): Remove unreachable anon-type case. + (trees_out::{write,mark}_class_def) Removed #if'd out code. + (trees_in::read_class_def): Likewise. + * name-lookup.c (get_binding_or_decl): Delete. + (lookup_by_type, lookup_ident, get_lookup_ident): Delete. + * name-lookup.h (lookup_by_type, lookup_ident, get_lookup_ident): + Don't declare. + + Class members by index. + gcc/cp/ + * decl.c (duplicate_decls): Repropagate module origin & purview. + * friend.c (add_friend): Potential code, so I don't forget it. + * module.cc (depset): Delete DB_MERGEABLE_BIT. + (find_enum_member): New. + (trees_out::decl_value): Separate different mergeable matching + cases. Add new ones. + (trees_out::decl_node): Stream class members by index. Adjust + identifier streaming. + (trees_in::decl_node): Deal with conv_op_identifier. Use + find_enum_member. + (trees_out::get_merge_kind): Add DECL parm, deal with via_ctx and + local_friends. + (trees_out::key_mergeable): Swap parms, deal with new kinds. + (trees_in::key_mergeable): Deal with new kinds. + (trees_{in,out}::{read,write}_class_def): Don't stream member + definitions. + (trees_out::mark_class_def): Don't mark members. + (depset::hash::make_dependency): Don't mark as mergeable. + (cluster_cmp): Compare by stripped UID. + (get_{instantiating,originating}_module_decl): Deal with fields, + usings and local friends. + * name-lookup.c (enum merge_match): New. + (check_mergeable_decl): Add match kind parm. + (match_mergeable_decl): Rename to ... + (mergeable_namespace_entity): ... here. Deal with namespace scope + entities. + (mergeable_class_member): New. + (make_namespace_finish): Adjust. + * name-lookup.h (match_mergeable_decl): Rename to ... + (mergeable_namespace_entity): ... here. + (mergeable_class_member): Declare. + gcc/testsuite/ + * g++.dg/modules/friend-1_a.C: Adjust scans. + * g++.dg/modules/indirect-[1234]_[bc].C: Likewise. + * g++.dg/modules/inst-3_a.C: Likewise. + * g++.dg/modules/tpl-friend-[12]_a.C: Likewise. + * g++.dg/modules/tpl-spec-[45]_a.C: Likewise. + * g++.dg/modules/vmort-2_a.C: Likewise. + * g++.dg/modules/internal-1.C: Add xfailed dg-bogus + * g++.dg/modules/thunk-1_a.C: Avoid implicit member problem. + +2019-12-02 Nathan Sidwell + + gcc/cp/ + * module.cc (dumper::impl::nested_name): Add 'template ' + disambiguator. + (trees_out::add_indirect_tpl_parms): Check if streaming before + dumping. + gcc/testsuite/ + * g++.dg/modules/indirect-[234]_[bc].C: Adjust scans. + * g++.dg/modules/inst-3_b.C: Likewise. + * g++.dg/modules/late-ret-[23]_[ac].[HC]: Likewise. + * g++.dg/modules/tpl-friend-[12]_a.C: Likewise. + * g++.dg/modules/tpl-spec-[1245]_[abcd].C: Likewise. + +2019-11-27 Nathan Sidwell + + gcc/cp/ + * module.cc (will_be_import): New. + (depset::hash::make_dependency): Add is_import parm, rather than + calculate. Update all callers. + (depset::hash::add_dependency): Likewise. + + gcc/cp/ + * module.cc (trees_out::decl_node): Untangle namespace-scope + emission from class-scope. + (trees_in::tree_node): Fix tt_entity ident signedness. + (depset::hash::make_dependency): Check is_import before checking + GMF reachability. + + gcc/cp/ + * module.cc (trees_out::decl_node): Refactor function scope + & specialization emission. + + gcc/cp/ + * module.cc (trees_out::decl_node): Deal with function scope + before instantiations. + +2019-11-26 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::decl_node): Tag and add indirects for + uninstantiated template friend. + (trees_in::tree_node): Likewise. + + gcc/cp/ + * module.cc (trees_out::decl_node): Remove a scope. + + gcc/cp/ + * module.cc (depset): Delete EK_UNNAMED, EK_MAYBE_SPEC. + (trees_out::decl_node): Use EK_DECL for those. + (depset::hash::make_dependency): Likewise. + gcc/testsuite/ + * g++.dg/modules/tpl-friend-[12]_a.C: Adjust scans. + * g++.dg/modules/tpl-spec-5_a.C: Likewise. + * g++.dg/modules/vmort-2_a.C: Likewise. + + gcc/cp/ + * module.cc (trees_out::decl_node): Assert more. + + gcc/cp/ + * module.cc (module_state::check_read): Simplify to print once per + import. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Stream _EXPR operands in + forward order. + (trees_out::decl_node): Move NULL DECL_CONTEXT handling to ... + (trees_out::tree_node): ... here. + +2019-11-25 Nathan Sidwell + + gcc/cp/ + * module.cc (struct unnamed_entity): Delete. + + gcc/cp/ + * name-lookup.h (get_imported_namespace): Don't delare. + * name-lookup.c (get_imported_namespace): Delete. + + Namespaces are in the entity_ary + gcc/cp/ + * module.cc (trees_out::decl_node): Namespace may be imported. + (depset::hash::make_dependency): Permit imported namespaces. + (module_state::{read,write}_namespace): New. + (module_state::{read,write}_namespaces): Adjust. + (module_state::{read,write]_bindings): Adjust. + (module_state::write): Don't count imported namespaces. + * name-lookup.c (add_imported_namespace): Mark namespace as + imported, if we made it. + gcc/testsuite/ + * g++.dg/modules/indirect-[1234]_[bc].C: Adjust scans. + * g++.dg/modules/namespace-2_a.C: Likewise. + + gcc/cp/ + * module.cc (tree_tag): Delete tt_namespace. + (trees_in::tree_node): Delete tt_namespace handling. + (module_state::{read,write}_namespaces): Adjust. + (module_state::write_entities): Delete TABLE parm. + + gcc/cp/ + * module.cc (trees_out::tree_decl): Write namespaces as tt_entity. + (module_state::write_namespaces): Adjust. + (module_state::read_namespaces): Likewise, don't return a + namespace vector. + (module_state::{read,write}_bindings): Adjust. + (module_state::{read,write}_entities): Allow namespaces. + (module_state::{read,write}): Adjust. + gcc/testsuite/ + * g++.dg/modules/indirect-[1234]_c.C: Adjust scans. + + gcc/cp/ + * module.cc (module_state::write_namespaces): Delete TABLE arg, + look at the dep[0] + (module_state::read_namespaces): Add num_spaces parm. Use it to + count iterations. + (module_State::write_bindings): Drop TABLE arg, look at dep[0]. + (struct module_state_config): Add num_namespaces field, stream it. + (module_state::{read,write}): Don't count global namespace. adjust + namespace streaming calls. + + gcc/cp/ + * module.cc (trees_out::decl_node): Add namespace dependency here. + (depset::hash::add_dependency): And here. + (space_cmp): Delete. + (module_state::write): No need to sort namespaces anymore. + + gcc/cp/ + * module.cc (depset::hash::make_dependency): Add context + dependency when discovering a new GMF binding. + (depset::hash::add_binding): Likewise when discoving a non-empty binding. + (depset::hash::finalize_dependencies): Leave binding's namespace + dependency untouched. + (module_state::write_cluster): Assert binding's namespace in in + slot zero. Adjust binding scan. + +2019-11-23 Nathan Sidwell + + gcc/cp/ + * cxx-mapper.cc (DOT_REPLACE, COLON_REPLACE): New. + (module2bmi): Use them. + gcc/testsuite/ + * g++.dg/modues/modules.exp (dg-module-cmi): Update default mapping. + +2019-11-22 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::EK_FOR_BINDING): New. + (depset::hash::make_dependency): Don't look at current. Adjust. + (depset::hash::add_dependency): Current is always live. + (depset::hash::add_binding): Don't set current. Directly depend + the binding. + (depset::hash::add_namespace_entities): Use make_dependency. + (depset::hash::add_specializations): Likewise. + + gcc/cp/ + * module.cc (depset::hash::find_entity): Rename to ... + (depset::hash::find_dependency): ... here. Update callers. + (depset::hash::add_dependency): Break apart to ... + (depset::hash::make_dependency): ... this, and ... + (depset::hash::add_dependency): ... this, adder. + (depset::hash::add_dependency): Do both. + + gcc/cp/ + * module.cc (depset::DB_PSEUDO_SPEC_BIT): Delete. + (depset::is_pseudo_spec): Delete. + (depset::add_dependency): Don't set it. + + gcc/cp/ + * module.cc (trees_out::decl_node): We should not meet imported + internal namespaces. + (module_state::{read,write}): Stream entities before namespaces. + * name-lookup.c (add_imported_namespace): Module number must not + be negative. + + gcc/cp/ + * module.cc (trees_in::lang_decl_bools): Don't set module_origin + here. + (trees_out::decl_value): Stream out entity index. Install into + entity_map. + (trees_in::decl_value): Stream in entity index. Install into + entity ary, and map (if new) + (module_state::write_cluster): Do not install into map here. + (module_state::read_cluster): ... or here. And not ary either. + gcc/testsuite/ + * g++.dg/modules/builtin-[13]_b.C: Adjust scans. + * g++.dg/modules/indirect-[123]_[bc].C: Likewise. + * g++.dg/modules/inst-[1234]_b.C: Likewise. + * g++.dg/modules/late-ret-[23]_c.C: Likewise. + * g++.dg/modules/part-3_[cd].C: Likewise. + * g++.dg/modules/tdef-6_b.C: Likewise. + + gcc/cp/ + * cp-tree.h (DECL_MODULE_IMPORT_P): #ifdef out, not yet ready + * module.cc (dumper::impl::nested_name): Don't use it. + (module_state::read_cluster): Likewise. + + gcc/cp/ + * module.cc (trees_out::decl_value): Ensure we stay in the + section. + (trees_out::mark_class_def): Do not mark non-friends on + CLASSTYPE_DECL_LIST. + +2019-11-21 Nathan Sidwell + + gcc/cp/ + * name-lookup.c (lookup_enum_member): Delete. + (get_binding_or_decl): Add missing return. + + gcc/cp/ + * name-lookup.c (get_binding_or_decl): Only class contexts. + * module.cc (trees_out::decl_node): Possible fixme. + + gcc/cp/ + * module.cc (depset::hash): Add sections member. + (module_state::write_cluster): Use it. + (module_state::write): Set it. + + gcc/cp/ + * module.cc (trees_out::decl_node): Don't strip_template checking + instantiation consistency. + (depset::hash::add_{dependency,specializations}): Likewise. + (get_originating_module_decl): Cope with template friends. Get to + the template_decl. + (get_instantiating_module_decl): Cope with template friends. Keep + the template_decl. + gcc/testsuite/ + * g++.dg/modules/pl-spec-[1245]_[abcd].C: Adjust scans. + + gcc/cp/ + * name-lookup.c (check_local_shadow): Bail out for clones. + + gcc/cp/ + * module.cc (dumper::impl:nested_name): Obnly show module on imports. + gcc/testsuite/ + * g++dg/modules: Anjust many scans. + +2019-11-20 Nathan Sidwell + + gcc/cp/ + * module.cc (tree_tag): Rename tt_enum_int, add tt_enum_decl. + (trees_out::tree_decl): Write enum consts as tt_enum_decl, not + tt_data_member. + (trees_in::tree_node): Add tt_enum_decl handling, adjust + tt_data_member handling. + + gcc/cp/ + * module.cc (module_state::lazy_load): Add diags arg, make index + unsigned. + (lazy_load_specializations): Use lazy_load. + + gcc/cp/ + * module.cc (module_state:write_cluster): Minor cleanups + gcc/testsuite/ + * g++.dg/modules/indirect-2_b.C: Adjust scans. + * g++.dg/modules/inst-3_a.C: Likewise. + * g++.dg/modules/stdio-1_a.H: Likewise. + + gcc/cp/ + * module.cc (depset:entity_kind): Reorder. + (depset::DB_REFS_UNNAMED_BIT): Delete. Remove accessor & setter. + (cluster_cmp): Order by entity_kind. + (module_state::write_cluster): A single write pass is sufficient. + gcc/testsuite/ + * g++.dg/modules/indirect-3_b.C: Adjust cluster order scan. + * g++.dg/modules/late-ret-[23]_a.H: Likewise. + + gcc/cp/ + * (class depset): Drop entity_num field. Adjust all users to use + cluster. + (module_state::write_cluster): Merge counting and marking loops. + + Expelliarmus! + gcc/cp/ + * module.cc (module_state): Delete unnamed_{lwm,num}. + (enum ct_decl_flags): Delete cdf_is_voldemort. + (module_state::write_cluster): Don't set cluster number. Drop + voldemort handling. + (module_state::read_cluster): Drop voldemort handling. + (module_state::write_specializations): Drop cluster consistency + check. + gcc/testsuite/ + * g++.dg/modules/indirect-2_b.C: Adjust scans. + * g++.dg/modules/inst-[23]_a.C: Likewise. + + Remove more unnamed remnants. + gcc/cp/ + * module.cc (module_state::write_cluster): Count specializations. + (module_state::{read,write}_unnamed): Rename to ... + (module_state::{read,write}_specializations): ... here. Drop + section numbers. Adjust calls. + (struct module_state_config): Rename num_unnamed to + num_specializations, adjust all uses. + gcc/testsuite/ + * g++.dg/modules/tpl-spec-[12345]_[ab].C: Adjust scans. + + Remove unnamed ary etc. + gcc/cp/ + * module.cc (unnamed_ary, unnamed_map_t, unnamed_map): Delete. + (module_state::read_cluster): Do not insert into unnamed_ary or + map. + (module_state::read_unnamed): Do not extend unnamed_ary. + (module_state::read): Do not set unnamed_lwm. + (module_for_unnamed): Delete. + ({init,finish}_module_processing): Do not create/destroy unnamed + ary & map. + gcc/testsuite/ + * g++.dg/modules/indirect-[23]_c.C: Adjust scans. + * g++.dg/modules/inst-[124]_b.C: Likewise. + * g++.dg/modules/late-ret-2_c.C: Likewise. + + gcc/cp/ + * module.cc (module_state::{read,write}_unnamed): Specializations + store entity index. + (lazy_load_specializations): Use the entity index. + + No more horcruxes. + gcc/cp/ + * module.cc (trees_out::decl_node): Specializations are tt_entity. + (enum cluster_tag): Delete ct_horcrux. + (module_state::write_cluster): No need to create horcruxes. + (module_state::read_cluster): No need to resurrect horcruxes. + gcc/testsuite/ + * g++.dg/modules/indirect-[24]_b.C: Adjust scans. + * g++.dg/modules/inst-[123]_[ab].C: Likewise. + * g++.dg/modules/late-ret-2_c.C: Likewise. + * g++.dg/modules/tpl-friend-5_b.C: Likewise. + +2019-11-19 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::decl_node): Process unnamed decls directly + here. + (depset::hash::add_dependency): EK_UNNAMED doesn't reference + unnamed (really). + (module_state::write_cluster): Do not preseed horcruxes for + EK_UNNAMED. Add unnamed and specializations into the entity_map. + gcc/testsuite/ + * g++.dg/modules/vmort-2_[abc].C: Adjust scans + + gcc/cp/ + * module.cc (enum tree_tag): Kill tt_anon. No longer emitted. + (import_entity_index): Do not assert imported. + (trees_out::decl_node): Always get the import_entity_index for + tt_entity. + (trees_in::tree_node): Drop tt_anon. + (module_state::write_cluster): Add the EK_DECLs to the entity_map. + + gcc/cp/ + * cp-tree.h (lazy_load_binding): Drop final parm. + * module.cc (module_state::lazy_load): Drop ns, id & outermost + parms. + (trees_in::tree_node, module_state::read_cluster): Adjust + lazy_load calls. + (module_state::read): Inhibit GC here. + (lazy_load_binding): Deal with binding dumps here. + (lazy_load_specializations): Use lazy_load_binding. + * name-lookup.c: Adjust lazy_load_binding calls. + (get_binding_or_decl): No namespace handling here. + gcc/testsuite/ + * g++.dg/modules/tpl-friend-5_b.C: Adjust scans + * g++.dg/modules/vmort-2_c.C: Likewise. + + Entities are numbered (part 1) + gcc/cp/ + * cp-tree.h (DECL_MODULE_IMPORT_P): New. + * module.cc (depset::entity_kind): Add EK_ENTITIES. + (depset::entity_num): New (temporary) field. + (enum tree_tag): Add tt_entity. + (module_state): Add entity_lwm & entity_num fields. + (module_state::lazy_load): Add index, use it. + (module_state::{read,write}_entities): New. + (module_state::{read,write}_cluster): Number the entities. + (entity_map_t, entity_map, entity_ary) New. + (import_entity_index, import_entity_module): New. + (trees_out::decl_node): Write tt_entity for namespace decls. + (trees_in::tree_node): Add tt_entity handling. + (struct module_state_config): Add num_entities field. + (module_state::{read,write}_config): Stream it. + (module_state::{read,write}: Adjust. + ({init,fini}_module_processing): Deal with entity map and ary. + * name-lookup.c (get_binding_or_decl): Mark NAMESPACE unreachable. + gcc/testsuite/ + * g++.dg/modules/{builtin,indirect}-1_b.C: Adjust scans. + * g++.dg/modules/indirect-[1234]_c.C: Likewise. + * g++.dg/modules/tpl-friend-5_b.C: Likewise. + * g++.dg/modules/unnamed-1_b.C: Likewise. + +2019-11-14 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (check_mergeable_specialization): Take spec_entry arg. + * module.cc (trees_out::decl_node): Allow CONCEPT_DECL. + (trees_out::key_mergeable): Use check_mergeable_specialization). + (specialization_add): Adjust check_mergeable_specialization call. + * pt.c (register_specialization): Remove casts. + (check_mergeable_specialization): Take spec_entry arg. + (match_mergeable_specialization): Add the specialization early. + gcc/testsuite/ + * g++.dg/modules/concept-4.H: New. + + gcc/cp/ + * cp-tree.h (lang_decl_base): Note 8-bits. + * error.c (dump_module_suffix): Bail on no DECL_CONTEXT. + * module.cc (trees_{in,out}::lang_decl_bools): Update for new + fields. + (has_definition): Deal with CONCEPT_DECL. + (trees_out::{mark,write}_definition): Concepts are like vars. + (trees_in::read_definition): Likewise. + ({get,set}_originating_module{,_decl}): Deal with CONCEPT_DECL. + * pt.c (finish_concept_definition): Set orginating module. + gcc/testsuite/ + * g++.dg/modules/concept-3_[ab].C: New. + + Merge trunk r278228. + +2019-11-01 Nathan Sidwell + + gcc/cp/ + * rtti.c ({push,pop}_abi_namespace): Save and restore module + state. + (build_dynamic_cast_1, tinfo_base_init): Adjust. + + gcc/cp/ + * module.cc (depset::hash::find_dependencies): Reach unreached + specializations. + +2019-10-31 Nathan Sidwell + + gcc/cp/ + * module.cc (module_state::read_cluster): Hack around cfun. + +2019-10-29 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out): Clean up dead code, update instrumentation. + (class_members): New global. + (depset::hash::add_writables): Rename to ... + (depset::hash::add_namespace_entities): ... this. + (depset::hash::add_class_entities): New, incomplete. + (module_state::write): Add class entities. + (set_instantiating_module): Record on the class_member list if + necessary. + + gcc/cp/ + * module.cc (trees_out::core_vals): Audit VAR_DECL, removing fixme. + +2019-10-28 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Stream more block fields. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Stream template info's + typedefs needing access checks. + + gcc/cp/ + * module.cc (depset): Correct documentation. + (walk_kind_name): Delete unused. + (trees_out::get_container): Lookup for redirect. + + gcc/cp/ + * module.cc (node_template_info): Type cannot be NULL. + + gcc/cp/ + * module.cc (trees_out::{fn_parms_ini,tpl_header}): Privatize, + resolving fixme. + (trees_out::core_vals): Resolve TEMPLATE_DECL & + TEMPLATE_PARM_INDEX fixmes. + (trees_out::tpl_parm_value): Resolve template template parm fixme. + + Merge trunk r277514. + +2019-10-25 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::type_node): Move typedef printing after + variant printing. + (trees_in::tree_node): Simplity tt_typedef_type. + + gcc/cp/ + * module.cc (trees_out::core_vals): Check if template parm has a + canonical type before processing it. + (trees_in::tpl_parm_value): Likewise. + + gcc/cp/ + * module.cc (enum tree_tag): Delete tt_typename_decl. + (trees_out::decl_node): Do not handle TYPENAME_TYPE here ... + (trees_out::type_node): ... handle them here instead. + (trees_in::tree_node): Delete tt_typename_decl, handle + TYPENAME_TYPE as a derived_type. + + gcc/cp/ + * module.cc (trees_out::decl_node): Fixup anonymous case. + + Remove mergeable sorting code. + gcc/cp/ + * module.cc (depset::hash): Delete for_mergeable, + is_for_mergeable. + (depset::hash::add_mergeable{,_horcrux}): Delete. + (trees_out::get_merge_kind): Remove for_mergeable indirection. + (trees_out::key_mergeable): Likewise. + (depset::hash::add_dependency): Remove mergeable handling. + (depset::hash::find_dependencies): Likewise. Remove #if'd out code. + (sort_mergeables): Delete. + (module_state::write_cluster): Remove #if'd out code. + +2019-10-24 Nathan Sidwell + + Turn off mergeable ordering. + gcc/cp/ + * module.cc (depset::hash::find_dependencies): No need to add + specialization keys here. + (module_state::erite_cluster): Or sort mergeables here. + gcc/testsuite/ + * g++.dg/modules/indirect-[234]_b.C: Adjust scans. + * g++.dg/modules/inst-[23]_a.C: Likewise. + * g++.dg/modules/late-ret-[23_a.H: Likewise. + * g++.dg/modules/tpl-friend-1_a.C: Likewise. + + Types always keyed by TYPE_NAME. Use TYPE_NAME not TYPE_STUB_DECL. + gcc/cp/ + * module.cc (enum merge_kind): Drop MK_linkage. + (trees_out::core_vals): Fix DECL_TEMPLATE_PARM_P thinko. + TYPE_DECLS for linkage are not regular typedefs. + (trees_{in,out}::add_indirects): Always add a TYPE_DECL's type. + (trees_{in,out}::decl_value): Write the stub_decl if it's + different. + (trees_out::{type,decl}_node): Cleanup some type_decl handling. + (trees_out::get_merge_kind): Drop MK_linkage. + (trees_{in,out}::key_mergeable): Likewise. + (trees_out::{has,write,mark}_definition): Adjust. + (trees_in::read_definition): Likewise. + gcc/testsuite/ + * g++.dg/modules/class-3_[bd].C: Adjust scans. + * g++.dg/modules/tdef-6_b..C: Adjust scans. + + gcc/cp/ + * module.cc (trees_{in,out}::tpl_parm_value): No need to stream + bound ttp's TI here. + (trees_out::get_merge_kind): Refactor anon type determination. + + Merge trunk r277416. + +2019-10-23 Nathan Sidwell + + gcc/cp/ + * module.cc (enum ct_decl_flags): Add cdf_is_defn. + (module_state::{read,write}_cluster): Don't stream definitions + separately. + + gcc/cp/ + * module.cc (get_clone_target): Assert more. + (trees_in::back_ref): Check the tree's not insane. + (trees_in::tree_node): Check the clone target is ok. + (module_state::lazy_load): Inhibit GC. + + gcc/ + * dumpfile.c (dump_begin): Move decls for RAII. + + gcc/cp/ + * module.cc (trees_{in,out}::tpl_parm_value): Don't stream tpi + here. + (trees_{in,out}::tree_value): Strip now-unreachable code. + + gcc/cp/ + * module.cc (enum tree_tag): Add tt_tpl_parm. + (trees_{in,out}::tpl_parm_value): New. + (trees_out::add_indirect_tpl_parms): Simpilfy. + (trees_out::tree_value): No template parms here. + (trees_{in,out}::tree_node): Deal with call tpl_parm_value. + + gcc/cp/ + * pt.c (reduce_template_parm_level): Attach TPI to the type or + decl. + (convert_generic_types_to_packs): Pass new type to + reduce_template_parm_level. + +2019-10-22 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_{in,out}::tpl_parms{,_fini}): Drop outer parms, + add tpl_levels. + (trees_{in,out}::tpl_header): Likewise. + (trees_{in,out}::add_indirect_tpl_parms): New. + (trees_{in,out}::add_indirects): Call them. + (trees_{in,out}:decl_value): Adjust tpl_header streaming. + (trees_{in,out}:tree_value): Adjust tpl_header streaming. + (depset::hadh::find_dependencies): Likewise. + (module_name): Don't look for current TU's parent. + +2019-10-21 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_in::back_ref): New, broken out of ... + (trees_in::tree_node): ... here. Call it multiple times. + + gcc/cp/ + * module.cc (trees_{in,out}::add_indirects): New, broken out of ... + (trees_out::decl_node, trees_in::tree_node): ... here. Call them. + (module_state::{read,write}_cluster): Call them instead of + duplicate code. + gcc/testsuite/ + * g++.dg/modules/by-name-1.C: Adjust scans. + * g++.dg/modules/class-3_[bd].C: Likewise. + * g++.dg/modules/vmort-2_c.C: Likewise. + + gcc/cp/ + * module.cc (trees_{in,out}::key_mergeable): Do not stream tpl + header of fn parms here. + (tree_{in,out}::decl_value): Stream them here ... + (depset:hash::find_dependencies): ... and here. + +2019-10-18 Nathan Sidwell + + Merge trunk r277167. + + gcc/cp/ + * module.cc (trees_out::decl_value): Excise template_parm + handling. + (trees_{in,out}::tree_value): Excise non-template-parm + tmpl/type/fn/var handling here. + + gcc/cp/ + * module.cc (dumper::impl::nested_name): Check template_parm_p + directly. + (trees_out::core_vals): Check DECL_TEMPLATE_PARM_P. + (trees_out::decl_value): Never get a DECL_TEMPLATE_PARM_P. + (trees_in::decl_value): Likewise. + (trees_out::decl_node): Send DECL_TEMPLATE_PARM_P to tree_value. + (trees_out::type_node): Simplify name detection. + (trees_out::tree_value): Allow DECL_TEMPLATE_PARM_P, but no other + tmpls/type/var/fns. + * tree.c (bind_template_template_parm): Set DECL_TEMPLATE_PARM_P.1 + + gcc/cp/ + * module.cc (dumper::impl::nested_name): Detect template parms. + (trees_{in,out}::core_vals): Don't write context of template + parms. Don't clobber template's type. + + gcc/cp/ + * module.cc (trees_{in,out}::start): Stream code if permitted. + Adjust callers. + +2019-10-17 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::tpl_parms): Assert a lot. + (depset::hash::find_dependencies, module_state::write_cluster): + Mark mergeable sort-specific points. + + gcc/cp/ + * module.cc (trees_out::decl_value): Stream thunks too. + (trees_out::decl_node): Forward all potentially mergeable decls to + decl_value. + (trees_out::tree_value): Make sure we don't get any potentially + mergeable decls. + (trees_{in,out}::tree_value): Stream template parms + via tpl_parms. + (trees_{in,out}::tpl_parms): The vector can be 0 length. + (trees_out::mark_declaration): Don't mark the template parms. + + gcc/cp/ + * module.cc (trees_{in,out}::tpl_parms): Cope with non-shared + parms. + (trees_{in,out}::tpl_parms_fini): Likewise, stream vec type. + + gcc/cp/ + * cp-objcp-common.c (cp_pushdecl): Set DECL_CONTEXT. + gcc/testsuite/ + * g++.dg/modules/builtin-3_[ab].C: New. + + gcc/cp/ + * module.cc (trees_{in,out}::decl_value): Refactor some ifs. + +2019-10-16 Nathan Sidwell + + gcc/cp/ + * decl.c (cp_make_fname_decl): Set context to global namespace, + outside functions. + (builtin_function_1): Merge into ... + (cxx_builtin_function): ... here. Nadger the decl before maybe + copying it. Set the context. + (cxx_builtin_function_ext_scope): Push to top level, then call + cxx_builtin_function. + + gcc/cp/ + * rtti.c (get_tinfo_desc): Set DECL_CONTEXT. + gcc/testsuite/ + * g++.dg/modules/tinfo-1.C: New. + + gcc/cp/ + * module.cc (enum tree_tag): Add tt_parm. + (trees_out::decl_node): Emit tt_parm for parms. + (trees_in::tree_node): Add tt_parm. + (trees_out::write_function_def): Simply tag constexpr parms & + result. + (trees_in::read_function_def): Clone the originating fn's parms & + result. + (module_state::read): Add GC points, when lazy. + +2019-10-15 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::core_vals): Don't assert template + arguments visited. + (trees_{in,out}::tpl_parms): Stream TMPL_DEPTH. + (trees_{in,out}::tpl_parms_fini): New. + (trees_{in,out}::decl_value): Don't stream template parms, use + tpl_parms_fini. + + gcc/cp/ + * module.cc (trees_out::get_container): New, broken out of ... + (trees_out::key_mergeable): ... here. Add container parm. + (trees_in::key_mergeable): Container is already set. + (trees_{in,out}::decl_value): Stream container here. + (dpset::hash::find_dependencies): Adjust mergeable walk. + gcc/testsuite/ + * g++.dg/modules/builtin-1_a.C: Adjust scan. + + Merge trunk r277002. + + Revert TYPE_LAMBDA_P, it's unnecessary churn. + gcc/cp/ + * cp-tree.h (LAMBDA_TYPE_P): Subsume TYPE_LAMBDA_P. + (TYPE_LAMBDA_P): Delete. Update all uses. + + gcc/cp/ + * module.cc (merge_kind): Add MK_local_friend. + (trees_{in,out}::tpl_parms): New. + (trees_{in,out}::tpl_header): Adjust parm streaming + (trees_{in,out}::key_mergeable): Find containing template. + +2019-10-11 Nathan Sidwell + + Merge trunk r276888. + Pull in c++20 concepts. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Don't stream function + parms here. + (trees_out::decl_value): Stream has_defn. + (trees_in::decl_value): Stream has_defn, adjust fn_parms_fini. + (trees_in::tree_value): Likewise. + (trees_{in,out}::fn_parms_init): Stream entire parms. + (trees::fn_parms_fini): Do nothing. + (trees_in::fn_parms_fini): Add has_defn, adjust. + + gcc/cp/ + * module.cc (enum walk_kind): Remove WK_merge. + (enum trees_out::tags): Remove tag_merging. + (trees_out::mark_merged): Delete. + (trees_out::{insert,ref_node}): Adjust. + (trees_out::decl_value): Insert by value immediately. + + gcc/cp/ + * optimize.c (maybe_clone_body): Allow aliasing with modules. + + gcc/cp/ + * module.cc (enum depset::entity_kind): Remove EK_CLONE. + (depset::add_clone): Delete. + (enum merge_kind): Remove MK_clone. + (depset::entity_kind_name): Adjust. + (trees_in::decl_value): No merging for clones. + (trees_out::decl_node): Remove clone dependency. + (trees_out::get_merge_kind): No clone merging. + (trees_{in,out}::key_mergeable): Likewise. + (module_state::write_cluster): Never see a clone. + + Reconstruct clones on stream in + gcc/cp/ + * module.cc (trees_out::{decl,tree}_value): Write clone info. + (trees_in::{decl,tree}_value): Reconstruct clone. + (trees_out::decl_node): Do not depend on clones. + (module_state::read_cluster): Clone bodies. + +2019-10-10 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (DECL_NEEDS_VTT_PARM_P): Delete. + (build_clones): Declare. + (ctor_omit_inherited_parms): Add exact_name default parm. + * class.c (build_clone): Add need_vtt & omit_inherited parms, do + not calculate here. + (build_clones): New function. Add need_vtt & + omit_inherited_parms. Broken out of ... + (clone_function_decl): Call build_clones. Add to method vec here. + * method.c (ctor_omit_inherited_parms): Add exact_name parm. + Detect any ctor or specific base ctor as specified. + +2019-10-09 Nathan Sidwell + + gcc/cp/ + * class.c (maybe_add_class_template_decl_list): Don't check + template-id-expr friends. + * module.cc (friend_from_decl_list): Don't stray into primary + templates. + (trees_out::{write,mark}_class_def): Adjust local friend + detection. + (trees_in::read_class_def): Likewise. + + gcc/cp/ + * cp-tree.h (DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P): New. + * module.cc (trees_{in,out}::core_vals): Stream local template + friend's DECL_CHAIN. + (trees_out::decl_node): Use DECL_UNINSTANITATED_TEMPLATE_FRIEND_P. + (trees_out::{read,write,mark}_class_def): Adjust local template + friend streaming. + * pt.c (push_template_decl_real): Set + DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P. + (tsubst_friend_function): Clear D_U_T_F_P. + + gcc/cp/ + * pt.c (push_template_decl_real): Always set DECL_CHAIN for + non-pushed friends. + +2019-10-08 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::decl_value): Check streaming before dump. + (module_name): Protect from not modules. + + gcc/cp/ + * module.cc (enum merge_kind): Rename non->unique. + (trees_out::key_mergeable): Add decl parm. Return MK_unique for + non-dep decls. + (trees_{out,out}::decl_value): Adjust. + + gcc/cp/ + * module.cc (struct nodel_decl_hash): New. + (duplicate_hash_map): New. + (trees_in::duplicates): New. + (trees_in::mergeables): Delete. + (trees_in::{,~}trees_in): Adjust. + (trees_in::{find,register,unmatched}_duplicate): New. + (trees_in::{reserve,register,unmcted}_mergeable): Delete. + (enum trees_in::dupness): Delete DUP_unique. + (trees_in::decl_value): Adjust duplicate registration. + (trees_in::get_dupness): Adjust. + (module_state::{read,write}_cluster): Don't stream mergeable count. + + gcc/cp/ + * module.cc (enum walk_kind): Rename body->value, + mergeable->merge. Delete clone, merging. + (trees_in::decl_value): Drop walk_kind parm, read merge kind + early. + (trees_in::key_mergeable): Add merge_kind parm, return bool. + (trees_out::mark_node): Rename to ... + (trees_out::mark_by_value): ... here. + (trees_out::get_merge_kind): New, broken out of ... + (trees_out::key_mergeable): ... here. Add merge_kind parm. + (trees_out::decl_value): Replace walk_kind parm with depset. + Adjust. + gcc/testsuite/ + * g++.dg/modules/scc-1.C: Adjust scan. + * g++.dg/modules/builtin-1_a.C: Adjust scan. + +2019-10-07 Nathan Sidwell + + gcc/cp/ + * module.cc (enum trees_out::tags): Delete tag_mergeable, + tag_cloned. + (trees_out::mark_mergeable): Delete. + (trees_out::{insert,ref_node}): Adjust. + (trees_out::decl_node): Look at depset to determine mergeability. + (trees_out::key_mergeable): Adjust. + (trees_in::register_mergeable): Always reserve space. + (module_state::write_cluster): Don't mark mergeable here. + + gcc/cp/ + * module.cc (trees_in::get_odrness): Check if overrun. + (trees_in::read_class_def): Add overrun protection. + * name-lookup.c (name_search::search_adl): Tweak. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Stream + decl_non_common.result for using decls. + (trees_out::decl_node): USING_DECLS are done by value. + * name-lookup.c (finish_nonmember_using_decl): Set DECL_CONTEXT. + gcc/testsuite/ + * g++.dg/modules/using-6_[ab].C: New. + + gcc/cp/ + * module.cc (enum tree_tag): Add tt_decl. + (trees_{in,out}::decl_value): Broken out of ... + (trees_{in,out}::tree_value): ... here. Deal with non mergeble + cases only. + (trees_in::tree_node): Add tt_decl. + (trees_out::decl_node): Call decl_value. + + gcc/cp/ + * module.cc (trees_out::decl_node): Refactor some instantiation + discovery. + +2019-10-04 Nathan Sidwell + + Merge trunk r276597. + + gcc/cp/ + * module.c (trees_out:decl_node): More switchification and code + movement. + + gcc/cp/ + * module.c (trees_out:decl_node): Switchify, and move some checks + before template detection. + + gcc/cp/ + * module.cc (trees_in::tree_value): Rework merge_kind switching. + (trees_{in,out}::key_mergeable): Likewise. + + gcc/cp/ + * module.cc (enum merge_kind): Reorder. + +2019-10-03 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::decl_node): Merge and reorder tinfo + streaming. + (trees_in::tree_node): Merge tinfo streaming. + + gcc/cp/ + * module.cc (depset::hash::add_dependency): Separate EK_REDIRECT + handling from EK_MAYBE_SPEC. + (get_instantiating_module_decl): Reorder checks, remove fixme. + + gcc/cp/ + * module.cc (trees_out::decl_node): Check DECL_LANG_SPECIFIC. + (depset::hash::add_dependency): Likewise. + (get_originating_module_decl): Return global_namespace for null. + (get_originating_module): Correctly handle lack of + DECL_LANG_SPECIFIC. + (set_instantiating_module): Lazily allocate lang specific. + (set_originating_module): Call set_instantiating_module. + * pt.c (build_template_decl, tsubst_template_decl): Check + DECL_LANG_SPECIFIC. + * rtti.c (tinfo_base_init): Likewise. + + gcc/cp/ + * module.cc (elf_in::{defrost,begin}): Advise random seeking. + + gcc/cp/ + * module.cc (depset::hash::add_dependency): Drop is_import arg, + update callers. Calculate it here. + + gcc/cp/ + * cp-tree.h (MODULE_SLOT_*): Move to ... + * name-lookup.c (MODULE_SLOT_*): ... here. + * module.cc (depset::hash::add_dependency): More asserts. + * pt.c (build_template_decl, tsubst_template_decl): Always + propagate from result. + +2019-10-02 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::tree_ctx): Delete, forward all callers to + tree_node. + (trees_out::tree_namespace): Delete, move into tree_decl. + (trees_out::tree_decl): Rename to ... + (trees_out::decl_node): ... this. Update caller. + + gcc/cp/ + * module.cc (trees_out::tree_type): Rename to ... + (trees_out::type_node): Drop walk_kind arg, return void. Update + callers. + + gcc/cp/ + * module.cc (trees_out::tree_ctx): Drop need_contents parm. + Update callers. + (trees_out::tree_{type,decl}: Likewise. + + gcc/cp/ + * module.cc (trees_out::tree_ctx): Drop inner_decl parm. Update + callers. + (trees_out::tree_namespace): Likewise. + + gcc/cp/ + * cp-tree.h (MK_*): Document better. + + gcc/cp/ + * cp-tree.h (MODULE_CURRENT, MODULE_IMPORT_BASE): Delete. + * module.cc: Replace with zero/one + * name-lookup.c: Likewise. + * decl2.c (no_linkage_error): Likewise. + * ptree.c (cxx_print_decl): Likewise. + + Don't equivocate GMF with module + gcc/cp/ + * cp-tree.h (MODULE_NONE, MODULE_PURVIEW): Delete. + (MODULE_CURRENT): New. + (MODULE_IMPORT_BASE): Reduce. + (DECL_MODULE_OWNER): Rename to ... + (DECL_MODULE_ORIGIN): ... this. + (DECL_MODULE_PURVIEW_P): New. + (MODULE_BITS): Reduce. + (lang_decl_base::module_purview_p): New bit. + (module_may_redeclare): Take decl. + * module.cc (MODULE_UNKNOWN_PARTITION): New. + (MODULE_LIMIT): Adjust. + (slurping::remap_module): Return int. + (trees_in::assert_definition): Adjust. + (dumper::impl::nested_name): Adjust. + (trees_{in,out}::lang_decl_bits): Stream module_purview_p. + (trees_out::tree_{namespace,decl,value}): Adjust. + (trees_in::tree_node): Adjust. + (depset::hash::add_{dependency,binding,specializations}): Adjust. + (module_state::check_not_purview): Adjust. + (module_state::read_{imports,partitions}): Adjust. + (module_state::write_{cluster,namespaces,unnamed}): Adjust. + (module_state::read_unnamed): Adjust. + (module_state::{write,read}): Adjust. + (module_visible_instantiation_path): Adjust. + (get_originating_module): Return int. + (get_instantiating_module): Adjust. + (module_may_redeclare): Reimplement. + (set_{instantating,originating}_module): Adjust. + (module_state::{do,direct}_import): Adjust. + (declare_module, module_preprocess, process_deferred_imports): Adjust. + ({init,finish}_module_processing): Adjust. + * name-lookup.c (get_fixed_binding_slot): Adjust. + (name_lookup::{search_namespace_only,adl_namespace_fns,search_adl): + Adjust. + (check_module_override, extract_module_binding): Adjust. + (note_pending_specializations): Adjust. + (get_imported_namespaxe, finish_nonmember_using_decl) + (lookup_type_scope_1): Adjust. + (add_imported_namespace): Take int. + * name-lookup.h ({add,get}_imported_namespace): Module is int. + * class.c (build_self_ref): Set instantiating module. + * decl.c (duplicate_decls): Adjust. + * decl2.c (no_linkage_error): Adjust. + * mangle.c (maybe_write_module): Adjust. + * pt.c (build_template_decl): Propagate purview flag. + (tsubst_template_decl): Likewise. + (tsubst_decl): Set instantiating_module as necessary. + * ptree.c (cxx_print_decl): Adjust, print purview flag. + * rtti.c (tinfo_base_init): Clear purview flag. + gcc/testsuite/ + * g++.dg/modules/*: Update lang dump scans. + +2019-10-01 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (set_originating_module): Add friend_p. + * decl.c (grokdeclarator): Set it. + * module.cc (get_originating_module): Always look through template + info. + (set_originating_module): Add friend_p. Assert. + (set_instantiating_module): Assert. + +2019-09-30 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (set_module_owner): Delete. + * decl.c (duplicate_decls): Propagate module owner. Set module + export for builtins, no need to set owner. + * module.cc (set_module_owner): Delete. + gcc/testsuite/ + * g++.dg/modules/isalnum.H: New. + +2019-09-27 Nathan Sidwell + + Merge trunk r276201. + + gcc/cp/ + * decl.c (fixup_anonymous_aggr): Partially revert recent change. + (grokfndecl): Call set_originating_module before determining + specialization. + (grokdeclarator): Likewise. + + gcc/cp/ + * cp-tree.h (set_{originating,instantiating}_module): Declare. + * class.c (layout_class_type): Use set_instantiating_module. + * pt.c (lookup_template_class_1): Likewise. + (tsubst_function_decl, instantiate_template_1): Likewise. + (tsubst_friend): Not here. + * decl.c (grokfndecl): Use set_originating_module. + (grokvardecl,grokdeclarator): Likewise. + * name-lookup.c (do_pushtag): Likewise. + * friend.c (do_friend): Not here. + * module.cc (set_implicit_module_origin): Rename to ... + (set_instantiating_module): ... here. + (set_originating_module): New. + gcc/testsuite/ + * g++.dg/modules/friend-3.C: New. + * g++.dg/modules/friend-4_[ab].C: New. + + gcc/cp/ + * cp-tree.h (get_module_owner): Delete. + (get_instantiating_module_decl, get_instantiating_module): Declare. + * module.cc (get_instantiating_module_decl) + (get_instantiating_module): New. + (dumper::impl::nested_name, trees_out::tree_node) + (trees_out::tree_decl, depset::hash::add_specializations) + (set_module_owner): Use them. + (get_module_owner): Delete. + + gcc/cp/ + * cp-tree.h (get_declared_module_origin): Delete. + (get_originating_module, get_originating_module_decl): Declare. + * module.cc (get_originating_module_decl): New. + (get_originating_module): New. + (module_state::write_cluster, module_visible_instantiation_path): Use + get_originating_module. + * module.cc (module_state::write_unnamed) + (lazy_load_specializations): Use get_originating_module_decl. + * error.c (dump_module_suffix): Use get_originating_module. + * mangle.c (maybe_write_module): Likewise. + * name-lookup.c (init_global_partition): Use + get_originating_module. + (name_lookup::search_adl): Use get_originating_module_decl. + * pt.c (lookup_template_class_1): Propagate DECL_MODULE_EXPORT_P. + +2019-09-26 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (DECL_MODULE_OWNER): Restrict to + var/fn/type/template/namespace. + (MAYBE_DECL_MODULE_EXPORT_P): Delete. + ({set,get}_{declared,implicit}_module_origin): Declare. + (module_name): Delete and adjust. + * modules.cc: Adjust throughout for loss of + MAYBE_DECL_MODULE_EXPORT_P. Use get_module_owner more. + (fixup_unscoped_enum_owner): Delete. + * class.c (layout_class_type): Use set_implicit_module_origin. + * decl.c (duplicate_decls): Use get_module_owner. + (finish_enum_value_list): Set DECL_MODULE_EXPORT_P directly. + * decl2.c (no_linkage_error): Use DECL_MODULE_OWNER. + * error.c (dump_module_suffix): Reimplement. + * mangle.c (maybe_write_module): Adjust. + * name-lookup.c (init_global_partition): Adjust. + (name_lookup::search_adl): Owner always has module. + (do_pushdecl): Adjust namespace exporting. + (do_nonmember_using_decl): Adjust exporting check. + * pt.c (build_template_decl): Only propagate module info when + needed. + (lookup_template_class_1): Use set_implicit_module_origin. + (tsubst_friend_function): Propagate to outer template. + (tsubst_function_decl): Use set_implicit_module_origin. + (tsubst_template_decl): Simplify tsubst if cascade. Propagate + inner module info. + (instantiate_template_1): Use set_module_owner. + * ptree.c (cxx_print_decl): Protect module info display. + gcc/testsuite/ + * g++.dg/modules/friend-1_a.C: Adjust scans. + * g++.dg/modules/indirect-[13]_[bc].C: Likewise. + * g++.dg/modules/indirect-4_b.C: Likewise. + * g++.dg/modules/late-ret-3_a.H: Likewise. + * g++.dg/modules/scc-1.C: Likewise. + * g++.dg/modules/vmort-2_[abc].C: Likewise. + +2019-09-25 Nathan Sidwell + + gcc/cp/ + * modules.cc (enum merge_kind): Rearrange. + (merge_kind_name): Adjust. + gcc/testsuite/ + * g++.dg/modules/inst_-[234]-[ab].C: Adjust scans. + * g++.dg/modules/indirect-[234]_b.C: Likewise. + +2019-09-24 Nathan Sidwell + + gcc/cp/ + * modules.cc (trees_out::tree_decl): RESULT and LABEL decls + written by value. Assert only expected things remain by name. + + gcc/cp/ + * modules.cc (enum tree_tag): Add tt_data_member. + (trees_out::tree_decl): Use it for consts and fields. + (trees_in::tree_node): Read it. + (set_implicit_module_owner): Delete. + * name-lookup.c (get_field_ident, lookup_field_ident): New. + * name-lookup.h (get_field_ident, lookup_field_ident): Declare. + * cp-tree.h (set_implicit_module_owner): Delete. + gcc/testsuite/ + * g++.dg/modules/class-3_[bd].C: Adjust scans. + * g++.dg/modules/indirect-1_c.C: Likewise. + +2019-09-23 Nathan Sidwell + + gcc/cp/ + * module.cc (depset): Add DB_BOTH_SPEC_BIT. + (specialization_add): Accept template aliases for !decl_p. + (depset::hash::add_specializations): Notice duplicate + specialization paths. + +2019-09-20 Nathan Sidwell + + gcc/cp/ + * decl.c (fixup_anonymous_aggr): Clear LAZY flags, no need to + strip out fns. + * module.cc (module_state::lazy_load): Distinguish out of order + from failure to set slot. + * name-lookup.c (get_binding_or_decl): Fixme :( + gcc/testsuite/ + * g++.dg/modules/anon-2{,_[ab]}.[hHC]: New. + +2019-09-19 Nathan Sidwell + + gcc/cp/ + * module.cc (enum merge_kind): Add MK_{decl,type}_tmpl_spec, + MK_type_partual_spec. + (tree_in::tree_value): Process them. + (trees_{in,out}::key_mergeable): Stream them. + * pt.c (match_mergeable_specialization): Only store if spec != + NULL. + gcc/testsuite/ + * g++.dg/modules/tpl-tpl-merge-[12]{,_[ab].[hHC]: New. + + gcc/cp/ + * module.cc (slurping::slurping): Init current to mostpos - 1. + (module_state::read): Increment slurp->current when done. + + gcc/cp/ + * module.cc (trees_in::tree_node): Check overrun more. + +2019-09-18 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_in::is_matching_decl): Copy + DECL_TEMPLATE_INSTANTIATED. + gcc/testsuite/ + * g++.dg/modules/inst-5_[ab].[CH]: New. + + gcc/cp/ + * module.cc (trees_in::mergeables): Vec of intptr_t. + (trees_in::register_mergeable): Return index. + (trees_in::unmatched_mergeable): New. + (trees_in::get_dupness): Drop last parm. Return DUP_bad as + necessary. Adjust callers. + (trees_in::tree_value): Call unmatched_mergeable as necessary. + + gcc/cp/ + * module.cc (trees_in): Delete skip_defns & handling. Add + any_deduping field. + (trees_in::register_mergeable): Outline. + (trees_in::{enum dupness,get_dupness}): New. + (trees_in::{enum odrness,get_odrness}): New. + (trees_in::lookup_mergeable): Delete. + (trees_in::is_existing_mergeable): Delete, use get_dupness. + (trees_in::is_skippable_defn): Delete, ise get_odrness. + (trees_in::assert_definition): Adjust. + (trees_in::read_{function,class,var,enum}_def): Adjust. + (topmost_decl): Delete. + gcc/testsuite/ + * g++.dg/modules/part-3_c.C: Adjust scans. + * g++.dg/modules/tdef-6_b.C: Adjust scans. + +2019-09-17 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_in::is_skippable_defns): Defns always complete + incomplete. + gcc/testsuite/ + * g++.dg/modules/merge-3_[ab].[CH]: New. + +2019-09-16 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::DB_TYPE_SPEC_BIT): New. + (depset::is_type_spec): New. + (enum merge_kind): Replace MK_spec with MK_decl_spec, MK_type_spec. + (merge_kind_name): Update. + (trees_in::tree_value): Partition MK_spec handling. + (trees_{in,out}::key_mergeable): Likewise. + (depset::hash::add_specialization): Set DB_TYPE_SPEC_BIT. + gcc/testsuite/ + * g++.dg/modules/indirect-[234]_b.C: Update lang dump scans. + * g++.dg/modules/inst-[234]_[ab].C: Update lang dump scans. + + gcc/cp/ + * module.cc (spec_tuple): Delete type. + (specialization_add): Adjust data type. + (depset::hash::add_specializations): Drop PARTITIONS parm. Adjust. + (module_state::write): Adjust. + + gcc/cp/ + * cp-tree.h (check_mergeable_specialization): Declare. + (match_mergeable_specialization): Add DECL_P parm, drop INSERT_P parm. + * module.cc (trees_in::tree_value): Adjust + match_mergeable_spcialization calls. + (specialization_add): Use check_mergeable_specializatio. + * pt.c (check_mergeable_specialization): New. + (match_mergeable_specialization): Always insert, reorder parms. + + gcc/cp/ + * module.cc (enum merge_kind): Add MK_linkage. + (merge_kind_name): ... and here. + (trees_in::tree_value): Add it. + (trees_{in,out}::key_mergeable): Use it. + * name-lookup.c (match_mergeable_decl): Don't add anon-enum. + gcc/testsuite/ + * g++.dg/modules/builtin-1_a.C: Adjust scan. + * g++.dg/modules/indirect-[234]_b.C: Likewise. + * g++.dg/modules/inst-[23]_a.C: Likewise. + * g++.dg/modules/tdef-6_[ab].[HC]: New. + +2019-09-15 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_in::chained_decls): No need to deal with clones here. + (trees_{in::read,out::write}_class_def): Don't chain + fields until we know we're the definition. + + Merge trunk r275727. + +2019-09-13 Nathan Sidwell + + gcc/cp/ + * name-lookup.c (get_namespace_binding): Fish out global binding, + if it's a vector. + gcc/testsuite/ + * g++.dg/modules/binding-2.H: New. + + gcc/cp/ + * cp-tree.h (MODULE_VECTOR_LAZY_SPEC_P): Use TREE_THIS_VOLATILE. + gcc/testsuite/ + * g++.dg/modules/binding-1_[abc].[HC]: New. + +2019-09-12 Nathan Sidwell + + gcc/cp/ + * cp-tree.def (UNBOUND_CLASS_TEMPLATE): Correct docs. + * cp-tree.h (make_unbound_class_template_raw): Declare. + * decl.c (make_unbound_class_template_raw): New, break out of ... + (make_unbound_class_template): ... this, call it. + * module.cc (trees_out::tree_type): Handle UNBOUND_CLASS_TEMPLATE. + (trees_in::tree_node): Likewise. + gcc/testsuite/ + * g++.dg/modules/tpl-tpl-parm-1_[ab].[HC]: New. + + gcc/cp/ + * module.cc (trees_out::core_vals): Never write template_decl's + type ... + (trees_in::tree_value): .. resurrect it here instead. + + gcc/cp/ + * module.cc: Sort many switch stmts. + +2019-09-11 Nathan Sidwell + + Merge trunk r275641. + +2019-09-09 Nathan Sidwell + + Merge trunk r275518 + + gcc/cp/ + * module.cc (enum depset::disc_bits): Delete DB_REACHED_ONCE_BIT. + (depset::is_reached_once, depset::clear_mergeable): Delete + (trees_in::tree_value): Set template typedef type. + (depset::hash::add_dependency): No reached once stuff. + (sort_mergeables): Just live with tight clusters. + gcc/testsuite/ + * g++.dg/modules/late-ret-2_a.H: Adjust scans. + * g++.dg/modules/late-ret-3_[abc].[CH]: New. + +2019-09-06 Nathan Sidwell + + gcc/cp/ + * module.cc (enum depset::disc_bits): Add DB_REACHED_ONCE_BIT. + (depset::is_reached_once, depset::clear_mergeable): New. + (depset::hash::add_dependency): Set and clear DB_REACHED_ONCE_BIT. + (sort_mergeables): Deal with internal entities. + (module_state::read_cluster): A voldemort might have been merged. + gcc/testsuite/ + * g++.dg/modules/late-ret-2_[abc].[HC]: New. + + Merge trunk r275458. + +2019-09-05 Nathan Sidwell + + gcc/testsuite/ + * g++.dg/modules/concept-2_[ab].C: New. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Stream constraint_info. + (trees_{in,out}::tree_value): Stream constrain node. + {trees_{in,out}::tpl_header): Stream parm(s) constraints. + * pt.c (set_constraints): Don't do spurious lookup. + gcc/testsuite/ + * g++.dg/modules/concept-1_[ab].C: New. + + gcc/cp/ + * module.cc (module_state::write_location): Check streaming here. + Adjust many callers. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Move some node handling + into the new switch. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Reorder part 7. + * decl.c (cp_tree_node_structure): Alphabetize. + gcc/ + * tree.c (tree_node_structure_for_code): Likewise. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Reorder part 6. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Reorder part 5. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Reorder part 4. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Reorder part 3. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Reorder part 2. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Reorder part 1. + + gcc/cp/ + * module.cc (trees_out::tree_type): There are no indescribable types. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Redo enum underlying type + streaming. + + Merge trunk r275404. + +2019-08-30 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::tree_type): Stream ptrmemfuncs at the + appropriate point. + + gcc/cp/ + * module.cc (trees_in::finish{,_type}): Delete. Move into + trees_in::tree_value, removing type remapping etc, + (trees_out::start): Check not streaming an unexpected type. + (trees_{in,out}::core_vals): Pointers are not streamed. + (trees_in::tree_value): Move remnants of finish{,_type} here & + simplify handling. + + gcc/cp/ + * module.cc (trees_out::tree_type): Write non-standard integer + types here. + (trees_in::tree_node): Read them here. + (trees_out::tree_value): We never see a naked type. + gcc/testsuite/ + * g++.dg/modules/bfield-2_[ab].C: New. + + gcc/cp/ + * module.cc (trees_{in,out}::start): Refactor switch. + (trees_{in,out}::core_vals): Remove first switch. + + gcc/cp/ + * module.cc (enum streamed_extensions): New. + (module_state::extensions): New. + (module_state::write_readme): Adjust. + (trees_{in,out}::start): Note or check openmp extension. + (module_state::{read,write}_config): Adjust. + gcc/testsuite/ + * g++.dg/modules/omp-1_c.C: New. + * g++.dg/modules/omp-2_[ab].C: New. + + gcc/cp/ + * module.cc (trees_{in,out}::start): Deal with OMP_CLAUSE. + (trees_{in,out}::core_vals): Likewise. + gcc/testsuite/ + * g++.dg/modules/omp-1_[ab].C: New. + + gcc/cp/ + * module.cc (friend_from_decl_list): Reimplement. + (trees_out::tree_decl): When streaming a local template friend + reference, make sure we find one. + + gcc/cp/ + * module.cc (enum tree_tag): Drop tt_mergeable, tt_clone. + (trees_out::tree_value): Emit tt_node & kind separately. + (trees_in::tree_node): Read tt_node kind explicitly. + +2019-08-29 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::tree_decl): VTTs are just vtables. + gcc/testsuite/ + * g++.dg/modules/vtt-1_[abc].C: New. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): We never see + TS_CP_ARGUMENT_PACK_SELECT nodes. + + Merge trunk r275034. + +2019-08-28 Nathan Sidwell + + gcc/cp/ + * module.cc (struct location_map_info): New. + (module_state::prepare_locations): Rename to ... + (module_state::prepare_maps): ... here. Return a + location_map_info. + (module_state::{read,write}_locations): Split to ... + (module_state::{read,write}_{ordinary,macro}_maps): ... here. Adjust. + (module_state::{read,write}): Split location map streaming. + gcc/testsuite/ + * g++.dg/modules/macro-7_[abc].C: New. + + Merge trunk r274992. + +2019-08-27 Nathan Sidwell + + gcc/c-family/ + * c.opt (fnote-include-translate): Renamed from finclude-translate. + gcc/ + * doc/invok.texi: Update. + gcc/cp/ + * module.cc (module_translate_include): Tweak. + +2019-08-26 Nathan Sidwell + + gcc/cp/ + * module.cc (note_includes): Renamed from inform_includes. + (module_translate_include): Emit note, not warning. + (init_module_processing, handle_module_option): Adjust. + gcc/c-family + * c.opt (finclude-translate): Renamed from -Winclude-translate. + gcc/ + * doc/invoke.texi (finclude-translate): Document. + +2019-08-25 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_in::finish): Don't clear PENDING_TEMPLATE here. + Set IDENTIFIER_VIRTUAL_P if t is a vfunc. + (trees_out::core_bools): Write PENDING_TEMPLATE as false. + gcc/testsuite/ + * g++.dg/modules/virt-1_[ab].C: New. + + gcc/cp/ + * module.cc (trees_out::tree_decl): Vtables are distinguished by + DECL_VIRTUAL_P. + +2019-08-23 Nathan Sidwell + + Merge trunk r274867. + + gcc/cp/ + * module.cc (trees_out::core_bools): Don't propagate asm_written + for types. + (trees_{in,out}::lang_type_bools): Don't stream debug_requested. + (trees_in::read_{enum,class}_def): Register for debug. + (finish_module_processing): Don't write module when syntax only. + gcc/testsuite/ + * g++.dg/modules/debug-1_[ab].C: New. + +2019-08-22 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::hash::add_dependency): We should never find a + redirect. + (depset::hash::add_redirect): Rename to ... + (depset::hash::add_partial_redirect): ... here. Mark the redirect + as unreachable. + + gcc/cp/ + * module.cc (MOD_SNAME_PFX): Resurrect initial dot. + (elf_out::strtab_write): Elide global namespace. + +2019-08-21 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_in::assert_definition): Relax already-present + assert. + + gcc/cp/ + * module.cc (finish_module_processing): Protect against null + filename. + + gcc/cp/ + * module.cc (elf_in::release): Reset size too. + (enum ct_bind_flags): Correct cbf_wrapped value. + (module_state::read_cluster): Usings may be unwrapped. + + gcc/c-family/ + * c.opt (Winclude-translate*): New family of options. + gcc/cp/ + * module.cc (inform_includes): New var. + (module_translate_include): Inform of translations. + (init_module_processing): Canonicalize inform list. + (handle_module_option): Process inform options. + + gcc/cp/ + * module.cc (set_cmi_repo): NULL means default init. + (module_mapper::module_mapper): Default init repo. + (module_mapper::translate_include): Add LEN parm, create STRING. + (canonicalize_header_name): Correctly prepend './'. + gcc/testsuite/ + * g++.dg/modules/ben-1.map: Add $root. + * g++.dg/modules/gc-2.map: Add $root. + * g++.dg/modules/map-1.map: Add $root. + * g++.dg/modules/map-1_b.map: Add $root. + +2019-08-20 Nathan Sidwell + + gcc/cp/ + * module.cc (module_state::module_state): Header must be + .-relative if not absolute. + (get_module): Validate module name more. + gcc/testsuite/ + * g++.dg/modules/map-2.{C,map}: New. + + Merge trunk r274747. + + Merge trunk r273943 (Jason's TEMPLATE_INFO changes). + + Merge trunk r273906 (Martin's function_decl.decl_type changes). + +2019-08-19 Nathan Sidwell + + Merge trunk r273771. + +2019-08-04 Nathan Sidwell + + gcc/cp/ + * name-lookup.c (get_cxx_dialect_name): Make extern. + * name-lookup.h (get_cxx_dialect_name): Declare. + * module.cc (module_state_config::get_opts): Just determine C++ + dialect. + gcc/testsuite/ + * g++.dg/modules/flag-1_[ab].C: Adjust. + +2019-08-01 Nathan Sidwell + + gcc/cp/ + * module.cc (module_state::deferred_macro): Emit warning if at end + of TU. + (finish_module_processing): Adjust. + gcc/ + * doc/invoke.texi (fforce-module-macros): Replace documentation + with ... + (Winvalid-imported-macros): ... this. + gcc/c-family/ + * c.opt (fforce-module-macros): Replace with ... + (Winvalid-imported-macros): ... this. + gcc/testsuite/ + * g++.dg/modules/macro-4_[abcdeg].C: Update. + * g++.dg/modules/macro-5_c.C: Update. + +2019-07-28 Nathan Sidwell + + gcc/cp/ + * module.cc (node_template_info): Enums may be function-local. + gcc/testsuite/ + * g++.dg/modules/enum-7.C: New. + +2019-07-27 Nathan Sidwell + + gcc/ + * doc/invoke.texi (C++ Modules): Update. + +2019-07-24 Nathan Sidwell + + Default to gcm.cache directory. + gcc/cp/ + * cxx-mapper.c (flag_root): Change default. + (module2bmi): Headers have same suffix. + (client::action): Prefix root dir to look for bmi. + gcc/ + * doc/invoke.texi (C++ Module Mapper): Update docs. + gcc/testsuite/ + * g++.dg/modules/dep-1_[ab].C: Update scans. + * g++.dg/modules/dep-2.C: Update scans. + * g++.dg/modules/modules.exp (DEFAULT_REPO): New. + (dg-module-cmi): Adjust. + + Drop import alias detection, via controlling macros. + gcc/cp/ + * module.cc (bytes_in::no_more): Delete. + (module_state::{read,write}_config): Drop controlling macro. + (module_state::write_readme): Likewise. + (module_state::read): Drop alias return. + (module_state::slurp): Delete. Replace all uses with field + access. + (module_state::resolve_alias): Delete. + (module_state::is_alias): Delete. + (module_state::read_imports): Drop alias detection. + gcc/testsuite/ + * g++.dg/modules/alias-[12]_b.C: Drop controlling macro scans. + * g++.dg/modules/macro-2_c.H: Likewise. + * g++.dg/modules/macro-3_[abc].[CH]: Likewise. + * g++.dg/modules/stdio-1_a.H: Likewise. + * g++.dg/modules/alias-3_*: Delete. + * g++.dg/modules/sys/alias-3_a.H: Delete. + + Merge trunk r273764. + + gcc/testsuite/ + * g++.dg/modules/alias-2_a.H: Add dg-module-header. + * g++.dg/modules/alias-3_a.H: Likewise. + * g++.dg/modules/mod-decl-0-2a.C: std=c++2a. + * g++.dg/modules/mod-decl-0.C: std=c++17. + * g++.dg/modules/modules.exp: Add dg-module-header, iterate over + different c++ stds. + + gcc/cp/ + * module.cc (trees_out::tree_decl): Cope with using decls in the + binding list. + gcc/testsuite/ + * g++.dg/modules/enum-6_[ab].[HC]: New. + + gcc/cp/ + * module.cc (enum merge_kind): Add MK_enum. + (trees_out::tree_decl): Deal with anon enums. + (trees_in::tree_value): Adjust for MK_enum. + (trees_{in,out}::tree_node): Adjust tt_enum_int streaming. + (trees_{in,out}::key_mergeable): Add MK_enum key. + (depset::hash::add_dependency): Enum values are like using decls. + (depset::hash::add_binding): Likewise. + (depset_cmp): Reorder for new requirements. + (enum ct_bind_flags): Add cbf_wrapped. + (sort_mergeables): Presume sorted by depset_cmp. + (module_state::{read,write}_cluster): Adjust. + * name-lookup.c (check_mergeable_decl): Deal with anon-enum + proxies. + gcc/testsuite/ + * g++.dg/modules/enum-1_a.C: Adjust scan. + +2019-07-23 Nathan Sidwell + + gcc/cp/ + * module.cc (depset): Rename MARKED to SPECIAL, update all users. + +2019-07-22 Nathan Sidwell + + gcc/cp/ + * parser.c (cp_parser_class_specifier_1): Fixup a template's type + with a late exception specifier. + gcc/testsuite/ + * g++.dg/modules/except-1.C: New. + +2019-07-22 Boris Kolpackov + + gcc/cp/ + * Make-lang.in (MODULE_REVISION): Add git rev, if it's git. + +2019-07-16 Nathan Sidwell r + + gcc/cp/ + * module.cc (module_state::read_{bindings,namespaces}): Use plain + vec + (module_state::read): Adjust. + (module_state::write_macros): Use plain vec. + (module_state::deferred_macro): Use plain vec. + + gcc/cp/ + * module.cc (depset::hash::add_writables): Use plain vec. + (typedef spec_tuple): Use plain vec. + (depset::hash::add_speciailizations): Correctly init vec. + (module_state::{read,write}_namespaces): Use plain vec. + (module_state::{read,write}): Adjust. + + Fix it better. + gcc/cp/ + * mangle.c (mangle_module_substitution): Offset overflow. + gcc/testsuite/ + * g++.dg/modules/sym-subst-3_[ab].C: Fix + * g++.dg/modules/sym-subst-[456].C: New. + + Fix module backref subst. + gcc/cp/ + * cp-tree.h (mangle_substitution): Rename to ... + (mangle_module_substitution): ... here. Drop genecity. + * mangle.c: Likewise. Fix mangling. + * module.cc (module_state::mangle): Adjust. + gcc/testsuite/ + * g++.dg/modules/sym-subst-1.C: Adjust scan. + * g++.dg/modules/sym-subst-2_[ab].C: Adjust scan. + * g++.dg/modules/sym-subst-3_[ab].C: New. + +2019-07-09 Nathan Sidwell + + gcc/c-family/ + * c-opts.c (c_common_handle_option): Remove {user,system}_search. + * c.opt ({user,system}-search): Delete. + (fmodule-header): Undeprecate. + gcc/cp/ + * module.cc (module_state_config::get_opts): Drop + OPT_fmodule_header_. + (handle_module_option): Handle fmodule-header=. + gcc/ + * gcc.c (cpp_unique_options): Drop {user,system}-search. + +2019-07-08 Nathan Sidwell + + gcc/c-family/ + * c-common.c (try_to_locate_new_include): Use strcmp and ignore + zero-line maps. + gcc/cp/ + * module.cc (finish_module_processing): Inhibit module stats if + not moduling. + +2019-07-07 Nathan Sidwell + + Merge trunk r273185. + + libcpp/ + * files.c (cpp_find_failed): Replace with ... + (cpp_found_name): ... this. + (_cpp_stack_file): Check main_search option. + * include/cpplib.h (cpp_options): Add main_search. + * internal.h (cpp_find_failed): Replace with ... + (cpp_found_name): ... this. + * init.c (cpp_read_main_file): Examine main_search option. + gcc/c-family/ + * c-opts.c (c_common_handle_options): Add OPT_{user,system}_search. + * c.opt (user-search, system-search): New. + gcc/ + * gcc.c (cpp_unique_options): Add {user,system}-search. + + gcc/ + * module.cc (module_state::write_cluster): Return cluster size. + (avalable_clusters, loaded_clusters): New static vars. + (module_state::{read,write}): Adjust. + (finish_module_processing): Dump more stats. + gcc/testsuite/ + * g++.dg/module/part-3_c.C: Adjust scan. + + gcc/ + * timevar.def (TV_MODULE_{IMPORT,EXPORT,MAPPER}): Define. + gcc/cp/ + * module.cc: Include timvar.h. Sprinkle timevar accounting throughout. + +2019-07-05 Nathan Sidwell + + Merge trunk r273146. + + Victory! + gcc/cp/ + * decl2.c (c_parse_final_cleanups): Don't do static init things + for a header module. + * module.cc (trees_in::start): Drop unused second parm. + (module_state::{read,write}_inits): New. + (trees_out::core_bools): Restrict static->extern hack. + (module_state::{read,write}_config): Note inits. + (module_state::{read,write}): Stream inits. + gcc/testsuite/ + * g++.dg/modules/iostream-1_b.C: Remove ioinit workaround. + + gcc/testsuite/ + * g++.dg/modules/iostream-1_[ab].[HC]: New. + + gcc/cp/ + * module.cc (module_state_config::get_opts): Drop -g* switches. + + gcc/cp/ + * cp-tree.h (get_tinfo_decl_direct): Declare. + * module.cc (trees_out::tree_decl): Stream more tinfo_var info. + (trees_in::tree_value): Use get_tinfo_decl_direct for tinfo vars. + * rtti.c (get_tinfo_decl_direct): Break out of ... + (get_tinfo_decl): ... here. Call it. + +2019-07-04 Nathan Sidwell + + gcc/cp/ + * module.cc (module_state::read_cluster): finalize_function may + not GC. + + gcc/cp/ + * module.cc (enum cluster_tag): Add ct_defn. + (enum ct_decl_flags): Rmove cdf_has_definition. + (module_state::{read,write}_cluster): Stream definitions after + declarations.. + + gcc/cp/ + * module.cc (trees_{in,out}::key_mergeable): Always stream context. + gcc/testsuite/ + * g++.dg/modules/merge-1_[ab].[HC]: New. + + gcc/cp/ + * module.cc (trees_out::key_mergeable): Return merge kind. + (trees_out::tree_value): Note key writing. + (trees_in::tree_value): Adjust key dump. + gcc/testsuite/ +` * g++.dg/modules/builtin-1_b.C: Adjust scans. + * g++.dg/modules/inst-[1234]_b.C: Likewise. + * g++.dg/modules/part-3_[cd].C: Likewise. + +2019-07-03 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::tree_type): Add TYPEOF_TYPE, UNDERLYING_TYPE. + (trees_in::tree_node): Likewise. + + gcc/cp/ + * module.cc (struct unnamed_entity): GTY it. + (unnamed_map): Not a GTY object. + + gcc/cp/ + * module.cc (trees_{in,out}::fn_parms): Rename to ... + (trees_{in,out}::fn_arg_types): ... this. + (trees_{in,out}::fn_parms_{init,fini}): New. + (trees_{in,out}::tree_value): Call fn_parms_fini. + (trees_{in,out}::key_mergeable): Call fn_parms_init. + gcc/testsuite/ + * g++.dg/modules/late-ret-1.H: New. + * g++.dg/modules/scc-1.C: Adjust scan. + + gcc/cp/ + * module.cc (trees_out::tree_type): Add DECLTYPE_TYPE. + (trees_in::tree_node): Likewise. + +2019-07-02 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_in::core_vals): Protect binfo base reading. + (module_state::{read,write}_cluster): Insert types for horcrucifexes. + gcc/testsuite/ + * g++.dg/modules/horcrux-1_[ab].C: New. + + gcc/testsuite/ + Rename bmi->cmi everywhere. + + gcc/cp/ + * cp-tree.h (module_has_cmi_p): Renamed. + * name-lookup.c (do_nonmember_using_decl): Adjust. + * module.cc (cmi_*): Renamed. Adjust all users. + + gcc/cp/ + * module.cc (trees_out::fn_parms): Don't use canonical type any + more. + gcc/testsuite/ + * g++.dg/modules/merge-1_[ab].C: New. + + gcc/cp/ + * module.cc (trees_out::tree_decl): Write types for typedefs. + (trees_in::tree_node): Adjust. + gcc/testsuite/ + * g++.dg/modules/tdef-5_[ab].C: New. + + gcc/cp/ + * module.cc (trees_out::tree_type): Add pack types. + (trees_{in,out}::tree_value): Tweak type streaming flags + (trees_in::tree_node): Add pack types. + + gcc/cp/ + * module.cc (trees_out::tree_type): Detect bound template template + parm. + (trees_{in,out}::tree_value): Stream type on any TYPE_DECL that + its TYPE_STUB_DECL. + + gcc/cp/ + * module.cc (trees_out::tree_type): Add COMPLEX and VECTOR types. + (trees_in::tree_node): ... and here. + + gcc/cp/ + * module.cc (trees_out::tree_decl): Deal with tinfo vars and + vtables here ... + (trees_out::tree_node): ... not here. + + gcc/cp/ + * module.cc (trees_out::tree_decl): Deal with tinfo type_decls + here. + (trees_out::tree_type): Dectect tinfo types here ... + (trees_out::tree_node): ... not here. + (trees_in::tree_node): Add tinfo type too. + +2019-07-01 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::tree_decl): Fix dump typo. + (trees_in::tree_value): Likewise. + (module_state::read_cluster): Show end. + + gcc/cp/ + * module.cc (module_state::write): Don't stream env. + + gcc/cp/ + * module.cc (trees_in:::read_function_def): Push the template for + post processing. + (module_state::read_cluster): Deal with abstract post processing. + gcc/testsuite/ + * g++.dg/modules/tpl-friend-7_[ab].C: New. + + gcc/cp/ + * module.cc (depset::hash::add_binding): Return added flag. Deal + with orphaned using decls. + (depset::hash::add_writables): Return added flag. + gcc/testsuite/ + * g++.dg/modules/using-5_[ab].C: New. + + Clones + gcc/cp/ + * module.cc (enum tree_tag): Add tt_clone_ref. + (get_clone_target): Replace get_clone_orig. + (FOR_EVERY_CLONE): New. + (trees_out::mark_mergeable): Add tag parm. Adjust. + (trees_in::chained_decls): Cope with already-linked clones. + (trees_out::tree_decl): Support clone walking. + (trees_{in,out}::tree_value): Likewise. + (trees_in::tree_node): Support tt_clone_ref. + (trees_{in,out}::key_mergeable): Key clones. + (trees_out::{mark,write}_definition): No clones here. + (trees_in::read_definition): Likewise. + (depset::hash::add_clone): Reimplement. + (module_state::write_cluster): Deal with clones. + gcc/testsuite/ + * g++.dg/modules/clone-1_[ab].C: New. + * g++.dg/modules/friend-1_a.C: Adjust scan. + * g++.dg/modules/indirect-[1234]_[bc].C: Likewise. + * g++.dg/modules/inst-3_a.C: Likewise. + +2019-06-27 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::entity_kind): Add EK_CLONE. + (depset::hash::add_clone): New. + (enum walk_kind): Move to global scope. + (enum merge_kind): New. + (trees_{in,out}::tree_value): Use new enums. + (trees_{in,out}::tree_mergeable): Likewise. + (get_clone): New. + (member_owned_by_class): Clones are never owned. + (trees_out::mark_declaration): Walk clones. + (trees_in::read_definition): Likewise. + (trees_out::write_definition): Likewise. + gcc/testsuite/ + * g++.dg/modules/builtin-1_b.C: Adjust dump scans. + * g++.dg/modules/inst-1_b.C: Adjust dump scans. + * g++.dg/modules/part-3_[cd].C: Adjust dump scans. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Stream abstract_origin. + + gcc/cp/ + * class.c (build_clone): Neaten and assert. + * cp-tree.h (lang_decl_u5.cloned_function): Fix comment. + * name-lookup.c (get_lookup_ident): Don't fall off end of overload. + + Add -Mno-modules. + gcc/c-family/ + * c-opts.c (c_common_init_options): Default module deps on. + (c_common_handle_option): Handle M{no-}modules. + * c.opt (Mmodules, Mno-modules): New options. + gcc/ + * doc/cppopts.texi (Mno-modules): Document it. + * doc/invoke.texi: Likewise. + * gcc.c (cpp_unique_options): Add it. + gcc/testsuite/ + * g++.dg/modules/dep-3.C: New. + libcpp/ + * include/cpplib.h (struct cpp_options): Add dep.modules. + * include/mkdeps.h: Include cpplib.h + (deps_write): Take a cpp_reader. + * init.c (cpp_finish): Adjust deps_write call. + * mkdeps.c: Include internal.h + (make_write): Adjust. Conditionally inhibit module output. + (deps_write): Adjust. + +2019-06-26 Nathan Sidwell + + Don't elide primary from partition names. + gcc/cp/ + * cp-tree.h (module_name): Drop maybe_primary parm. + * modules (module_state::get_flatname): Just get the flatname. + (get_primary): New. + (get_module): Expect fully qualified name. Drop parent arg. + Adjust callers. + (module_stae:set_flatname): Create fully qualified name. + (module_state::read_{imports,partitions}): Check partitions have + expected primary. + (module_state::{read,write}_config): Adjust. + (module_state::do_import, module_preprocess) + (finish_module_procesing): Adjust deps_add_module calls. + * name-lookup.c (make_namespace): Adjust anon namespace name + creation. + * ptree.c (cxx_print_decl): Adjust module_name call. + gcc/testsuite/ + * g++.dg/modules/part-2_d.c: Adjust regexp. + * g++.dg/modules/part-3_c.c: Adjust scans. + libcpp/ + * include/mkdeps.h (deps_add_module): Drop primary arg. + * mkdeps.c (deps_add_module): Drop primary arg. + + Merge trunk r272714. + + gcc/cp/ + * decl.c (duplicate_decls): Non-modules are ok for builtins. + gcc/testsuite/ + * g++.dg/modules/builtin-2.C: New. + + gcc/cp/ + * module.cc (depset::hash::add_mergeable_horcrux): Add redirect as + necessary. + gcc/testsuite/ + * g++.dg/modules/tpl-spec-7.C: New. + + gcc/cp/ + * module.cc (depset::hash::add_redirect): New. + (depset::hash::add_specialization): Use it. + (depset::hash::add_mergeable): Use it. + (depset::hash::add_dependency): Never add a redirect here. + + gcc/cp/ + * module.cc (finish_module_processing): Adjust failed to write error. + gcc/testsuite/ + * g++.dg/modules/internal-1.C: Adjust. + + gcc/cp/ + * module.cc (depset::entity_kind): Add EK_REDIRECT. + (tree_out::tree_decl): Cope with redirects. + (depset::hash::add_dependency): Likewise. + (depset::hash::add_specialization): Add redirect for partials. + (depset::hash::add_mergeable): Likewise. + (module_state::write_cluster): Assert no redirects here. + (module_state::write): Check redirects here. + gcc/testsuite/ + * g++.dg/modules/global-3_a.C: Disable. + * g++.dg/modules/tpl-spec-6_[ab].C: New. + + gcc/cp/ + * module.cc (trees_{in,out}::note_definition): Rename to ... + (trees_{in,out}::assert_definition): ... here. Update callers. + + gcc/cp/ + * cp-tree.h (match_mergeable_specialization): Add insert parm. + * pt.c (match_mergeable_specialization): Add insert parm. + * module.cc (depset::entity_kind): Add EK_MAYBE_SPEC. + (depset::disc_bits): Delete DB_FRIEND_BIT, ADD DB_PSEUDO_SPEC_BIT. + (depset::is_friend): Delete. + (depset::is_pseudo_spec): Add. + (trees_out::tree_decl): Some specializations are findable by name. + (trees_in::tree_value): Mergeables have an explicit kind. + (trees_in::tree_node): Protect more. + (trees_{in,out{::key_mergeable): Explicitly encode key kind. + (depset::hash::add_dependency): Support EK_MAYBE_SPEC. + (specialization_add): Add some consistency checking. + (depset::hash::add_specialization): Specialization might be an + import. + (depset::hash::add_mergeable_horcrux): New. + (sort_mergeables): Add horcrux deps. + (module_state::write_cluster): Don't mark cdf_is_friend. + gcc/testsuite/ + * g++.dg/modules/indirect-3_[ab].C: Reenable. Adjust scans. + +2019-06-25 Nathan Sidwell + + gcc/cp/ + * module.cc (module_state:note_cmi_name): New. + (module_state::read_config): Use it. + (module_state::check_read): Likewise. + gcc/testsuite/ + * g++.dg/modules/atom-decl-3.C: Adjust diags. + * g++.dg/modules/atom-preamble-3.C: Likewise. + * g++.dg/modules/bad-mapper-1.C: Likewise. + * g++.dg/modules/bad-mapper-3.C: Likewise. + * g++.dg/modules/circ-1_c.C: Likewise. + * g++.dg/modules/flag-1_b.C: Likewise. + * g++.dg/modules/import-2.C: Likewise. + * g++.dg/modules/mod-stamp-1_d.C: Likewise. + * g++.dg/modules/p0713-3.C: Likewise. + +2019-06-24 Nathan Sidwell + + Revert late specialization insertion. + gcc/cp + * module.cc (depset): Delete DB_OOT_SPEC_BIT. + (depset::~depset): Remove deletion. + (trees_out::key_mergeable): Assert specialization is marked. + (depset::hash::add_dependency): Assert no late specializations. + gcc/testsuite + * g++.dg/modules/modules.exp: Expand dg-module-do capabilities. + * g++.dg/modules/indirect-3_a.C: Disable. + +2019-06-23 Nathan Sidwell + + Merge trunk r272583. + +2019-06-21 Nathan Sidwell + + gcc/cp/ + * modules.cc (depset): Add DB_OOT_SPEC_BIT. + (depset::~depset): Free the spec entry if we own it. + (trees_{in,out}::note_definition): Check template result isn't + there. + (depset::hash::add_dependency): Correctly insert discovered + non-member template instantiations. + + gcc/cp/ + * modules.cc (note_defs): New checking hash table. + (trees_{in,out}::note_definition): New checkers + (trees_in::read_{function,class,var,enum}_def): Add maybe_template + arg, use it. Note definitions. + (member_owned_by_class): New, extracted from ... + (trees_out::mark_class_member): ... here. Call it. + (trees_out::write_class_def): Only write the owned definitions. + (trees_out::write_definition): Note definition. + (trees_in::read_definition): Pass maybe_template to readers. + (module_state::write): Reset note_defs hash. + (init_module_processing): Init it. + (finish_module_processing): Delete it. + + gcc/cp/ + * modules.cc (dumper::operator ()): Print indentation level. + gcc/testsuite/ + * g++.dg/modules/scc-1.C: Adjust dump scan. + + gcc/cp/ + * modules.cc (node_template_info): Enums are awkwarder. + gcc/testsuite/ + * g++.dg/modules/enum-4_[ab].C: New. + +2019-06-20 Nathan Sidwell + + Bitfields. + gcc/cp/ + * module.cc (tree_out::mark_class_def): Mark bitfield's + representative field. + gcc/testsuite/ + * g++.dg/modules/bfield-1_[ab].C: New. + + Thunks. + gcc/cp/ + * module.cc (enum tree_tag): Add tt_thunk. + (trees_out::tree_decl): Emit it. + (trees_out::tree_value): Assert we don't accidentally meet a + thunk. + (trees_in::tree_node): Read it. + (trees_out::{mark,write}_class_def): Emit thunks by value. + (trees_in::read_class_def): Install thunks. + gcc/testsuite/ + * g++.dg/modules/thunk-1_[ab].C: New. + + gcc/cp/ + * parser.c (cp_lexer_tokenize): Skip pragmas. + * lex.c (module_preprocess_token): Likewise. + gcc/testsuite/ + * g++.dg/modules/pragma-1_[ab].[HC]: New. + * g++.dg/modules/tname-spec-1_b.C: Move include earlier. + + Deconstruct types. + gcc/cp/ + * module.cc (enum tree_tag): Add tt_typename_decl, + tt_derived_type, tt_variant_type. + (trees_out::tree_decl): Stream typename types. + (trees_out::tree_type): Emit tt_{derived,variant}_type records. + (trees_in::tree_node): Add tt_typename_decl, tt_derived_type, + tt_variant_type handling. + gcc/testsuite/ + * g++.dg/modules/class-3_b.C: Adjust dump scan. + * g++.dg/modules/tname-spec-1_[ab].[HC]: New. + * g++.dg/modules/typename-1_[ab].C: New. + +2019-06-19 Nathan Sidwell + + Stream mergeables inline. + gcc/cp/ + * module.cc (depset): Add DB_MERGEABLE_BIT. + (depset::is_mergeable): New. + (depset::hash::set_for_mergeable): Delete. + (trees_{in,out}::tree_mergeable): Delete. + (tress_{in,out}::key_mergeable): New. + (trees_out::tags): New enum. + (trees_out::mark_{mergeable,merged}): New. + (trees_out::reserve_mergeable,unset_for_mergeable): Delete. + (trees_out::{insert,ref_node}): Adjust. + (trees_out::core_vals): Don't stream tpl-tpl-parm contexts. + (trees_out::tree_decl): tpl-tpl-parms not found by name. + (trees_{in,out}::tree_value): Stream merging info inline. + (trees_{in,out}::tpl_header): Take template, not parms. + (trees_out::mark_declaration): Mark the template parms. + (depset::hash::find_dependencies): Adjust mergeable walk. + (depset::hash::add_mergeable): Adjust. + (module_state::sort_mergeables): Replace with ... + (sort_mergeables): ... this. + (enum cluster_tag): Delete ct_mergeable. + (module_state::write_cluster): Determine mergable ordering + earlier. Don't write a mergeable table. + (module_state::read_cluster): No mergeables to deal with here. + (module_state::write): Move cluster member dumping to write_cluster. + * name-lookup.h (match_mergeable_decl): Drop tpl_args parm. + * name-lookup.c (check_mergeable_decl): Likewise. Update callers. + gcc/testsuite/ + * g++.dg/modules/builtin-1_a.C: Adjust dump scans. + * g++.dg/modules/friend-1_a.C: Likewise. + * g++.dg/modules/indirect-[234]_[bc].C: Likewise. + * g++.dg/modules/inst-[23]_[ab].C: Likewise. + * g++.dg/modules/part-3_[cd].C: Likewise. + * g++.dg/modules/scc-1.C: Likewise. + * g++.dg/modules/tpl-friend-[12]_a.C: Likewise. + * g++.dg/modules/tpl-spec-[12345]_[ab].C: Likewise. + * g++.dg/modules/vmort-2_b.C: Likewise. + +2019-06-18 Nathan Sidwell + + Merge trunk r272419. + + gcc/cp/ + * module.cc (specialization_cmp): Deal with more equivalencies. + (depset_cmp): New, cloned and adjusted from cluster_cmp. + (depset::hash::connect): Use it. + +2019-06-17 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::fn_parms): Stream canonical type. + (depset::hash::add_dependency): Adjust static inline check. + gcc/testsuite/ + * g++.dg/modules/mutual-friend.ii: New. + +2019-06-14 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::hash::add_dependency): Don't register + internal entities when in a header module. + (depset::hash::add_binding): Add internal entities in header modules. + gcc/testsuite/ + * g++.dg/modules/stat-tpl-1_a.H: New. + + gcc/cp/ + * module.cc (depset::hash::add_dependency): Inhibit internal + linkage setting on functions. + (cluster_cmp): We can meet matching using decls. + + gcc/cp/ + * module.cc (depset::hash::add_dependency): Unnamed elaborated + types have no linkage. + gcc/testsuite/ + * g++.dg/modules/enum-5_[ab].[HC]: New. + + gcc/cp/ + * module.cc (module_state::{read,write}_cluster): Check stat hack + is for implicit typedefs. + + gcc/cp/ + * module.cc (trees_out::tree_type): Simplify if-tree. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Stream original_type of type of + typedefs, not their type. + (trees_out::tree_type): Stream type_name of typedefs. + (trees_out::tree_value): Insert the type of a typedef. + (trees_in::tree_value): Reconstruct the type of a typedef. + gcc/testsuite/ + * g++.dg/modules/tdef-4_[abc].C: New. + * g++.dg/modules/class-3_b.C: Adjust scan. + + gcc/cp/ + * module.cc (binding_cmp): There can be an implicit and + non-implicit type_decl. + * name-lookup.c (check_mergeable_decl): Check implicitness of + type_decl. + +2019-06-13 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::hash::add_specializations): Partial + instantiations need their template. + gcc/testsuite/ + * g++.dg/modules/tpl-tpl-mem-1_[ab].C: New. + +2019-06-11 Nathan Sidwell + + Update Revision number + +2019-06-11 Nathan Sidwell + + Merge trunk r272149. + +2019-06-10 Nathan Sidwell + + gcc/cp/ + * module.cc (module_state::read_location): Don't map + UNKNOWN_LOCATION to loc. + (module_state::read_locations): Don't rely on that. + gcc/testsuite/ + * g++.dg/modules/predef-2{.h,_[ab].C}: New. + + gcc/cp/ + * module.cc (loc_spans::init): Correct macro range ordering. + (module_state::write_locations): Fix more off-by-ones. + gcc/testsuite/ + * g++.dg/modules/predef-1.[hC]: New. + +2019-06-07 Nathan Sidwell + + gcc/cp/ + * module.cc (module_state::write_env): New. + (module_state::write): Call it. + + gcc/cp/ + * Make-lang.in (REVISION_c): Don't test it. + * module.cc (module_state::write_locations): Fix off-by-one thinko. + + gcc/cp/ + * module.cc (loc_spans::init): Add lmaps parm, separate main from + forced header locs. + (loc_spans::SPAN_FIRST): New, use it for first span. + (loc_spans::SPAN_MAIN): Just after the first span. + gcc/testsuite/ + * g++.dg/modules/macro-5_[abc].[CH]: Adjust. + + gcc/cp/ + * module.cc (dumper::MACRO): New flag. + (module_state::{write,install}_macros): Use it. + (module_state::{undef,deferred}_macro): Likewise. + gcc/ + * doc.invoke (-fdump-lang): Document. + gcc/testsuite/ + * g++.dg/modules/macro-[35]_[abc].[CH]: Update. + + gcc/cp/ + * module.cc (bytes_out::print_time): New. + (module_state::write_readme): Dump some environmental data. + +2019-06-06 Nathan Sidwell + + Update Revision number + +2019-06-06 Nathan Sidwell + + gcc/cp/ + * Make-lang.in (MODULE_REVISION): Read from Changelog.modules. + +2019-06-05 Nathan Sidwell + + gcc/cp/ + * module.cc (dumper::MAPPER): New flag. Use it on mapper things. + (dumper::push): Only do blank line when starting a new module + nest. + + gcc/cp/ + * module.cc (trees_out::tree_type): We can meet ttps here. + (trees_{in,out}::tree_mergeable): Stream skeleton before locating info. + gcc/testsuite/ + * g++.dg/modules/ttp-3_[ab].C: New. + * g++.dg/modules/builtin-1_[ab].C: Adjust module scan. + * g++.dg/modules/indirect-[234]_b.C: Likewise. + * g++.dg/modules/inst-[1234]_[ab].C: Likewise. + + gcc/cp/ + * module.cc (trees_out::core_vals): Template type parms are their + own canonical. + (trees_in::finish_type): Never subst a canonical type parm for the type. + gcc/testsuite/ + * g++.dg/modules/ttp-2_[ab].C: New. + + gcc/cp/ + * module.cc (global_tree_arys): Add c_global_trees. + gcc/c-family/ + * c-common.h (enum c_tree_index): Add CTI_MODULE_HWM, move voltale + entries below it. + + Merge trunk r271953. + + gcc/ + * tree-core.h (enum tree_index): Add TI_MODULE_HWM. + gcc/cp/ + * cp-tree.h (enum cp_tree_index): Add CPTI_MODULE_HWM, move + volatile CPTI's below it. + (CPTI_STD_IDENTIFIER, std_identifier): Delete. + (DECL_NAMESPACE_STD): Simplify. + * decl.c (initialize_predefined_identifiers): Drop std_identifier. + (cxx_init_decl_processing): Adjust std_node creation. Use push/pop + nested namespace for std. + (cxx_builtin_function, cxx_builtin_function_ext_scope): Use + push/pop nested namespace for std. + * except.c (init_exception_processing): Likewise. + * rtti (init_rtti_processing): Likewise. + * module.cc (global_tree_arys): Restrict C & C++ trees. + * name-lookup.c (push_namespace): Set location if it was a + builtin. + gcc/testsuite/ + * g++.dg/modules/std-1_[ab].C: New. + +2019-06-04 Nathan Sidwell + + gcc/cp/ + * class.c (maybe_add_class_template_decl): Mark (some) local + templates. + * module.cc (friend_from_decl_list): Some friends are overloads. + (trees_{in,out}::core_vals): Stream TREE_VEC CHAIN. + (trees_out::mark_class_def): Directly mark friend decls. + gcc/testsuite/ + * g++.dg/modules/tpl-friend-6_[ab].C: New. + + gcc/testsuite/ + * g++.dg/modules/tpl-friend-5_[ab].C: New. + + gcc/cp/ + * name-lookup.c (lookup_type_scope_1): Look in imported slots too. + gcc/testsuite/ + * g++.dg/modules/class-8_[ab].C: New. + + gcc/cp/ + * name-lookup.c (lookup_type_scope_1): Reimplement, handle local + and namespace scopes separately. + +2019-06-03 Nathan Sidwell + + gcc/cp/ + * module.cc (friend_from_decl_list): New. + (trees_out::{tree_decl,{write,mark}_class_def}): Use it. + (trees_in::{tree_node,read_class_def}): Likewise. + + Template friends of templates. + gcc/testsuite/ + * g++.dg/modules/tpl-tpl-friend-1_[ab].C: New. + + Non-template friends of templates. + gcc/testsuite/ + * g++.dg/modules/tpl-friend-4_[ab].C: New. + + Non-template friends of templates. + gcc/cp/ + * module.cc (has_definition): Use DECL_SAVED_TREE. + (trees_{in,out}::{read,write}_class_def): Stream definitions of + local friends. + gcc/testsuite/ + * g++.dg/modules/tpl-friend-3_[ab].C: New. + + Merge trunk r271874. + + Non-template friends of templates. + gcc/cp/ + * module.cc (depset::disc_bits): Add DB_FRIEND. + (depset::is_friend): New. + (enum tree_tag): Add tt_friend_template. + (trees_out): Add section field, init it. + (trees_out::tree_decl): Deal with template friends. Assert lazy + ordering. + (trees_in::tree_node): Add tt_friend_template support. + (trees_{in,out}::{read,write,mark}_class_def): Deal with friend + templates. + (depset::hash::add_dependency): Notice friend templates. + (depset::hash::add_specializations): Add non-specializations. + (depset::hash::find_dependencies): Specializations depend on their + template & args. + (enum ct_decl_flags): Add cdf_is_friend. + (module_state::write_cluster): Set it. + (module_state::write): Add specializations before bindings. + Expand cluster dump. + * pt.c (push_template_decl_real): Friend template's DECL_CHAIN + points at the befriending class. + gcc/testsuite/ + * g++.dg/modules/tpl-friend-2_[ab].C: New. + * g++.dg/modules/tpl-friend-1_a.C: Adjust scans. + +2019-05-31 Nathan Sidwell + + Non-template friends of templates. + gcc/cp/ + * module.cc (trees_{in,out}::{read,write}_class_def): Stream + friend lists and decl lists specially. + (trees_out::mark_class_def): Mark local friend decls. + (depset::hash::add_specializations): Don't add non-specializations + that are in the table. + * pt.c (push_template_decl_real): Mark non-pushed friend templates. + gcc/testsuite/ + * g++.dg/modules/tpl-friend-1_[ab].C: New. + +2019-05-29 Nathan Sidwell + + gcc/cp/ + * decl.c (duplicate_decls): Remove duplicate assert. + * pt.c (build_template_decl): Set RESULT & TYPE of the template + here ... + (process_partial_specialization): ... not here ... + (add_inherited_template_parms): ... nor here ... + (push_template_decl_Real): ... nor here. Refactor. + gcc/ + * doc/invoke.texi (C++ Modules): Document atomicity. + gcc/fortran/ + * cpp.c (gfc_cpp_add_dep, gfc_cpp_add_target, gfc_cpp_init): + Rename mrules to mkdeps. + + gcc/cp/ + * module.cc (maybe_add_bmi_prefix): Replace FORCE with LEN_P. + Set it. + (create_dirs): Input is guarantueed unique. + (module_state::check_read): Show full BMI filename in errors. + (finish_module_processing): Likewise. Rename output atomically. + gcc/testsuite/ + * g++.dg/modules/atom-decl-3.C: Adjust diagnostics. + * g++.dg/modules/atom-preamble-3.C: Likewise. + * g++.dg/modules/bad-mapper-[13].C: Likewise. + * g++.dg/modules/circ-1_c.C: Likewise. + * g++.dg/modules/flag-1_b.C: Likewise. + * g++.dg/modules/import-2.C: Likewise. + * g++.dg/modules/internal-1.C: Likewise. + * g++.dg/modules/mod-stamp-1_d.C: Likewise. + * g++.dg/modules/p0713-3.C: Likewise. + +2019-05-28 Nathan Sidwell + + * decl.c (duplicate_decls): Assert a template newdecl has no + specializations. + + Revert inadvertent commits. + gcc/cp/ + * pt.c (push_template_decl_real): Here. + * decl.c (duplicate_decls): Here. + + Merge trunk r271702. + +2019-05-23 Nathan Sidwell + + gcc/cp/ + * module.cc (loc_spans): Make spans a vec. + (module_state::{read,write}_locations): Use vec. + + gcc/cp/ + * module.cc (trees_in): Replace auto_vec with vec. + + Template template parms, and a bunch of other stuff + gcc/cp/ + * cp-tree.h (DECL_TEMPLATE_INFO): Augment docs. + * module.cc (depset::clear_flag_bit): New. + (depset::is_unreached): Replace is_implicit_specialization. + (depset::is_marked): Replace is_first_dep_repurposed. + (dumper::impl::nested_name): Template args may be NULL. + (trees_{in,out}::core_vals): Template decl result & args streamed + with decl. + (trees_out::tree_decl): TTPs by value. + (trees_{in,out}::tree_value): Reorder body streaming, stream more + template bits. + (trees_out::tree_mergeable): Redo specialization tagging. + (trees_out::mark_class_def): Only mark decls on decl list. + (trees_out::mark_declaration): Simplify. + (depset::hash::add_dependency): Deal with reaching unreached. + (specialization_add): Grab all instantiations from this TU. + (depset::hash::add_specialiazations): Determing is_unreached. + (depset::hash::find_dependencies): Iterate until no more unreached + reached. + (module_state::write_unnamed): Adjust. + * pt.c (tsubst_function_decl): Set DECL_MODULE_OWNER. + gcc/testsuite/ + * g++.dg/modules/ttp-1_[ab].C: New. + * g++.dg/modules/indirect-[234]_[bc].C: Adjust scans. + * g++.dg/modules/inst-[24]_ab.C: Likewise. + + gcc/cp/ + * module.cc (dumper::impl::nested_name): Cope with TTPs. + (depset:hash::connect): Return the vec. + (depset::tarjan): Create and return the vec. + (module_state::write_{bindings,unnamed}): SCCS are in a vec. + (module_state::write): Likewise. + +2019-05-22 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::hash::hash): Create worklist. + (depset::tarjan::tarjan): Create stack. + (depset::depset): Create deps. + + Stream binfos properly (again). + gcc/cp/ + * module.cc (trees_out::mark_node): Binfos may be marked. + (trees_{in,out}::start): Binfos may be streamed. + (trees_{in,out}::core_vals): Likewise. + (trees_{in,out}::tree_node): Reachable binfos may always be + inserted. + (trees_{in,out}::{read,write}_binfos): Delete. + (trees_out::mark_class_def): Mark the binfo heirarchy. + (trees_{in,out}::{read,write}_class_def): Stream binfos here. + +2019-05-21 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::mark_declaration): Add do_defn parm, mark + definition if set. Adjust callers. + (trees_out::mark_definition): Merge into mark_declaration. + + Merge trunk r271478. + + Merge trunk r271467. + +2019-05-20 Nathan Sidwell + + Merge trunk r271420. + +2019-05-17 Nathan Sidwell + + Merge trunk r271338. + + gcc/cp/ + * module.cc (trees_out::mark_class_member): Add do_defn parm. + Mark the definition. + (trees_out::mark_class_def): Adjust. + (depset::hash::find_dependencies, module_state::write_cluster): + Use mark_declaration. + + gcc/cp/ + * module.cc (trees_out::mark_node): Drop OUTERMOST parm. Don't + consider templateness. + (trees_out::mark_declaration): New. + (trees_out::mark_class_member): New. + (trees_out::mark_class_def): Use mark_class_member. + (depset::hash::find_dependencies): Adjust. + (module_state::write_cluster): Likewise. + + gcc/cp/ + * module.cc (trees_{in,out}::tpl_parms): Rename to ... + (trees_{in,out}::tpl_headr): ... here. Stream the whole parms. + (trees_out::tree_type): Assert no surprising + TEMPLATE_TEMPLATE_PARM. + (trees_{in,out}::tree_value): Stream template template parms. + +2019-05-16 Nathan Sidwell + + gcc/cp/ + * module.cc (dumper::operator ()): Add null check. + (trees_out::mark_node): Permit fixed nodes. + (trees_out::tree_decl, trees_in::tree_node): More anon. + * name-lookup.c (mark_pending_on_decl): Fix field marking thinko. + (lookup_by_ident): Lookup anon. + (get_lookup_ident): Likewise. + gcc/testsuite/ + * g++.dg/modules/anon-1_[abc].C: New. + +2019-05-15 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::DB_HIDDEN_BIT): New, add accessors. + (depset::hash::add_binding): Set hidden binding bit. + (binding_cmp): Adjust hidden. + (enum ct_bind_flags): New. + (module_state::{read,write}_cluster): Reimplement binding flag + streaming. + * name-lookup.c (name_lookup::adl_namespace_fns): Skip hidden. + gcc/testsuite/ + * g++.dg/modules/friend-2_[ab].C: New. + +2019-05-14 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_in::tree_value): New, broken out of ... + (trees_in::tree_node): ... here. Call it. + (trees_{in,out}::lang_type_vals): Don't stream befriending classes. + gcc/testsuite/ + * g++.dg/modules/friend-1_[abc].C: New. + + Cleanup merging, friend streaming. + gcc/cp/ + * module.cc (trees_{in,out}::tree_mergeable): Reimplement. + (trees_out::tree_value): Significant adjustment. + (trees_in::tree_node): Likewise. + (trees_{in,out}::tree_node_specific): Move into ... + (trees_{in,out}::tree_node_bools): ... here. + (trees_out::mark_mergeable): Delete. + (trees_{in,out}::insert): Adjust. + (trees_{in,out}::lang_vals): New, broken out of ... + (trees_node_vals): ... here. Call them. + (trees_out::ref_node): Process mergeable cases. + (trees_{in,out}::tpl_parms): Adjust. + (trees_{in,out}::{read,write}_class_def): Stream and connect + friend lists. + (binding_cmp): Order hidden decls. + (module_state::write_cluster): Adjust mergeable streaming. + (module_State::read_cluster): Hide hidden overloads. + * name-lookup.c (extract_module_binding): Don't skip hidden. + gcc/testsuite/ + * g++.dg/modules/builtin-1_a.C: Adjust scans. + * g++.dg/modules/class-3_b.C: Likewise. + * g++.dg/modules/indirect-[24]_[bc].C: Likewise. + * g++.dg/modules/inst-[123]_[bcd].C: Likewise. + +2019-05-10 Nathan Sidwell + + gcc/cp/ + * decl.c (duplicate_decls): Don't check moduleness on friend decl. + * pt.c (tsubst_friend_function): Set module ownership. + + gcc/cp/ + * module.cc (trees_{in,out}::{read,write}_function_def): Serialize + FRIEND_CONTEXT. + (trees_{in,out}::{read,write}_class_def): Reattach befriending classes. + + gcc/cp/ + * decl.c (duplicate_decls): Check and adjust anticipated builtin + decls. + * friend.c (do_friend): Set module ownership. + * module.cc (trees_{in,out}::lang_decl_vals): Conditionally stream + context and befriending classes. + * name-lookup.c (init_global_partition): Header unit uses global + slot. + * parser.c (cp_parser_template_declaration): Conditionalize export + warning. + + Partial specializations! + gcc/cp/ + * module.cc (trees_out::tree_mergeable): Correct finding of + general template. + (trees_in::tree_mergeable): Recover a merged partial + specialization. + (depset::hash::add_specializations): Deal with partial + specializations. + (enum ct_decl_flags): New. + (module_state::write_cluster): Set specialization flags. + (module_state::read_cluster): Install specializations. + (install_specialization): New. + gcc/testsuite/ + * g++.dg/modules/tpl-spec-5_[ab].C: New. + +2019-05-09 Nathan Sidwell + + gcc/cp/ + * module.cc + gcc/testsuite/ + * g++.dg/modules/indirect-[234]_[bc].C: Adjust module dump scans. + * g++.dg/modules/inst-[1234]_[ab].C: Likewise. + * g++.dg/modules/vmort-2_c.C: Likewise. + + Atomically mark template's DECL_TEMPLATE_RESULT, IMPLICIT_TYPEDEF's type + gcc/cp/ + * module.cc (enum tree_tag): Replace + tt_{primary,secondary}_type with tt_typedef. + (trees_out::mark_node): Mark the template_decl. + (trees_out::maybe_insert_typeof): Delete. + (trees_out::tree_decl): Stream the template_decl, name implicit + templates. Always mark result & type. + (trees_out::tree_type): Simplify implicit_typedef streaming. + (trees_out::tree_value): Assert correct ordering. + (trees_in::tree_node): Adjust tt switch. Insert result & type. + (module_state::{read,write}_cluster): Always add voldemort's type. + gcc/testsuite/ + * g++.dg/modules/class-3_[bd].C: Adjust module dump scans. + * g++.dg/modules/indirect-[234]_[bc].C: Likewise. + * g++.dg/modules/inst-[234]_[ab].C: Likewise. + * g++.dg/modules/stdio-1_a.H: Likewise. + * g++.dg/modules/using-4_a.C: Likewise. + +2019-05-07 Nathan Sidwell + + gcc/testsuite/ + * g++.dg/template/pr39425.C: Adjust errors. + * g++.old-deja/g++.pt/spec20.C: Adjust errors. + + Merge trunk r270943. + +2019-05-06 Nathan Sidwell + + libcpp/ + * include/mkdeps.h: Rename struct mrules to struct mkdeps. + * mkdeps.c: Likewise. + * include/cpplib.h (cpp_get_deps): Rename return type.. + * directives.c (cpp_get_deps): Likewise. + * internal.h (struct cpp_reader): Rename deps field type. + gcc/cp/ + * cp-tree.h (module_preprocess): Adjust first arg type. + * module.cc: Rename mrules to mkdeps. + * lex.c (module_preprocess_token): Rename mrules->mkdeps. + gcc/c-family/ + * c-opts.c (handle_defered_opts): Rename struct deps to struc mkdeps. + + gcc/cp/ + * module.cc (enum tree_tag): Delete tt_builtin. + (trees_out::tree_decl): Builtins are merely GMF entities. + (tree_in::tree_node): Delete tt_builtin handling. + * name-lookup.c (init_global_partition): New. + (get_fixed_binding_slot): Populate global & partition slots. + gcc/testsuite/ + * g++.dg/modules/builtin-1_[ab].C: Adjust scans. + * g++.dg/modules/by-name-1.C: Likewise. + + gcc/cp/ + * cp-tree.h (global_purview_p): New. + (module_header_p): Rename to ... + (header_module_p): ... this. + (named_module_p): New. Replace ... + (module_not_header_p): ... this. + (module_global_p): ... delete. + * module.cc (trees_out::tree_mergeable, module_state::write) + (module_cpp_undef, finish_module_processing): Adjust. + * name-lookup.c (get_fixed_binding_slot, record_mergeable_decl) + (check_module_override, make_namespace): Adjust. + * parser.c (cp_parser_translation_unit, cp_parser_module_name): Adjust. + +2019-05-02 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (spec_entry): Moved from pt.c. + (walk_specializations): Declare. + (get_specializations_for_module): Delete. + * module.cc (depset): Add DB_FIRST_BIT. + (depset::{is,set}_first_dep_repurposed): New. + (depset::{,tarjan::}connect): Drop for_mergeable parm, use + is_first_dep_repurposed instead. + (spec_tuple): New. + (specialization_add): New. + (specialization_cmp): Adjust. + (depset::hash::add_specializations): Reimplement. + (depset::hash::add_mergable): Set set_first_dep_repurposed. + (module_state::sort_mergeables): Adjust. + (module_state::write): Likewise. + * pt.c (spec_entry): Move to cp-tree.h + (get_specializations, get_specializations_for_module): Replace + with ... + (walk_specializations): ... this. + gcc/testsuite/ + * g++.dg/modules/inst-1_b.C: Adjust scans. + +2019-05-01 Nathan Sidwell + + gcc/cp/ + * module.cc (depset): Add DB_PARTIAL_BIT, + is_partial_specialization, set_implicit_specialization. + (depset::hash::add_dependency): Drop is_implicit parm. Return the + depset. + (trees_out::tree_decl): Set the implicit bit myself. + (depset::hash::add_specializations): Preliminary tweak. + + gcc/cp/ + * pt.c (get_specializations): Adjust type template checking. + (get_specializations_for_module): Get the type specializations + too. + gcc/testsuite/ + * g++.dg/modules/tpl-spec-4_[ab].C: New. + + gcc/cp/ + * module.cc (set_module_owner): Deal with specializations. + * name-lookup.c (mark_pending_on_decl): Walk class members. + gcc/testsuite/ + * g++.dg/modules/tpl-spec-3_[ab].C: New. + + gcc/cp/ + * parser.c (cp_parser_explicit_specialization): Correctl unwind state. + * decl.c (grokfndecl): Set module ownership after specializationness + is known. + + libcpp/ + * macro.c (_cpp_new_macro): memset before initing. + + gcc/cp/ + * module.cc (module_state::write_bindings): Iterate over sccs + array, not hash table. + (module_state::write): Adjust. + + libcpp/ + * macro.c (_cpp_new_macro): Initialize imported field. + + Merge trunk r270765. + +2019-04-30 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (module_normal_import_p): Declare. + * module.cc (module_normal_import_p): New. + * name-lookup.c (note_pending_specializations): Note already + loaded normal imports. + gcc/testsuite/ + * g++.dg/modules/tpl-spec-2_d.C: New + + gcc/testsuite/ + * tpl-spec-2_[abc].C: New. + + Namespace-scope function specializations. + gcc/cp/ + * cp-tree.h (MODULE_VECTOR_LAZY_{PARTITION,GLOBAL}_SPEC_P): + Delete. + * module.cc (struct specset): New. + (module_for_unnamed): New. + (lazy_load_specializations): New. + (module_state::{read,write}_unnamed): Register the + specializations. + ({init,finish}_module_processing): Adjust. + * name-lookup.c (mark_pending_on_decl, mark_pending_on_binding): + New. + (set_module_binding): If pending, mark the new decls. + (note_pending_specializations, note_loaded_specializations): New + * name-lookup.h (note_pending_specializations) + (note_loaded_specializations): Declare. + gcc/testsuite/ + * g++.dg/modules/tpl-spec-1_[ab].C: New. + +2019-04-29 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (MODULE_VECTOR_LAZY_SPEC_P) + (MODULE_VECTOR_LAZY_GLOBAL_SPEC_P) + (MODULE_VECTOR_LAZY_PARTITION_SPEC_P): New. + * module.cc (struct unnamed_entity): New. + (unnamed_ary): Array of unnamed_entity. + (module_state::write_cluster): Return void. + (module_state::{read,write}_unnamed): Deal with specializations. + (module_State::{read,write}_specializations): Delete. + (module_state::read_cluster): Adjust. + (module_state_config): Drop specialization count. + (module_state::{read,write}_config): Adjust. + (module_state::{read,write}): Drop specialization streaming. + + Merge trunk r270644. (GCC 10) + + gcc/cp/ + * modules.cc (depset::hash::add_depednency): More STRIP_TEMPLATE. + +2019-04-25 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (get_specializations_for_module): Declare. + * module.cc (depset): Add DB_IMPLICIT_BIT, + is_implicit_specialization. + (depset::hash::add_dependency): Add is_implicit arg. Allow NULL + current. Set is_imolicit_specialization. + (module_state::write_specializations): Implement. + (trees_out::tree_decl): Stream specializations. + (specialization_cmp): New. + (depset::hash::add_specializations): New. + (module_state::write_cluster): Count specializations. + (module_state::write): Add and stream specializations. + * pt.c (spec_hash_table): New typedef. Use it. + (get_specializations): New. + (get_specializations_for_module): New. + +2019-04-24 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (DECL_TEMPLATE_LAZY_SPECIALIZATIONS_P): New. + (lazy_load_specializations): Declare. + * module.cc (module_state::{read,write}_specializations): New. + (module_state::write_cluster) Return template count. + (module_state_config): Add num_specializations. + (module_state::{read,write}_config): Stream it. + (module_state::{read,write}): Stream spcializizations. + (lazy_load_specializations): New. + * pt.c (lookup_template_class_1, instantiate_template_1): Lazy + load specializations. + + Merge trunk r270543. + + Instantiations now streamed. + gcc/cp/ + * module.cc (tree_tag): Delete tt_inst. + (trees_out::tree_decl): All instantiations are depended. Never + tt_inst. + (trees_in::tree_node): Delete tt_inst handling. + (trees_in::tree_mergeable): Deal with type specializations. + * pt.c (lookup_template_class_1): Set instatiation owner to + current TU. + (match_mergable): Accept type. + gcc/testsuite/ + * g++.dg/modules/indirect-[234]_[bc].C: Adjust scans. + * g++.dg/modules/inst-[34]_[bc].C: New. + +2019-04-23 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (module_name): New overload. + * module.cc (dumper::impl::nested_name): Adjust module dump. + (module_name): New. + * error.c (dump_module_suffix): Dump for namespace-scope decl. + (dump_aggr_type): Dump module suffix. + gcc/testsuite/ + * g++.dg/modules/adhoc-1_b.C: Adjust regexps. + * g++.dg/modules/err-1_[cd].C: Likewise. + * g++.dg/modules/macloc-1_[cd].C: Likewise + * g++.dg/modules/by-name-1.C: Adjust scans. + * g++.dg/modules/class-3_[bd].C: Likewise. + * g++.dg/modules/enum-1_a.C: Likewise. + * g++.dg/modules/global-[23]_a.C: Likewise. + * g++.dg/modules/indirect-[1234]_[bc].C: Likewise. + * g++.dg/modules/inst-[12]_[ab].C: Likewise. + * g++.dg/modules/part-3_c.C: Likewise. + * g++.dg/modules/scc-1.C: Likewise. + * g++.dg/modules/stdio-1_a.H: Likewise. + * g++.dg/modules/using-4_a.C: Likewise. + * g++.dg/modules/vmort-2_[abc].C: Likewise. + + gcc/cp/ + * module.cc (trees_{in,out}::tree_mergeable): Stream more for + specializations. + + gcc/cp/ + * module.cc (trees_{in,out}::core_vals): Don't stream template + instantiations. + (trees_{in,out}::tree_mergeable): Refactor. + (module_state::prepare_locations): Fix dumper. + + gcc/cp/ + * Make-lang.in: Wedge revision number into REVISISON_s. + + Function instantiation merging + gcc/cp/ + * cp-tree.h (get_module_owner): Add tpl_owner parm. + (match_mergeable_specialization): New. + * mangle.c (maybe_write_module): Look through template + instantiations. + * method.c (implicitly_declare_fn): Do not set owner here. + * module.cc (trees_out::tree_decl): Namespace-scope function + instantiations are merged. + (trees_in::tree_node): Likewise. + (trees_{in,out}::tree_mergeable): Allow instantiation merging. + (depset::hash::add_dependency): Specializations are unnameable. + (module_state::write_cluster): Seed specializations too. + (module_state::read_define): Fix size_t/unsigned mismatch. + (module_visible_instantiation_path): Use TYPE_STUB_DECL. + (get_module_owner): Add inst_owner_p arg. Look through + instantiation, or don't. + * pt.c (instantiate_template_1): Set module owner here. + (instantiate_decl): ... not here. + (match_mergeable_decl): New. + gcc/testsuite/ + * lib/scanlang.exp (scan-lang-dump-times): New. Cut-paste fu! + * g++.dg/modules/inst-[12]_[ab].C: New. + * g++.dg/modules/adl-1_c.C: Comment. + * g++.dg/modules/indirect[234]_[bc].C: Adjust. + +2019-04-12 Nathan Sidwell + + gcc/cp/ + * Make-lang.in (MODULE_REVISION): New. + * module.cc (dumper::impl::nested_name): Print module number. + (module_state::write_readme): Write revision. + gcc/testsuite/ + * g++.dg/modules/by-name-1.C: Adjust scans. + * g++.dg/modules/class-3_[bd].C: Likewise. + * g++.dg/modules/enum-1_a.C: Likewise. + * g++.dg/modules/global-[23]_a.C: Likewise. + * g++.dg/modules/indirect-[1234]_[bc].C: Likewise. + * g++.dg/modules/part-3_c.C: Likewise. + * g++.dg/modules/scc-1.C: Likewise. + * g++.dg/modules/stdio-1_a.H: Likewise. + * g++.dg/modules/using-4_a.C: Likewise. + * g++.dg/modules/vmort-2_[abc].C: Likewise. + + gcc/cp/ + * module.cc (dumper::impl::nested_name): Remove namespace owner + fiddling. + * name-lookup.c (make_namespace): Don't set owner. Adjust callers. + + Ownership only on namespace-scope. + gcc/cp/ + * module.cc (dumper::impl::nested_name): Show decl's ownership. + (trees_out::tree_decl): Remove unnecessary unnameable code. + (depset::hash::add_dependency): Add is_import parm. + (module_state::write_clister): Get owner decl of unnamed. + (get_module_owner): Always look at the namespace-scope entity. + (set_module_owner): Only set namespace-scope entity. + (set_implicit_module_owner): Likewise. + gcc/testsuite/ + * g++.dg/modules/by-name-1.C: Adjust scans. + * g++.dg/modules/class-3_[bd].C: Likewise. + * g++.dg/modules/enum-1_a.C: Likewise. + * g++.dg/modules/global-[23]_a.C: Likewise. + * g++.dg/modules/indirect-[1234]_[bc].C: Likewise. + * g++.dg/modules/part-3_c.C: Likewise. + * g++.dg/modules/scc-1.C: Likewise. + * g++.dg/modules/stdio-1_a.H: Likewise. + * g++.dg/modules/using-4_a.C: Likewise. + * g++.dg/modules/vmort-2_[abc].C: Likewise. + +2019-04-11 Nathan Sidwell + + gcc/cp/ + * mangle.c (decl_is_template_id): Rename to ... + (maybe_template_info): ... here. Simplify API. + (mangle_return_type, write_encoding, write_name) + (write_nested_name, write_prefix, write_template_prefix) + (write_unqualified_name): Update all callers. + + gcc/cp/ + * module.cc (module_for_{ordinary,macro}_loc): New. + (module_state::{read,write}_location): Deal with imported locations. + + gcc/cp/ + * module.cc (depset::entity_kind_name): Tweak. + (trees_{in,out}::tree_mergeable): Frob context. + * name-lookup.h (match_mergeable_decl): Pass context explicitly. + * name-lookup.c (match_mergeable_decl): Pass context explicitly. + gcc/testsuite/ + * g++.dg/modules/global-[23]_a.C: Adjust scans. + * g++.dg/modules/stdio-1_a.H: Likewise. + + gcc/cp/ + * module.cc (loc_kind): New. + (module_state::{read,write}_location): Use tagging, compress macro + & adhoc better. + + gcc/cp/ + * module.cc (loc_spans): Main span is all but reserved. + (slurping): Drop pre_early_ok. + (loc_spans::init): Don't push command line and forced header + spans. + (loc_spans::macro): Fix comparison thinko. + (module_state::read_location): No such thing as early. + (module_state::prepare_locations): Drop command line and forced + header handling. + (maybe_add_macro): Ignore lazy macros. + (canonicalize_header_name): Return the buffer. + gcc/testsuite/ + * g++.dg/modules/macro-5_c.C: Adjust regexp. + +2019-04-10 Nathan Sidwell + + gcc/cp/ + * module.cc (module_preprocess): Module partitions always produce + a BMI. + gcc/testsuite/ + * g++.dg/modules/dep-2.C: New. + + gcc/cp/ + * module.cc (module_state::write_cluster): Remove unnecessary + check & FIXME. + + gcc/cp/ + * module.cc (trees_out::depending_p): Delete. + (trees_out::tree_decl): Refactor asserts. + (module_state::write_cluster): Refactor initial scan. + + libcpp/ + * mkdeps.c (deps_add_module): Swap primary & module args. Too + confusing. + gcc/cp/ + * module.cc (module_state::do_import, module_preprocess) + (finish_module_processing): Adjust. + +2019-04-09 Nathan Sidwell + + gcc/cp/ + * module.cc (slurping): Move {ordinary,macro}_locs to .. + (module_state): ... here. + (module_state::read_location): Adjust. + (module_state::read_locations): Adjust, recorded locations are for + current TU. + + gcc/cp/ + * module.cc (get_module): Add parent option, use it. + (module_state::read_{imports,partitions}): Adjust. + (finish_module_processing): Show full module name on error. + gcc/testsuite/ + * g++.dg/modules/ben-1{_[ab].C,.map}: New. + * g++.dg/modules/alias-1_f.C: Use [srcdir]. + * g++.dg/modules/gc-2_a.C: Likewise. + * g++.dg/modules/inc-xlate-1_d.C: Likewise. + * g++.dg/modules/legacy-6_[cdef].C: Likewise. + * g++.dg/modules/map-1_[ab].C: Likewise. + + gcc/cp/ + * module.cc (depset::is_imported_entity): New. + (module_for_unnamed): Delete. + (depset::hash::add_dependency): Note imported dependencies. + (module_state::{read,write}_cluster): Deal with imported unnamed. + (module_state::write): Skip imported dependencies. + gcc/testsuite/ + * g++.dg/modules/vmort-2_[abc].C: New. + + libcpp/ + * mkdeps (munge): Quote ':'. + (deps_add_module): Correct partion/module order. + (make_write): Add .c++m suffix to module name. + gcc/testsuite/ + * g++.dg/modules/dep-1_[ab].C: New. + + libcpp/ + * mkdeps (mkrules::~mkrules): Use free appropriately. + + gcc/ + * doc/invoke.texi (C++ Module Mapper): Fix markup. + + gcc/cp/ + * cp-tree.h (language_function): Remove x_auto_return_pattern. + (current_function_auto_return_pattern): Delete. + (FNDECL_USED_AUTO): Correct documentation. + * decl.c (save_function_data): Delete. + (fndecl_declared_return_type): Don't look at language_function. + (start_preparsed_function): Replace + current_function_auto_return_pattern with + DECL_SAVED_AUTO_RETURN_TYPE. + (finish_function): Likewise. + * mangle.c (write_unqualified_name): Likewise. + * parser.c (cp_parser_jump_statement): Likewise. + * typeck.c (check_return_expr): Likewise. + +2019-04-08 Nathan Sidwell + + gcc/cp/ + * module.cc (unnamed_ary, unnamed_map_t, unnamed_map): New. + (struct slurping): Delete unnamed, alloc_unnamed, & deletion of + same. + (struct moduls_state): Add unnamed_lwm, unnamed_num. + (module_for_unnamed): New. + (dumper::impl::nested_name): More informative unnamedness. + (module_state::read_cluster): Use the unnamed_ary. + (module_state::read_unnamed): Populate unnamed_ary. + ({init,finish}_module_processing): Adjust. + gcc/testsuite/ + * g++.dg/modules/indirect-4_[bc].C: Adjust scans. + + gcc/cp + * cp-tree.h (struc mc_slot): Move to ... + * name-lookup.h: ... here. + * module.c (depset::hash::{add_mergeable,connect}): Use depsets + not decls. + (depset::tarjan::connect): Add for_mergeables parm. + (tree_node::{mark,tree}_mergeable): Likewise. + (module_state::sort_mergeables): Likewise, + (module_state::{read,write}_bindings): Return/expect number of + bindings. + (module_state::write_macros): Return number of macros. + (module_state::write_cluster): Adjust. + (module_state::{read,write}_config): Adjust. + (module_state::{read,write}): Adjust. + +2019-04-03 Nathan Sidwell + + gcc/cp/ + * module.cc (dumper): Add CLUSTER. + (module_state::write): Dump cluster information. + + gcc/cp/ + * module.cc (node_template_info): Move earlier, protect from + partial read in. + (dumper::impl::nested_name): Dump template args. + gcc/testsuite/ + * g++.dg/modules/indirect-[234]_[abc].C: Adjust scans. + + gcc/cp/ + * module.cc (module_state::write_cluster): Refactor. + + gcc/cp/ + * module.cc (cluster_tag): Remove ct_defn. + (module_state::{read,write}_cluster): Definitions marked via flag. + + gcc/cp/ + * module.cc (depset::hash): Rename mergeables flag to mergeable_dep. + +2019-04-02 Nathan Sidwell + + Allow mapper protocol of file descriptors. + gcc/ + * doc/invoke.texi (C++ Module Mapper): Document <> form. + gcc/cp/ + * module.cc (module_mapper::module_mapper): Parse <> option. + + Write bmi /after/ deferred instantiations. + gcc/cp/ + * cp-tree.h (finish_module_processing): Add cpp arg. + (finish_module_parse): Delete. + * name-lookup.h (lookup_by_type): Declare. + * decl2.c (c_parse_final_cleanups): Adjust. + * module.c (tree_tag): Add tt_builtin. + (trees_out::tree_decl): Use tt_builtin for builtins. + (trees_in::tree_node): Likewise. + (finish_module_parse): Move processing into ... + (finish_module_processing): ... here. + * name-lookup.c (lookup_by_type): New. + gcc/testsuite/ + * g++.dg/modules/builtin-1_[ab].C: New. + + gcc/cp/ + * module.cc (depset): Add EK_UNNAMED. Delete DB_IS_UNNAMED_BIT, + is_unnamed accessor. + (depset::hash::add_dependency): Add entity_kind arg, simplify + logic. Update callers. + gcc/testsuite/ + * g++.dg/modules/using-4_a.C: Adjust scan. + +2019-04-02 Ben Boeckel + Nathan Sidwell + + libcpp/ + * mkdeps.c (mrules): Rename is_legacy to is_header_init, adjust uses. + (deps_add_module): Correctly duplicate and use strings. + +2019-04-02 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::add_dependency): Drop maybe_using arg. + Adjust callers. + (dumper::operator()): Overloads have a name. + (has_definition): Adjust. + +2019-04-01 Nathan Sidwell + + gcc/cp/ + * module.cc (depset): Move flags into discriminator field. Adjust uses. + + gcc/cp/ + * module.cc (depset): Replace key wih entity/discriminator tuple. + Add entity_kind and disc_bits enums. Adjust hashing & + construction routines. + + gcc/cp/ + * module.cc (depset): Entity keying uses unique entity. Set + entity kind later. + (depset::hash): Adjust hashing. + (depset::hash::add_dependency): Set kind after insertion. + (depset::hash::add_mergeable): Adjust. + gcc/ + * doc/invoke.texi: Fix module mapper thinko. + +2019-03-29 Nathan Sidwell + + gcc/cp/ + * cp-tree.h (saved_scope): Remove this_module field. + (current_module): Delete. + (module_import_bitmap): Rename to ... + (get_import_bitmap): ... here. Lose arg. + * module.cc (module_import_bitmap): Rename to ... + (get_import_bitmap): ... here. Lose arg. + * name-lookup.c (name_lookup::search_namespace_only): Adjust. + (check_module_override, finish_nonmember_using_decl): Likewise. + (do_push_to_top_level): Drop this_module field init. + +2019-03-28 Nathan Sidwell + + gcc/cp/ + * pt.c: Comment some structures. + + gcc/ + * doc/invoke.texi (C++ Modules): Update. + + Merge trunk r269975. + +2019-03-27 Nathan Sidwell + + Header unit compilations retrofit includeness. + gcc/cp/ + * cxx-mapper.c (module2bmi): Don't use PCH suffix. + * module.cc (module_header_macro, controlling_node): Delete. + (module_state::write_macros): Rely on cpp to determine controlling + macro. + (module_state::{write,read}): Likewise. + (module_begin_main_file): Retrofit as a header. + (finish_module_parse): Delete header_macro stuff. + libcpp/ + * files.c (_cpp_stack_file): Set main_file. + (_cpp_find_header_unit): Close the file. + (cpp_retrofit_as_include): New. + (cpp_main_controlling_macro): New. + * include/cpplib.h (cpp_retrofit_as_include): Declare. + (cpp_main_controlling_macro): Declare. + * internal.h (struct cpp_buffer): Add main_file flag. + (cpp_in_primary_file): Use it. + gcc/testsuite/ + * g++.dg/modules/{,sys/}inext-1.H: New. + * g++.dg/modules/macro-[23]_[abc].[CH]: Adjust. + * g++.dg/modules/modules.exp (dg-module-bmi): Adjust. + * g++.dg/modules/stdio-1_a.H: Asjust. + + Expunge header name quoting in mapper + gcc/cp/ + * cxx-mapper.cc (IS_HEADER_NAME): New. + (module2bmi): Adjust. + * module.cc (module_mapper::imex_query): Drop quotes. + (module_mapper::translate_include): Likewise. + gcc/testsuite/ + * g++.dg/modules/modules.exp (dg-module-bmi): Adjust mapping. + + Header unit names lack quotes + gcc/c-family/ + * c.opt (fmodule-header): Set a var. + * cp-tree.h (module_map_header): Pass string as ptr/len tuple. + * lex.c (module_map_header): Move to module.cc. + (module_process_token): Remove gratuitous representation frobbing. + * module.cc (module_state::module_state): Assert no quotes. + (module_header_name): Delete. + (get_module): Detect header via pathism. + (module_mapper::imex_query): Add quotes. + (module_mapper::translate_include): Drop reader parms, don't push + buffer here. + (canonicalize_header_name): New, from lex.c. + (module_map_header): Wrapper for canonicalize_header_name. + (module_translate_include): Do buffer pushing here. Canonicalize + name. + (set_module_header_name): Delete. + (module_begin_main_file): Simplify header name setting. + (handle_module_option): Adjust header name flag setting. + * parser.c (cp_lexer_tokenize): Adjust header name mapping. + libcpp/ + * lex.c (cpp_output_token): Add quotes back onto CPP_HEADER_NAME. + gcc/testsuite/ + * g++.dg/modules/alias-3_[bc].C: Adjust. + * g++.dg/modules/leg-merge-4_c.C: Adjust. + * g++.dg/modules/macro-[2456]_[bcde].C: Adjust. + * g++.dg/modules/stdio-1_b.C: : Adjust. + * g++.dg/modules/sys: Add. + + Header unit names are strings + gcc/cp/ + * lex.c (module_map_header): Build string_cst. + (module_preprocess_token): Adjust. + * module.cc (module_state::module_state): Header names are + strings. + (module_name_hash): New. + (module_state_hash::{hash,equal}): Adjust. + (dumper::impl::nested_name): Fix string_cst. + (get_module): Tweak. + (module_state::set_flatname): Tweak. + (module_begin_main_file): Build string. + +2019-03-26 Nathan Sidwell + + gcc/c-family/ + * c-opts.c (c_common_post_options): Invert sense of + cpp_read_main_file arg. + * parser.c (cp_parser_translation_unit): Reject include + translation in module purview. + libcpp/ + * files.c (_cpp_stack_file): Take include type parm. Drop line + parm. Do line-table adjusting here ... + (_cpp_stack_include): ... not here. + * include/cpplib.h (cpp_read_main_file): Invert final parm. + * init.c (cpp_read_main_file): Adjust. + * internal.h (include_type): Add more enumerations, and document. + (_cpp_stack_file): Adjust prototype. + gcc/testsuite/ + * g++.dg/modules/alias-2_[ab].[CH]: New. + * g++.dg/modules/exp-xlate-1_[ab].[CH]: New. + * g++.dg/modules/legacy-3_c.H: Robustify testing. + + Header units disambiguated by originating header path + libcpp/ + gcc/ + * doc/invoke.texi (-fmodule-header): Adjust. + * langhooks.h (struct lang_hooks): Adjust preprocess hook. + gcc/cp/ + * cp-tree.h (module_preprocess_token): Adjust. + (module_map_header): Declare. + (module_translate_include): Adjust. + * cxx-mapper.cc (module2bmi): Header units map to relative path. + (client::action): Look for header bmi. + * lex.c (module_map_header): New. + (module_preprocess_token): Remap header unit names. + * module.cc (create_dirs): Fix. + (module_mapper::translate_include): Adjust. + (module_translate_include): Likewise. + (finish_module_parse): Fix directory creation. + (handle_module_option): Remove fmodule-header=FOO handling. + * parser.c (cp_lexer_tokenize): Remap header unit names. + gcc/c-family/ + * c-lex.c (c_lex_with_flags): Build a string for header names. + * c-ppoutput.c (scan_translation_unit): Allow preprocess hook to + nadger token. + * c.opt (fmodule-header=): Deprecate. + libcpp/ + * directives.c (do_include_common): Move include translation to ... + * files.c (_cpp_file): Add header_unit field. + (should_stack_file): Break into ... + (is_known_idempotent_file): ... this, and ... + (has_unique_contents): ... this. + (_cpp_stack_file): ... do include translation. + (cpp_find_header_unit): New. + * include/cpplib.h (cpp_callbacks): Adjust translate_include hook. + (cpp_find_header_unit): Declare. + gcc/testsuite/ + * g++.dg/modules/: Many changes. + +2019-03-21 Nathan Sidwell + + libcpp/ + * files.c (struct _cpp_file): Make bools bitfields, add + header_unit flag. + (_cpp_find_file): Don't write for (; !fake;) to mean if (!fake) + for (;;). + (_cpp_stack_file): Refactor. + + Merge trunk r269839. + + gcc/ + * gcc.c (execute): Use . not (.). + * params.def (PARAM_LAZY_MODULES): Add trailing . + gcc/testsuite/ + * lib/prune.exp (prune_gcc_output): Adjust collect regexp. + + gcc/ + * gcc.c (execute): Frob argv[0] to show spawning from driver. + (process_command): Don't check input file exists here. + +2019-03-20 Nathan Sidwell + + gcc/cp/ + * module.cc (trees_out::mark_class_def): Skip friends in decl_list. + + gcc/cp/ + * module.cc (module_state::read_namespaces): Module-linkage + namespaces are visible in the module itself. + * name-lookup.h (add_imported_namespace): Rename parm. + * name-lookup.c (add_imported_namespace): Export_p becomes visible_p. + gcc/testsuite/ + * g++.dg/modules/enum-3_[ab].C: New. + + Enum members of templates part 2. + gcc/cp/ + * module.cc (trees_out::tree_node): Any enum can be tt_enum_int. + (trees_out::mark_enum_def): Only mark integer_cst inits. + gcc/testsuite/ + * g++.dg/modues/enum-2_[ab].C: Add. + + Enum members of templates part 1. + gcc/cp/ + * class.c (maybe_add_class_template_decl): No need to add + CONST_DECLs. + * pt.c (instantiate_class_template_1): CONST_DECLs are not on the + template decl list no more. + * module.cc (node_template_info): Cope with enum members of + templates. + (trees_in::insert): Allow null when failing. + (trees_{in,out}::core_vals): Uninstantiated enums have no + underlying type. + (trees_out::tree_decl): Enums can be members too. + (trees_out::write_class_def): Only announce when streaming. + (trees_out::mark_class_def): Don't mark const_decl fields. + (trees_out::mark_enum_def): Always mark the enum here. + gcc/testsuite. + * g++.dg/modules/enum-2_[ab].C: New. + +2019-03-19 Nathan Sidwell + + gcc/cp/ + * module.cc (depset::hash::find_dependencies): It might be a fixed + tree. + gcc/testsuite/ + * g++.dg/modules/stdns_[ab].C: New. + + Using decls part 3. + gcc/cp/ + * cp-tree.h (ovl_iterator::exporting_p): Simplify. + * name-lookup.c (do_nonmember_using_decl): Upgrade export in place. + gcc/testsuite/ + * g++.dg/modules/using-4_[ab].C: New. + + gcc/testsuite/ + * g++.dg/modules/using-3.C: New. + + Using decls part 2. + gcc/cp/ + * cp-tree.h (OVL_EXPORT_P): New. + (ovl_iterator::exporting_p): New. + (ovl_insert): Change using_p arg type. + * tree.c (ovl_insert): USINGNESS parm conveys exporting too. + * name-lookup.c (do_nonmember_using_decl): Deal with exports. + * module.cc (binding_cmp): Sort usings too. + (module_state::{read,write}_cluster): Using decls too. + gcc/testsuite/ + * g++.dg/modules/using-2_[abc].C: New. + + gcc/cp/ + * name-lookup.c (do_nonmember_using_decl): Cleanups. + (finish_nonmember_using_decl): Likewise. + +2019-03-18 Nathan Sidwell + + Using decls part 1. + gcc/cp/ + * name-lookup.c (do_nonmember_using_decl): Unnest if. + (finish_nonmember_using_decl): Deal with module vector. + gcc/testsuite/ + * g++.dg/modules/global-3_[ab].C: New. + + gcc/cp/ + * module.cc (module_state::{read,write}_locations): Cope with + trailing empty expansions. + + gcc/cp/ + * module.cc (module_state::{read,write}_locations): Macro maps can + have embedded zeroes. + + gcc/cp/ + * name-lookup.c (do_nonmember_using_decl): Add install & fn_scope + args. + (finish_nonmember_using_decl): Adjust, prep for modules. + gcc/testsuite/ + * g++.dg/lookup/using53.C: Restore & extend DR36 errors. + +2019-03-15 Nathan Sidwell + + gcc/cp/ + * name-lookup.c (do_nonmember_using_decl): Have lookup passed in. + (validate_nonmember_using_decl): Delete. Absorb + into ... + (finish_nonmember_using_decl): ... here. Do lookup once. + lookup_enum_member): New. Broken out of ... + (get_binding_or_decl): ... here. Call it. + (finish_nonmember_using_decl): Drop LOOKUP parm. Do lookup here. + gcc/testsuite/ + * g++.dg/cpp0x/using-enum-2.C: Adjust diagnostics. + * g++.dg/cpp0x/using-enum-3.C: Likewise. + * g++.dg/lookup/hidden-class9.C: Likewise. + * g++.dg/lookup/hidden-temp-class11.C: Likewise. + libstdc++-v3/ + * testsuite/18_support/byte/global_neg.cc: Adjust diagnostics. + * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Likewise. + * testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Likewise. + * testsuite/27_io/headers/cstdio/functions_neg.cc: Likewise. + * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Likewise. + * testsuite/29_atomics/headers/atomic/types_std_c++20_neg.cc: Likewise. + + gcc/cp/ + * name-lookup.h (finish_nonmember_using_decl): Drop LOOKUP parm. + * name-lookup.c (lookup_enum_member): New. Broken out of ... + (get_binding_or_decl): ... here. Call it. + (finish_nonmember_using_decl): Drop LOOKUP parm. Do lookup here. + * parser.c (cp_parser_using_declaration): Adjust. + * pt.c (tsubst_expr): Likewise. + gcc/testsuite/ + * g++.dg/lookup/hidden-class9.C: Adjust diagnostics. + * g++.dg/lookup/hidden-temp-class11.C: Likewise. + libcc1/ + * libcp1plugin.cc (plugin_add_using_decl): Adjust + finish_nonmember_using_decl call. + libstdc++-v3/ + * testsuite/18_support/byte/global_neg.cc: Adjust diagnostics. + * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Likewise. + * testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Likewise. + * testsuite/27_io/headers/cstdio/functions_neg.cc: Likewise. + * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Likewise. - * testsuite/29_atomics/headers/atomic/types_std_c++20_neg.cc: Likewise. - - Merge using directive fields & fns. - gcc/cp/ - * cp-tree.h (lang_decl_ns): Drop usings field. - (DECL_NAMESPACE_USING): Delete. - * name-lookup.h (finish_using_directive): Declare. - (finish_namespace_using_directive) - (finish_local_using_directive): Delete. - * name-lookup.c (name_lookup::search_usings) - (name_lookup::queue_namespace): Adjust. - (has_using_namespace_std_directive_p): No need to search - namespaces separately. - (finish_using_directive): New. Merged from ... - (finish_namespace_using_directive, finish_local_using_directive): ... - here. Delete. - (push_namespace): Adjust. - * parser.c (cp_parser_using_directive): Call finish_using_directive. - * pt.c (tsubst_expr): Likewise, - libcc1/ - * libcp1plugin.cc (plugin_add_using_namespace): Call - finish_using_directive. - - 2019-03-14 Nathan Sidwell - - Merge finish using decl fns - gcc/cp/ - * name-lookup.c (finish_nonmember_using_decl): New, merged from ... - (finish_namespace_using_decl, finish_local_using_decl): ... here. - Delete. - * name-lookup.h (finish_nonmember_using_decl): Declare - (finish_namespace_using_decl, finish_local_using_decl): Delete. - * parser.c (cp_parser_using_declaration): Adjust. - * pt.c (tsubst_expr): Likewise. - libcc1/ - * libcp1plugin.cc (plugin_add_using_decl): Likewise. - - Drop cp_binding_level::usings - gcc/cp/ - * name-lookup.h (cp_binding_level): Remove usings field. - * name-lookup.c (push_using_decl, push_using_decl_1): Delete. - (validate_nonmember_using_decl): Make using decl here. - - gcc/cp/ - * name-lookup.c (validate_nonmember_using_decl): Drop DR 36 case. - gcc/testsuite/ - * g++.dg/lookup/using53.C: Permit DR 36 case. - - Merge trunk r269682. - - 2019-03-13 Nathan Sidwell - - Start doing something with using decls - gcc/cp/ - * cp-tree.h (ovl_iterator): Add get_using accessor. - * module.cc (depset::is_using): New. - (depset::hash::add_dependency): Add maybe_using parm. Use it. - (depset::hash::add_binding): Deal with using decls. - (depset::hash::find_dependencies): Likewise. - (cluster_cmp): Likewise. - (module_state::{read,write}_cluster): Likewise. - gcc/testsuite/ - * g++.dg/modules/using-1_[abc].C: New. - - stdio.h can be a legacy unit! - gcc/testsuite/ - * g++.dg/modules/stdio-1_[ab].[CH]: New. - * g++.dg/modules/global-2_[ab].C: New. - - typedef struct {} foo; part 2 - gcc/cp/ - * module.cc (tt_anon_decl): New. - (trees_out::tree_decl): Deal with anonymous decls. - (trees_out::tree_type): Use TYPE_STUB_DECL. - (trees_in::tree_node): Deal with tt_anon_decl. - * name-lookup.c (get_lookup_ident): Assert not anonymous. - gcc/testsuite/ - * g++.dg/modules/tdef-3_[ab].C: Extend. - * g++.dg/modules/tdef-3_c.C: New. - - gcc/cp/ - * module.cc (trees_out::tree_decl): Refactor named decl streaming. - (trees_in::tree_node): Remove as_base special casing. - * name-lookup.c (lookup_by_ident, get_lookup_ident): Handle - as_base here. - - 2019-03-12 Nathan Sidwell - - gcc/cp/ - * module.cc (trees_out::tree_node): Refactor. - (module_state::write_cluster): Prefer non-anonymous name. - - typedef struct {} foo; part 1 - gcc/cp/ - * module.cc (trees_out::tree_value): Cope with name-for-linkage. - (trees_out::write_class_def): Likewise. - (depset::hash::add_dependency): Likewise. - gcc/testsuite/ - * g++.dg/modules/tdef-3_[ab].C: New. - - gcc/cp/ - * decl.c (fndecl_declared_return_type): Remove BMI FIXME. - * module.cc (trees_{in,out}::lang_decl_vals): Stream - saved_auto_return_type. - - gcc/cp/ - * tree.c (ovl_splice): Delete. - - Kill DECL_SAVED_FUNCTION_DATA part 1 - gcc/cp/ - * cp-tree.h (lang_decl_fn): Replace saved_language_function with - saved_auto_return type. - (DECL_SAVED_FUNCTION_DATA): Delete. - (DECL_SAVED_AUTO_RETURN_TYPE): New. - * decl.c (duplicate_decls, start_preparsed_function): Adjust. - (save_function_data): Only save auto return type. - (finish_function): Drop DECL_SAVED_FUNCTION_DATA member zapping. - (fndecl_declared_return_type): Adjust. - * method.c (make_thunk, make_alias_for): Adjust. - - gcc/cp/ - * module.cc (writable_cmp): New. - (depset::hash::add_writables): Sort the hash before inserting. - - gcc/cp/ - * decl.c (fndecl_declared_return_type): Extend BMI hack. - * module.cc (tt_anon_id, tt_lambda_id): New. - (trees_{in,out}::tree_node): Stream them. - gcc/ - * tree.c (make_anon_name): Drop format #. - - 2019-03-11 Nathan Sidwell - - Anon entities never placed in symbol tables. - gcc/cp/ - * module.cc (depset::hash::add_binding): Assert not anonymous. - * name-lookup.c (pop_local_binding): Popping anonymous is a NOP. - (do_pushdecl): Pushing anonymous doesn't push to symbol table. - gcc/testsuite/ - * g++.dg/other/pr28114.C: Adjust errors. - - gcc/ - * tree.h (make_anon_name): Drop optional parm. - * tree.c (make_anon_name): Drop 'extra' parm. - gcc/cp/ - * cp-tree.h (TYPE_LAMBDA_P): New, require a type. - (LAMBDA_TYPE_P): Refactor. - (TYPE_ANON_P): New. - (TYPE_UNNAMED_P): Use it, reject lambdas. - * class.c (add_implicitly_declared_members): Replace LAMDBA_TYPE_P - with TYPE_LAMBDA_P. - (finalize_literal_type_property, explain_non_literal_class) - (check_bases_and_members, finish_struct) - (current_nonlambda_class_type, maybe_note_name_used_in_class): Likewise. - * constexpr.c (check_constexpr_bind_expr_vars): Likewise. - * decl.c (cp_finith_decomp, grokdeclarator): Likewise. - * lambda.c (begin_lambda_type): Don't clear IDENTIFIER_ANON_P. - (lambda_function): Replace LAMBDA_TYPE_P with TYPE_LAMBDA_P. - (current_lambda_expr, resolvable_dummy_lambda) - (nonlambda_method_basetype): Likewise. - * mangle.c (decl_mandling_context, write_unqualified_name): Likewise. - (write_local_name): Simplify anon check. - * method.c (synthesized_method_walk): Replace LAMBDA_TYPE_P with - TYPE_LAMBDA_P. - (maybe_explain_explicit_delete): Likewise. - * parser.c (cp_parser_simple_type_specifier) - (cp_parser_parameter_declaration_clause) - (cp_parser_parameter_declaration) - (synthesize_immplicit_template_parm): Likewise. - * pt.c (template_class_depth, check_for_bare_parameter_packes) - (push_templated_decl_real, lookup_template_class_1) - (instantiate_class_template_1, tsubst_expr) - (tsubst_copy_and_build): Likewise. - * semantics.c (finish_this_expr, finish_member_declaration): Likewise. - * error.c (dump_aggr_type): Check for lambda before anonymous. - * cp-lang.c (cxx_dwarf_name): Treat all anonymous names anonymously. - - 2019-03-08 Nathan Sidwell - - gcc/cp/ - * name-lookup.h (extract_module_binding): Return binding, not name. - * name-lookup.c (extract_module_binding): Return binding, not name. - * module.cc (depset::set_binding_name): New. - (depset::hash::add_binding): Drop name parm, check anon names - here. - (depset::hash::add_writables): Adjust extract_module_binding use. - - gcc/cp/ - * cp-tree.h (ovl_sort): Delete. - * name-lookup.h (extract_module_binding): Drop type_r parm. - * module.cc (depset::hash::add_binding): Drop type parm. - (depset::hash::add_writables): Adjust extract_module_binding API. - * name-lookup.c (extract_module_binding): Return name, valye by - reference. Don't sort. - * tree.c (ovl_sort): Delete. - - Base lambda names off anonymous names. - gcc/cp/ - * cp-tree.h (IDENTIFIER_LAMBDA_P): New. - (LAMBDA_TyPE_P): Key off name. - (TYPE_UNNAMED_P): Simplify. - (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT): Delete. - (make_lambda_name): Delete. - * lambda.c (begin_lambda_type): Use make_anon_name. - * name-lookup.c (lambda_cnt, make_lambda_name): Delete. - - 2019-03-07 Nathan Sidwell - - Commonize anonymous name generation. - gcc/ - * tree.h (IDENTIFIER_ANON_P): New. - (anon_aggrname_p, anon_aggrname_format): Delete. - (make_anon_name): Declare. - * tree.c (anon_aggrname_p, anon_aggrname_format): Delete. - (make_anon_name): New. - * lto-streamer-out.c (DFS::DFS_write_tree_body): Use IDENTIFIER_ANON_P. - (hash_tree): Likewise. - * tree-streamer-out.c (write_ts_decl_minimal_tree_pointers): Likewise. - gcc/cp/ - * cp-tree.h (TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P. - (make_anon_name): Delete. - * class.c (find_flexarrays): Use IDENTIFIER_ANON_P. - * cp-lang.c (cxx_dwarf_name): Likewise. - * decl.c (name_unnamed_type, xref_tag_1): Likewise. - * error.c (dump_aggr_type): Likewise. - * name-lookup.c (anon_cnt, make_anon_name): Delete. - (consider_binding_level): Use IDENTIFIER_ANON_P. - * pt.c (push_template_decl_real): Likewise. - gcc/d/ - * types.cc (fixup_anonymous_offset): Use IDENTIFIER_ANON_P. - (layout_aggregate_members): Use make_anon_name. - - 2019-03-06 Nathan Sidwell - - Refactor all the things! - gcc/cp/ - * module.cc: Tighten up access. - - Refactor. - gcc/cp/ - * module.cc (module_state): Reorder member fn definitions. - - Refactor. - gcc/cp/ - * module.cc (module_state::is_matching_decl): Moved to ... - (trees_in::is_matching_decl): ... here. - (trees_{in,out}::{mark,write,read}_*): Move earlier. - - Refactor. - gcc/cp/ - * module.cc (module_state::read_definition): Moved to ... - (trees_in::read_definition): ... here. - (module_state::is_skippable_defn): Move to ... - (trees_in::is_skippable_defn): ... here. - (module_state::read_{function,var,class,enum}_def): Move to ... - (trees_in::read_{function,var,class,enum}_def): ... here. - (module_state::read_binfos): Move to ... - (trees_in::read_binfos): ... here. - - Refactor. - gcc/cp/ - * module.cc (module_state::{write,mark}_definition): Move to ... - (trees_out::{write,mark}_definition): ... here. - (module_state::{write,mark}_{function,var,class,enum}_def): Move to ... - (trees_out::{write,mark}_{function,var,class,enum}_def): ... here. - (module_state::write_binfos): Move to ... - (trees_out::write_binfos): ... here. - (depset::hash::find_dependencies): Drop module_state parm. - - Refactor. - gcc/cp/ - * module.cc (module_state::{add_writables,find_dependencies}): Move - to ... - (depset::hash::{add_writables,find_dependencies}): ... here. - (depset::hash::get_work): Delete. - - GMF pruning, Part 2 - gcc/cp/ - * module.cc (depset::hash): Rename flags fields. - (trees_out::tree_decl): Self references by dependency binding. - (depset::hash::add_dependency): Fix thinko. - (binding_cmp): New. - (depset::hash::finalize_dependencies): New. - (module_state::write): Adjust. - * name-lookup.c (extract_module_binding): The FIXMEs have become - irrelevant. - (get_binding_or_decl): Only imports for namespaces. - gcc/testsuite/ - * g++.dg/modules/internal-1.C: Prune output. - * g++.dg/modules/mod-sym-2.C: Check GMF not discarded. - - gcc/cp/ - * module.cc (trees_out::trees_out): Add depset::hash parm. - (trees_out::depending_p): Invert streaming_p. - (module_state::write_cluster): Add depset::hash parm, adjust. - (trees_out::begin): Single ctor for both uses. - (trees_out::end): Don't clear dep_hash. - (module_state::find_dependencies): Adjust. - (module_state::write): Adjust. - - Linkage promotion ban - GMF pruning, Part 1 - gcc/cp/ - * module.cc (depset::is_internal): New field. - (depset::hash): Add gmfs, & internals fields. - (depset::hash::add_dependency): Deal with gmf & internal. - (depset::hash::add_binding): Ignore GMF & internals here. - (module_state::write): Errors for referenced internals. - * name-lookup.c (get_binding_or_decl): Get globals. - gcc/testsuite/ - * g++.dg/modules/internal-1.C: New. - * g++.dg/modules/namespace-[34]_[abc].C: Adjust. - - 2019-03-05 Nathan Sidwell - - gcc/cp/ - * module.cc (depset::hash::add_binding): Ignore internal-linkage - entities. - (module_state::add_writables): Don't walk anonymous namespaces. - gcc/testsuite/ - * g++.dg/modules/unnamed-1_a.C: Adjust scan. - * g++.dg/modules/unnamed-2.C: Adjust scan. - - gcc/cp/ - * module.cc (depset::add_dependency): Drop kind arg, return void. - (depset::hash::add_binding): Set current during addition. - (module_state::add_writables): Tweak. - - gcc/cp/ - * module.cc (depset): Add refs_internal field. Replace decl_key - and defn_key with entity_key. Remove is_decl, add is_namespace. - Replace get_decl with get_entity. - - 2019-03-04 Nathan Sidwell - - Merge trunk r269375. - - GMF content locations - gcc/cp/ - * parser.h (cp_token): Remove C compatibility macros. Add - main_source_p field. - * parser.c (cp_lexer_get_preprocessor_token): Set main_source_p - field. - (cp_lexer_before_phase_4): Rename to ... - (cp_lexer_not_macro): ... here. Drop main-file check. - (cp_parser_translation_unit): Emit main-file errors. - (cp_parser_{module,import}_declaration): Adjust. - gcc/testsuite/ - * g++.dg/modules/global-1_a.C: Adjust. - * g++.dg/modules/mod-decl-3.C: Adjust. - * g++.dg/modules/mod-decl-5_b.C: Adjust. - * g++.dg/modules/mod-exp-1_b.C: Adjust. - * g++.dg/modules/mod-sym-2.C: Adjust. - * g++.dg/modules/namespace-2_a.C: Adjust. - * g++.dg/modules/static-1_a.C: Adjust. - * g++.dg/modules/token-1.C: Adjust. - * g++.dg/modules/token-2_b.C: Adjust. - * g++.dg/modules/token-3.C: Adjust. - * g++.dg/modules/token-4.C: Adjust. - * g++.dg/modules/token-5.C: New. - - New # semantics for popping to "" name. - libcpp/ - * directives.c (do_linemarker): Popping to "" name means fill in - the name. - gcc/testsuite/ - * c-c++-common/cpp/line-1.c: New. - - Cleanups. - libcpp/ - * include/cpplib.h (struct cpp_hashnode): Drop C compatibility - macros. Correct bit calculation. - * include/line-map.h: Formatting. - * line-map.c (get_pure_location): Formatting. - - gcc/cp/ - * module.cc (declare_module): Deal with de-GMFing here, get name - of implicit header module. - * parser.c (enum module_preamble): New enum. - (cp_parser_translation_unit): Use it. - (cp_parser_{module,import}_declaration): Use it. - gcc/testsuite/ - * g++.dg/modules/p0713-3.C: Adjust diags. - - 2019-03-01 Nathan Sidwell - - Merge trunk r269321. - - Merge trunk r269078 (metadata update). - - Apply trunk r269078. - gcc/cp/ - * module.cc (module_state::{read,write}_function_def): Adjust. - - gcc/cp/ - * cp-tree.h (struct constexpr_fundef): Moved from constexpr.c. - (register_constexpr_fundef): Adjust. - (find_constexpr_fundef): Replace with ... - (retrieve_constexpr_fundef): ... this. - * constexpr.c (struct constexpr_fundef): Moved to cp-tree.h - (constexpr_fundef_hasher): Constify. - (retrieve_constexpr_fundef): Make extern. - (find_constexpr_fundef): Delete. - (check_constexpr_fundef): Adjust. - (register_constexpr_fundef): Adjust API. - * module.cc (module_state::{read,write}_function_def): Adjust. - - Merge trunk r269077. - - gcc/cp/ - * parser.c (cp_lexer_set_source_position_from_token): Revert. - - 2019-02-28 Nathan Sidwell - - module & import-semi lexing rules - gcc/cp/ - * parser.c (cp_lexer_tokenize): Fix EOF push. - (cp_lexer_before_phase_4): New. - (cp_lexer_set_source_position_from_token): Simplify. - (cp_parser_{module,import}_declaration): Check phase-4 requirements. - gcc/testsuite/ - * g++.dg/modules/class-2_a.C: Do not #include - * g++.dg/modules/token-[123]*.C: New. - - Remove eof_token - gcc/cp/ - * parser.h (cp_token): Add tree_check_p, adjust GTY tagging. - (cp_lexer): Add saved_type, saved_keyword fields. - * parser.c (eof_token): Delete. - (cp_lexer_new_from_tokens): Overwrite EOF here. - (cp_lexer_destroy): Restore overwritten token here. - (cp_lexer_token_position, cp_lexer_previous_token_position): Simplify. - (cp_lexer_tokenize): Likewise. - (cp_lexer_peek_nth_token, cp_lexer_consume_token): Likewise. - (cp_lexer_purge_token, cp_lexer_purge_tokens_after): Likewise. - (cp_parser_nested_name_specifier, cp_parser_decltype) - (cp_parser_template_id): Set tree_check_p. - - 2019-02-27 Nathan Sidwell - - __import in extern "C" - gcc/cp/ - * parser.c (cp_lexer_tokenize): Add extern_c_depth arg, tokenize - through extern "C". - (cp_parser_translation_unit): Handle top-level extern "C". - (cp_parser_module_name): Force header unit. - (cp_parser_{module,import}_declaration): Adjust. - gcc/testsuite/ - * g++.dg/modules/inc-xlate-1_[cd].C: New. - - gcc/cp/ - * cp-tree.h (import_module): Return bool. - * module.cc (import_module): Return is_header flag. - * parser.c (cp_parser_tokenize): Rename to ... - (cp_lexer_tokenize): ... this. Reimplement. - (cp_parser_import_declaration): Return is_header flag. - (cp_parser_translation_unit): Adjust lexer tokenization interaction. - - 2019-02-26 Nathan Sidwell - - Flag_modules is strictly boolean. - gcc/c-family/ - * c.opt (fmodules-ts): Allow negation. - gcc/cp/ - * decl.c (duplicate_decls): Use modules_p. - * lex.c (module_preprocess_token): Use modules_p. - * parser.c (cp_parser_diagnose_invalid_type) - (cp_parser_translation_unit, cp_parser_tokenize): Likewise. - * module.cc (module_begin_main_file): Likewise. - (handle_module_option): Adjust. - gcc/ - * doc/invoke.texi (fmodules-ts): Adjust. - - Preprocess __import. - gcc/cp/ - * cp-tree.h (import_module): Add extern C flag. - * lex.c (module_preprocess_token): Allow __import in extern-c - * module.c (import_module): Add extern C flag. - * parser.c (cp_parser_import_declaration): Adjust. - gcc/testsuite/ - * g++.dg/modules/inc-xlate-1{.map,_[ab].H}: New. - - Distinguished __import spelling. - gcc/c-family/ - * c-common.c (c_common_reswords): Add __import spelling. - gcc/cp/ - * module.cc (module_mapper::translate_include): Use __import. - gcc/testsuite/ - * g++.dg/modules/legacy-[3456]*: Adjust. - * g++.dg/modules/map-2.C: Likewise. - - Fix preprocessor tokenizing rules. - gcc/cp/ - * lex.c (module_preprocess_token): Detect extern "C" {, tokenize - trailing attributes before importing header unit. - gcc/testsuite/ - * g++.dg/modules/cpp-2_[abc].[CH]: Extend testing. - - Fix interface partition export rules. - gcc/cp/ - * module.cc (module_state::read_imports): Don't check partition - import/export here ... - (module_state::direct_import): ... or here ... - (module_state::write): ... but do it here. - gcc/testsuite/ - * g++.dg/modules/part-2_[cd].C: Adjust. - * g++.dg/modules/part-2_e.C: New. - - 2019-02-22 Nathan Sidwell - - gcc/ - * doc/invoke.texi: Update modules documentation. - - libcpp/ - * mkdeps.h (deps_write): Add phony arg. - (deps_phony_targets): Delete. - * init.c (cpp_finish): Adjust deps_write call. - * mkdeps.c (mrules): Add quote_lwm member. - (munge): Just return static buffer. - (deps_add_target, deps_add_dep, deps_add_module): Store unmunged. - (write_name): Rename ... - (make_write_name): ... here. Maybe munge here. - (write_vec, deps_write): Rename to ... - (make_write_vec, make_write): ... here. Adjust. - (deps_write): New wrapper. - - gcc/cp/ - * cp-tree.h (init_module_processing): Add arg. - * decl.c (cxx_init_decl_processing): Adjust. - * module.cc (init_module_processing): Check preprocess sanity. - - libcpp/ - * mkdeps.c (deps_add_module): Allow empty bmi name. - (deps_write): Refactor. Add PHONY. - gcc/cp/ - * cp-tree.h (module_preprocess): Declare. - * lex.c (module_preprocess_token): Have a proper state object, - register imports with dependency machinery. - * module.cc (module_preprocess_token): New. - (module_begin_main_file): Cope with just preprocessing. - - 2019-02-21 Nathan Sidwell - - gcc/c-family/ - * c.opt: Rename fmodule-legacy to fmodule-header - gcc/ - * doc/invoke.texi: Update. - gcc/cp/ - * cp-tree.h, module.cc, lang-specs.h, name-lookup.c, parser.c: - Rename. - gcc/testsuite/ - * g++.dg/modules/: Likewise. - - gcc/ - * langhooks.h (struct lang_hooks): Adjust preprocess_token API. - gcc/cp/ - * lex.c (module_preprocess_token): Adjust API. - * cp-tree.h (module_preprocess_token): Adjust API. - * module.cc (module_state::direct_import): Not fatal if preprocessing. - gcc/c-family/ - * c-ppoutput.c (scan_translation_unit): Adjust preprocess_token - hook API. - - 2019-02-20 Nathan Sidwell - - gcc/ - * REVISION: Add []. - gcc/cp/ - * Make-lang.in (MODULE_VERSION): Replace ... - (MODULE_STAMP): ... this. Adjust - * cxx-mapper.cc: Update. - * module.cc: Update version behaviour. - (module_state::do_import): Add dependency. - libcpp/ - * mkdeps.c (mrules): Add dtor properly. Add modules. - (deps_write): Spew module deps. - - 2019-02-11 Nathan Sidwell - - Merge trunk r268782. - - Make dependencies - libcpp/ - * include/cpplib.h (cpp_get_deps): Change type. - * include/mkdeps.h (struct deps): Rename to ... - (struct mrules): ... this. Adjust accessors. - (deps_add_module): Declare. - * internal.h (sttuct cpp_reader): Likewise. - * mkdeps.c (struct mrules): Rename from deps. Add module fields. - (munge): Allow concatenation. - (deps_add_module): New. - (write_name, write_vec): New, broken out of ... - (deps_write): ... this. Add module pieces. - gcc/ - * module.cc: #include mkdeps.h. - (module_state::direct_import): Add module to dependencies. - (finish_module_parse): Set target dependency info. - gcc/c-family/ - * c-opts.c (handle_deferred_opts): Adjust dep accessors. - gcc/fortran/ - * cpp.c (gfc_cpp_add_dep, gfc_cpp_add_target, gfc_cpp_init): Adjust - dep accessors. - - 2019-02-08 Nathan Sidwell - - libcpp/ - * mkdeps.c (struct deps): Make more C++y. Update all uses. - - 2019-02-07 Nathan Sidwell - - gcc/cp/ - * module.cc (module_mapper::module_mapper): Fix local socket creation. - - gcc/cp/ - * c++-mapper.cc (module2bmi): Do not map dir separators. - gcc/testsuite/ - * g+.dg/modules/modules.exp (decode_mod_spec): Likewise. - - gcc/cp/ - * module.cc (create_dirs): New. - (maybe_add_bmi_prefix): Add FORCE parm, adjust. - (finish_module_parse): Try and create intermediate dirs. - - 2019-02-05 Nathan Sidwell - - gcc/cp/ - * name-lookup.c (finish_namespace_using_decl): Add assert + FIXME. - - gcc/cp/ - * cxx-mapper.cc (client::action): Add mapper agent. - * module.cc (module_mapper::handshake): Add mapper agent slot. - gcc/ - * doc/invoke.texi (C++ Module Mapper): Update handshake. - - gcc/cp/ - * module.cc (module_state::read_locations): Make warning - development-only. - - gcc/cp/ - * module.cc (get_module_slot): New broken out of ... - (get_module): ... here. Call it. - (module_mapper::translate_include): Cope with file mapper. - gcc/testsuite/ - * g++.dg/modules/map-2.{C,map}: New. - - 2019-02-01 Nathan Sidwell - - Merge trunk r268456. - - gcc/cp/ - * decl.c (duplicate_decls): Accomodate anticipated fns. - * module.cc (set_module_owner): Adjust. - gcc/testsuite/ - * g++.dg/modules/printf-1_[ab].[HC]: New. - - 2019-01-31 Nathan Sidwell - - gcc/cp/ - * module.cc (try_increase_lazy): Fix setrlimit call. - (init_module_processing): Fix getrlimit call. - - gcc/cp/ - * module.cc (init_module_processing): Dump even more config. - Tweak lazy limit. - - Rework lazy limit handling. - gcc/cp/ - * module.cc (lazy_limit, lazy_hard_limit, LAZY_HEADROOM): New. - (lazy_open): Invert sense, make unsigned. Adjust all uses. - (try_increase_lazy): New. - (module_state::freeze_an_elf): Call it first. - (init_module_processing): Adjust lazy_limit setting. - - 2019-01-30 Nathan Sidwell - - ADL part 2 - gcc/cp/ - * cp-tree.h (LOOKUP_FOUND_P): Allow enumeral type. - * module.cc (module_visible_instantiation_path): Protect against - not modules. - * name-lookup.c (name_lookup::adl_enum): New. - (name_lookup::adl_type): Use it. - (name_lookup::adl_namespace): INST_PATH may be null. - (name_lookup::search_adl): Add partitions of types. - gcc/testsuite/ - * g++.dg/modules/adl-[23]_[abc].C: New. - - ADL part 1 - gcc/cp/ - * cp-tree.h (module_visible_instantiation_path): Declare. - * module.cc (module_visible_instantiation_path): Implement. - * name-lookup.c (name_lookup::add_module_fns): Delete. - (name_lookup::add_namespace_fns): Add visible bitmaps, - reimplement. - (name_lookup::search_adl): Get path of instantiation. - gcc/testsuite/ - * g++.dg/modules/adl-1_[abc].C: New. - - gcc/cp/ - * name-lookup.c (name_lookup::adl_namespace_only): Delete. - (name_lookip::adl_{namespace,class}_fns): New. - (name_lookup::adl_{namespace,class}): Adjust. - (name_lookup::search_adl): Refactor. - - 2019-01-30 Iain Sandoe - - gcc/cp/ - * module.cc: Reorder includes. - * cxx-mapper.cc: Likewise. - - gcc/testsuite/ - * g++.dg/modules/fn-inline-1_{bc}.C: Adjust weak scan. - - 2019-01-30 Nathan Sidwell - - gcc/ - * doc/invoke.texi (C++ Modules): Add submenu. - - 2019-01-29 Nathan Sidwell - - gcc/cp/ - * module.cc (init_module_processing): Dump more config. - - gcc/cp/ - * module.cc (MAPPED_READING, MAPPED_WRITING): 0 or 1 - (init_module_processing): Dump mapping behaviour. - - 2019-01-28 Nathan Sidwell - - gcc/cp/ - * module.cc (module_mapper::make): Drop options arg, look at - CXX_MODULE_MAPPER. - gcc/ - * doc/invoke.texi (fmodule-mapper): Document env var. - (C++ Module Mapper): Likewise. - - gcc/cp/ - * module.cc (trees_{in,out}::core_vals): Lambda location. - * cp-objcp-common.c (cp_common_init_ts): Fix LAMBDA_EXPR marking. - * cp-tree.h (tree_lambda_expr): Save 8 bytes. - - Merge trunk r268337. - - 2019-01-23 Nathan Sidwell - - gcc/cp/ - * module.cc (trees_{in,out}::core_vals): Stream expression locii. - - gcc/cp/ - * cp-objcp-common.c (cp_common_init_ts): MARK_TS_EXP for tcc_statement. - - gcc/cp/ - * cp-objcp-common.c (cp_common_init_ts): MARK_TS_EXP for scope_ref - & noexcept_expr. - * module.cc (trees_{in,out}::core_vals): Rely on TS_EXP. - - gcc/cp/ - * module.cc (trees_{in,out}::core_vals): Adjust expression streaming. - - Fix TS_CONTAINS_STRUCT for tcc_expression. - gcc/ - (MARK_TS_EXP): New. - gcc/c-family/ - * c-common.c (c_common_init_ts): Use MARK_TS_EXP. Mark - SIZEOF_EXPR. - gcc/cp/ - * cp-objcp-common.c (cp_common_init_ts): MARK_TS_EXP for - tcc_expression nodes. Call c_common_init_ts. - - gcc/cp/ - * module.cc (trees_{in,out}::core_vals): Clean up enumeral type - handling. - (trees_out:tree_node, module_state::mark_enum_def): Use - SCOPED_ENUM_P. - - gcc/cp/ - * module.cc (tree_tag): Add tt_enum_int. - (trees_out::mark_node): Allow marking non-decls. - (trees_{in,out}::tree_node): Serialize enum values. - (module_state::mark_enum_def): Mark enum int_csts. - gcc/testsuite/ - * g++.dg/modules/enum_1_[ab].C: Test serialization. - - gcc/cp/ - * module.cc (trees_in::finish_type): Don't speciual case - TYPE_PACKs. - * pt.c (template_parm_to_arg, coerce_template_parameter_pack) - (make_argument_pack, tsubst_template_args, tsubst) - (type_unification_real, unify_pack_expansion): Set - TYPE_STRUCTURAL_EQUALITY for type packs. - - 2019-01-22 Nathan Sidwell - - gcc/cp/ - * cp-objcp-common.c (cp_common_init_ts): Set TYPE_PACK_EXPANSION - and TYPE_ARGUMENT_PACK correctly. - * module.c (trees_in::finish_type): Special case pack types and - bound parms. - gcc/testsuite/ - * g++.dg/modules/var-tpl-1_[ab].C: New. - - gcc/cp/ - * module.cc (tree_tag): Add tt_ptrmem_type. - (trees_{in,out}::core_vals): Don't scrog pointer's ptrmem cache. - (trees_out::tree_type): Stream pointers to member functions. - (trees_in::tree_node): Likewise. - gcc/testsuite/ - * g++.dg/modules/nodes-1_[ab].C: More. - - 2019-01-18 Nathan Sidwell - - gcc/cp/ - * module.cc (trees_{in,out}::core_vals): Stream tcc_reference, - baselink, static_assert, trait_expr. - gcc/testsuite/ - * g++.dg/modules/nodes-1_[ab].C: New. - - gcc/cp/ - * module.cc (trees_{in,out}::core_vals): Fix TYPE_CACHED_VALUES - handling. Stream ptrmem_cst. Note userdef_literals unreachable. - gcc/testsuite/ - * g++.dg/modules/nodes-1_[ab].C: Add prememdata - - gcc/cp/ - * module.cc (module_state::{read,write}_locations): Fix macro - expansion compression. - - 2019-01-17 Nathan Sidwell - - Enable partition entity merging. - gcc/cp/ - * module.cc (depset::hash): Add mergeable flag. - (trees_out::{tpl_parms,tree_mergeable}): Protect from not - streaming. - (depset::hash::add_dependency): Deal with mergeablility. - (depset::hash::add_mergeable): New. - (depset::hash::connect): Adjust dump. - (module_state::write_cluster): Sort mergeables. - (module_state::find_dependencies): Deal with mergeability. - (module_state::sort_mergeables): New. - gcc/testsuite/ - * g++.dg/modules/scc-1.C: Adjust scans. - * g++.dg/modules/part-3_[cd].C: Remove xfails. - - gcc/cp/ - * module.cc (trees_{in,out}::fn_parms): New. - (trees_{in,out}::tree_mergeable): Call them. - (cluster_cmp): Move earlier. - (depset::hash::connect): New, broken out of ... - (module_state::write): ... here. Call it. - - 2019-01-16 Nathan Sidwell - - gcc/cp/ - * module.cc (trees_{in,out}::tree_mergeable): Allow non-implicit - typedefs. - gcc/testsuite/ - * g++.dg/modules/leg-merge-9_[abc].[HC]: New. - - Merge partition entities (disabled). - gcc/cp/ - * module.cc (trees_{in,out}::tree_mergeable): Fold partitions. - (module_state::{read,write}_cluster): Register module entities. - gcc/testsuite/ - * g++.dg/modules/part-3_[abcd].C: New. - - gcc/cp/ - * module.cc (dumper::GM): Rename to MERGE. Update uses. - - gcc/cp/ - * cp-tree.h (module_name): Replace FULL parm with primary pointer. - * error.c (dump_module_suffix): Adjust. - * module.cc (module_state::fullname): Rename to flatname. - (module_state::{get,set}_flatname): New. Use get_flatname. - (module_state::attach): Conditionally call set_flatname. - (get_module): Likewise. - (module_mapper::imex_query): Adjust. - (module_mapper::bmi_response): Likewise. - (module_state::write_readme): Adjust. - (module_state::{read,write}_config): Adjust name checking. - * name-lookup.c (make_namespace): Adjust anonymous name creation. - * ptree.c (cxx_print_decl): Adjust. - gcc/testsuite/ - * g++.dg/modules/part-2_[cd].C: Adjust regex. - - gcc/cp/ - * cp-tree.h (module_name): Add FULL parm. - * module.cc (module_name): Check it and strip partitions if not. - * error.c (dump_module_suffix): Don't want full name. - - 2019-01-15 Nathan Sidwell - - Merge trunk r267946. - - Partition BMI folding, but not entity merging. - gcc/cp/ - * cp-tree.h (get_module_owner): Mark PURE. - * module.cc (loc_spans::open): Add location parm. - (trees_out::{lang_decl_bools,tree_node_specific,tree_decl}): Account - for remapping. - (depset::hash::add_binding): Account for partitions. - (module_state::write_locations): Account for partitions. - (module_state::read_locations): Add partition spans to primary - interface. - (module_state::add_writables): Add partition bitmap arg. Adjust - extraction. - (module_state::write): Generate partition bitmap. - (module_state::read): Only read partitions on primary. - * name-lookup.h (extract_module_binding): Adjust parms. - * name-lookup.c (add_mergeable_decl): Break out from ... - (record_mergeable_decl): ... here. Call it. - (match_mergeable_decl): Likewise. - (check_mergeable_decl): Tweak. - (extract_module_binding): Examine partitions and merge. - * tree.c (ovl_sort): Simplify. - gcc/testsuite/ - * g++.dg/modules/part-1_a.C: Adjust. - * g++.dg/modules/part-1_c.C: New. - - 2019-01-14 Nathan Sidwell - - gcc/ - * tree.h (cache_integer_cst): Add defaulted small parm. - * tree.c (cache_integer_cst): Add small parm, adjust. - gcc/cp/ - * module.cc (trees_out::start): FIXED_CST are C only. - (trees_in::finish): Merge small INTEGER_CSTs. - (trees_{in,out}::core_bools): Don't write base.public_flag of types. - - gcc/cp/ - * module.cc (trees_out::start): Catch POLY_INT_CST, adjust - VECTOR_CST. - (trees_{in,out}::core_vals): Do TS_VECTOR. - * g++.dg/modules/literals-1_[ab].C: Add vector cst. - - 2019-01-11 Nathan Sidwell - - String literals. - gcc/cp/ - * module.cc (trees_{in,out}::core_vals): String literals (a NOP). - gcc/testsuite/ - * g++.dg/modules/literals-1_[ab].C: Add string lit. - - Real & complex literals. - gcc/cp/ - * module.cc (bytes_{in,out}::buf): Void pointer - (trees_{in,out}::core_vals): Stream REAL_CST & COMPLEX. - gcc/testsuite/ - * g++.dg/modules/literals-1_[ab].C: New. - - gcc/cp/ - * module.cc (get_module): Fix partition parsing. - (module_state::read_imports): Check interface import requirements. - (module_state::{read,write}_partitions): No need for exported. - (module_state::write_config): Write is_interface. - (module_state::direct_import): Check interface import - requirements. - (declare_module): Set interface_p, not exported_p. - * parser.c (cp_parser_module_name): Partitions only in non-legacy - module purview. - gcc/testsuite/ - * g++.dg/modules/part-2_[abcd].C: New. - - 2019-01-10 Nathan Sidwell - - gcc/cp/ - * cp-tree.h (module_not_legacy_p): New. - * module.cc (trees_out::tree_namespace): Rema namespace owner. - (tree_in::tree_node): Protect bogus tt_namespace. - * name-lookup.c (record_mergeable_decl): New. - (check_mergeable_decl): Namespaces are never overloaded. - (check_module_override): Add to mergeable list. - (do_pushdecl): Record mergeable. - (make_namespace_finish): Use check_mergeable_decl. Never add to level - (push_namespace): Add to level here. - gcc/testsuite/ - * g++.dg/modules/indirect-1_b.C: Adjust dump scan. - - gcc/cp/ - * module.cc (finish_module_parse): Better location info on errors. - * name-lookup.c (name_lookup::search_namespace_only): Skip - partition slot too. - (check_module_override): Likewise. - (check_mergeable_decl): New broken out of ... - (match_mergeable_decl): ... here. Call it. - (reuse_namespace): Iterate over global slot. - * ptree.c (cxx_print_xnode): More cluster info. - - 2019-01-09 Nathan Sidwell - - gcc/cp/ - * module.cc (module_state::read_partitions): New. - (module_state::read_imports): Deal with elided partitions. - (module_state::write_partitions): Write more. - (module_state::read): Read partitions. - (module_state::direct_import): Deal with elided partitions. - (process_deferred_imports): Don't request known filenames. Avoid - double request. - gcc/testsuite/ - * g++.dg/modules/atom-preamble-2_d.C: Check no duplicate. - gcc/ - * doc/invoke.texi (C++ Modules): Update. - - gcc/cp/ - * module.cc (module_state::from_partition_p): New field. - (module_state::maybe_partition_name): New. - (module_state::{read,write}_imports): Adjust. - (module_state::write_partitions): New. - (module_state::remap_partitions): Delete. - (trees_out::tree_decl): Remap owner. - (module_state::write_readme): Adjust. - (module_state_config): Add imports and partitions fields. - (module_state::{read,write}_config): Adjust. - (module_state::write): Separate out hidden partitions. Adjust - import & partition writing. - (module_state::read): Adjust import reading. - gcc/testsuite/ - * g++.dg/modules/import-1_c.C: Adjust scan. - * g++.dg/modules/mod-imp-1_c.C: Likewise. - - 2019-01-08 Nathan Sidwell - - gcc/cp/ - * cxx-mapper.cc (module2bmi): Update mapping - * module.cc (module_state::{maybe_defrost,freeze_an_elf}): Quote - filename.. - gcc/testsuite/ - * g++.dg/modules/modules.exp (decode_mod_spec): Update mapping. - * g++.dg/modules/freeze-1_d.C: Adjust scan-final. - * g++.dg/modules/import-2.C: Likewise. - * g++.dg/modules/mod-stamp-1_d.C: Likewise. - - gcc/cp/ - * module.cc (module_state::{interface_p,is_interface}): New. - (module_state::resolve_alias): Don't propagate exported_p here. - (module_state::write_readme): Show exportedness of imports. - (module_state::read_imports): Use resolve_alias. - (module_state::read_config): Set interface_p. - (module_state::read): Reformat. - (module_state::set_import): Correctly set imports. - (module_state::direct_import): Not here. - (declare_module): Set interface_p. - gcc/testsuite/ - * g++.dg/modules/import-1_e.C: Adjust scan. - - gcc/cp/ - * module.cc (bytes_out::set_crc): Only set if crc_ptr != 0. - (module_state::write_readme): Update for partitions. - (module_state::{read,write}_config): Write exported_p for - partitions. - (finish_module_parse): Write partitions. - gcc/testsuite/ - * g++.dg/modules/atom-decl-2.C: Adjust. - * g++.dg/modules/atom-pragma-3.C: Adjust. - * g++.dg/modules/mod-decl-1.C: Adjust. - * g++.dg/modules/mod-decl-3.C: Adjust. - - gcc/cp/ - * module.cc (module_state::direct_import): Add LAZY parm, use it - rather than legacy_p. Never expect a has_bmi file. - (declare_module): Always add to pending imports. - * parser.c (cp_parser_translation_unit): Expect a deferred import - for a legacy module. - - gcc/cp/ - * cp-tree.h (module_has_bmi_p): New. - * module.cc (module_state::{is_interface,interface_p}): Rename to ... - (module_state::{is_primary,primary_p}): ... here. Adjust users. - (module_state::read_cluster): Partitions need deduping too. - (declare_module): Set primary_p, partition_p. - (process_pending_imports): Adjust. - - gcc/cp - * cp-tree.h (module_export_depth, module_purview): Replace with ... - (module_kind): ... this. - (MK_MODULE, MK_GLOBAL, MK_INTERFACE, MK_PARTITION, MK_EXPORTING): New. - (module_purview_p, not_module_p, module_legacy_p) - (module_interface_p, module_partition_p, module_global_p) - (module_exporting_p): Adjust. - (declare_module): Return bool. - * module.cc (module_export_depth, module_purview): Replace with ... - (module_kind): ... this. - (module_maybe_interface_p): Delete. - (module_state::direct_import, declare_module) - (module_begin_main_file, process_deferred_imports) - (finish_module_parse): Adjust. - * name-lookup.c (make_namespae): Use module_global_p. - * parser.c (cp_parser_module_declaration): Return bool. Deal with - GMF introducer. - (cp_parser_translation_unit, cp_parser_module_export): Adjust. - gcc/testsuite/ - * g++.dg/modules/circ-1_d.C: Adjust. - * g++.dg/modules/mod-decl-1.C: Adjust. - * g++.dg/modules/mod-decl-5_b.C: Adjust. - * g++.dg/modules/p0713-3.C: Adjust. - - 2019-01-07 Nathan Sidwell - - gcc/cp/ - * cxx-mapper.cc (module2bmi): Don't map ':'. - * module.cc: Update design description. - gcc/testsuite/ - * g++.dg/modules/modules.exp (decode_mod_spec): Don't map ':' - - 2019-01-03 Nathan Sidwell - - gcc/cp/ - * name-lookup.h (match_global_decl): Rename to ... - (match_mergeable_decl): ... this. Add global/partition flag. - * name-lookup.c (match_global_decl): Rename to ... - (match_mergeable_decl): ... this. Adjust. - * module.cc: Rename mme to mergeable. - (trees_{in,out}::tree_mergeable): Stream global/partition - indicator. Call match_mergeable_decl. - - gcc/cp/ - * name-lookup.c (module_binding_slot): Break apart to ... - (search_imported_binding_slot, get_fixed_binding_slot) - (append_imported_binding_slot): ... these. - (fixed_module_binding_slot): Delete. - (do_pushdecl, match_global_decl, import_module_binding) - (set_module_binding, get_binding_or_decl, get_imported_namespace) - (reuse_namespace, make_namespace_finish) - (add_imported_namespace): Update for new API. - - 2019-01-02 Nathan Sidwell - - gcc/cp/ - * name-lookup.c (module_binding_slot): Use FIXED parm. - - gcc/cp/ - * name-lookup.c (module_binding_slot): Add FIXED parm, adjust all - callers. - - gcc/cp/ - * module.cc: Rename gme -> mme, because partitions. - - gcc/cp/ - * cp-tree.h (DECL_MODULE_PURVIEW_P): Delete. - (MAYBE_DECL_MODULE_PURVIEW_P): Delete. - * mangle.c (maybe_write_module): Adjust. - - gcc/testsuite/ - * g++.dg/modules/legacy-8_[abcde].[CH]: New. - - gcc/cp/ - * cxx-mapper.cc (server): Workaround PR c++/88664. - - Merge trunk r267509. - * module.cc, cxx-mapper.cc: Update copyright years. - - 2018-12-20 Nathan Sidwell - - MODULE_VEC has alloc field too. - gcc/cp/ - * cp-tree.h (MODULE_VECTOR_ALLOC_CLUSTERS): New. - (MODULE_VECTOR_NUM_CLUSTERS): Adjust. - (struct tree_module_vec): Adjust. - * tree.c (make_module_vec): Adjust. - * name-lookup.c (module_binding_slot): Extend vector if it fits. - * ptree.c (cxx_print_xnode): Cope with lazy module-vector slots. - - gcc/cp/ - * module.cc (module_state::check_read): Fix bogus note. - gcc/testsuite/ - * g++.dg/modules/indirect-1_c.C: Add bogus note test. - - gcc/cp/ - * module.cc (module_state::remap): New member var. - (module_state::remap_partitions): New. - (module_state::write_imports): Skip partitions. - (module_state::write): Remap partitions. - - 2018-12-19 Nathan Sidwell - - Partition parsing. Don't get excited! - gcc/cp/ - * module.cc (get_module): Attach current module for null - partition. - * parser.c (cp_parser_module_name): Parse partitions - gcc/testsuite/ - * g++.dg/modules/part-1_[ab].C: New. - - 2018-12-18 Nathan Sidwell - - gcc/cp/ - * cp-tree.h (get_module): Add partition arg. - * module.cc (module_state): Add partition flag. - (module_state_hash): Hash & compare partition flag. - (module_state::mangle, get_module, attach): Add partition awareness. - - gcc/cp/ - * cp-tree.h (get_module): Default NULL parent. - * lex.c (module_preprocess_token): Adjust get_module call. - * module.cc (get_module, module_begin_main_file): Likewise. - * parser.c (cp_parser_module_name): Likewise. - - gcc/cp/ - * module.cc (trees_out::tree_decl): Remove some remaining - non-atomic template hacks. - - gcc/cp/ - * module.cc (module_state::write): Sort dependency table. - - gcc/cp - * module.cc (module_cpp_undef): Don't zap undef hook if we don't - own it. - gcc/c-family/ - * c-opts.c (c_common_init): Don't unilaterally clobber undef - callback. - * c-ppoutput.c (cb_undef): Call lang_hook if non-null. - gcc/testsuite/ - * g++.dg/modules/dir-only-1.C: New. - - Merge trunk r267229. - - 2018-12-17 Nathan Sidwell - - gcc/cp/ - * module.cc (trees_out::{write,mark}_template_def): Delete. - (trees_out::{write,mark}_definition): Adjust. - (trees_in::read_template_def): Delete. - (trees_in::read_definition): Adjust. - - Kill old broken global module merge code. - gcc/cp/ - * module.cc (trees_in::finish): Remove DECL merging. - * name-lookup.c (merge_global_decl): Delete. - * name-lookup.h (merge_global_decl): Delete decl. - - Atomic TEMPLATE_DECL + DECL_TEMPLATE_RESULT. - gcc/cp/ - * module.cc (trees_out::mark_node): Remove temp tpl hack. - (trees_out::tree_decl): Remove tt_template remarking. - (trees_out::tree_value): Atomic TEMPLATE_DECL. - (trees_in::tree_node): Likewise. - (trees_out::{mark,read,write}_template_def): Move DECL_LIST to ... - (trees_out::{mark,read,write}_class_def): ... here. - (trees_{in,out}::tree_gme): Don't mark inner decl. - gcc/testsuite/ - * leg-merge-8_[abc].[CH]: New. - - Intermediate step to atomic TEMPLATE_DECL + DECL_TEMPLATE_RESULT. - Breaks leg-merge-7_c.C, - gcc/cp/ - * module.cc (tree_tag): Add tt_template, tt_implicit_template. - (node_template_info): Not a member fn. - (trees_out::{mark_node,mark_gme}): Mark the template. - (trees_{in,out}::tree_decl): Do implicit_template. - - 2018-12-14 Nathan Sidwell - - gcc/cp/ - * module.cc (trees_out::node_template_info): New, broken out of - ... - (trees_out::tree_decl): ... here. Use it. - - gcc/cp/ - * module.cc (trees_out::tree_decl): Adjust TEMPLATE_INFO access. - - 2018-12-13 Nathan Sidwell - - Function template deduping - gcc/cp/ - * module.cc (trees_{in,out}::tpl_parms): New. - (trees_out::mark_gme): Mark template result too. - (trees_{in,out}::tree_gme): Do templates. - (module_state::write_cluster): Any decl can be a GME. - * name-lookup.c (match_global_decl): Do template matching. - gcc/testsuite/ - * g++.dg/modules/leg-merge-7_[abc].[HC]: New. - - 2018-12-04 Nathan Sidwell - - gcc/cp/ - * module.cc (slurping::remap): Heap allocate. - (gt_pch_nx): Delete hacks. - - gcc/cp/ - * module.cc (tree_tag): Replace tt_named_type with - tt_{primary,secondary}_type. - (trees_out::tree_type): Not recursive. - (trees_in::tree_node): Adjust tt_named_type case. - - Class deduping - gcc/cp/ - * module.cc (trees_in::tree_node): Record defn to skip. - (trees_in::is_skip{,pable}_defn): Fix int/long ptr const. - (module_state::read_{function,var,class}_def): Add skip checking. - gcc/testsuite/ - * g++.dg/modules/leg-merge-6_[abc].[HC]: New. - - TYPE streamed with its implicit typedef. - gcc/cp/ - * module.cc (trees_in::reserve_gmes): Only 2 per. - (trees_in::{set,get}_backref_gme): Delete. - (trees_in::existing_gme): Rename to ... - (trees_in::is_existing_gme): ... this. Return bool. - (trees_out::mark_gme): Adjust assert. - (trees_in::insert): Add assert. - (trees_out::tree_type): Always look at typedef. - (trees_out::tree_value): Stream type with its decl. - (trees_in::tree_node): Likewise. - (trees_{in,out}::tree_gme): Adjust. - - gcc/cp/ - * module.c (module_state::{read,write,mark}_enum): Take DECL. - (module_state::{read,write,mark}_definition): Adjust. - - gcc/cp/ - * class.c (layout_class_type): Base type has same module as owner. - * module.c (module_state::{read,write,mark}_class): Take DECL. - (module_state::{read,write,mark}_definition): Adjust. - (topmost_decl, get_module_owner): Don't look at TYPE_CONTEXT. - - gcc/cp/ - * class.c (build_base_field_1): Refactor. - (layout_class_type): Give as_base type a name. - * decl.c (initialize_predefined_identifiers): Make as_base name - unpronouncable. - * module.cc (tree_tag): Delete tt_as_base. - (trees_out::mark_node): Don't expect fake base here. - (trees_out::tree_decl): Write fake base as pseudo-named. - (trees_out::tree_type): Don't handle fake base specially here. - (trees_in::tree_node): Read fake base as pseudo-named. Delete - tt_as_base handling. - (module_state::mark_class_def): Adjust. - - gcc/cp/ - * module.cc (trees_in): Rename bad_decls to skip_defns. - (trees_in::{record,is}_bad_decl): Delete. - (trees_in::{record,is,any}_skip_defn): New. - (module_state::is_ignorable_defn): Rename to ... - (module_state::is_skippable_defn): Key off namespace-scope decl. - (topmost_decl): New. - (module_state::read_function_def): Adjust. - - 2018-11-30 Nathan Sidwell - - Merge trunk r266680. - - gcc/cp/ - * module.cc: Fix enums with trailing commas. - * name-lookup.c (match_global_decl): Avoid unused arg warning. - - gcc/cp/ - * module.cc (module_state::write_binfos): Binfo was not visited. - - gcc/cp/ - * module.cc (module_state::write_binfos): Always write number of - vbases. - (module_state::read_binfos): Don't smash the type here. - (module_state:{read,write}_class_def): Adjust binfo serializing. - - gcc/cp/ - * class.c (fixup_type_variants): Copy TYPE_SIZE & TYPE_SIZE_UNIT. - (finish_struct): Use fixup_type_variants for template. - * module.cc (trees_{in.out}::core_vals): Don't serialize TYPE_SIZE - and TYPE_SIZE_UNIT for classes. - (trees_in::finish_type): Don't layout clesses here. - (module_state::{read,write}_class_def): Do it here. - - gcc/cp/ - * module.cc (trees_in): Add bad_decls and post_decls. - (trees_in::{record,is}_bad_decl): New. - (trees_in::post_process): New. - (module_state::is_{matching_decl,ignorable_defn}): New. - (trees_in::tree_node): Use former. - (module_state::read_function_def): Use latter. Register for - post-processig. - (module_state::read_cluster): Post process. - - 2018-11-29 Nathan Sidwell - - Merge global module function definitions. - gcc/cp/ - * modules.cc (module_state::write_function_def): Don't rely on - decl's form. - (module_state::read_function_def): Allow multiple decls. - gcc/testsuite/ - * g++.dg/modules/leg-merge-5_[abc].[CH]: New. - - gcc/cp/ - * modules.cc (module_state::check_read): Adjust, print inform of - outer location. - (module_state::write_cluster): defns are decls too. - (lazy_load_binding): Don't inform here. - gcc/testsuite/ - * g++.dg/modules/leg-merge-4_c.C: Adjust regexps. - - Fixing GME classes - gcc/cp - * module.cc (trees_in::tree_node_vals): Add specific bool arg, - adjust. - (trees_in::existing_gme): Return cookie. - (trees_in::{get,set}_backref_gme): New. - (trees_out::mark_gme): Mark typedef target. - (trees_out::tree_type): Don't be fooled by GME TYPE_NAME. - (trees_out::tree_value): Write GME type code. - (trees_in::tree_node): Use backref channel for typedefs. - gcc/testsuite/ - * g++.dg/modules/leg-merge-4_c.C: Adjust. - - Some ODR checking of GMEs - gcc/cp/ - * module.cc (trees_in::tree_node): Check type of matched GME. - (lazy_load_binding): Add note if diagnostics emitted. - * name-lookup.c (name_lookup::search_namespace_only): Forward - iterate over slots. - (match_global_decl): Return close matches. - gcc/testsuite/ - * g++.dg/modules/leg-merge-4_[abc].[CH]: New. - - Global module var declaration merging. - gcc/cp/ - * module.cc (trees_in::reserve_gmes): Add headroom. - (trees_{in,out}::tree_gme): Deal with VAR_DECLs. - (module_state::write_cluster): Likewise. - * name-lookup.c (match_global_decl): Likewise. - gcc/testsuite/ - * g++.dg/modules/leg-merge-3_[abcd].[CH]: New. - - Global module class declaration merging. - gcc/cp/ - * module.cc (trees_in::start): Check code & category. - (trees_in::tree_node): Allow gme types. Refactor gme/node - reading. - (trees_{in,out}::tree_gme): Allow implicit typedefs. - (module_state::write_cluster): GME Implicit typedefs too. - * name-lookup.c (match_global_decl): Match TYPE_DECLs too. - gcc/testsuite/ - * g++.dg/modules/leg-merge-2_[abc].[CH]: New. - - 2018-11-28 Nathan Sidwell - - Global module function declaration merging. - gcc/cp - * module.cc (tree_tag): Add tt_gme. - (trees_in::gmes): New data member. - (trees_in::tree_node_specific): Add no-alloc flag. - (trees_in::{tree_gme,reserve_gmes,existing_gme}): New. - (trees_out::walk_kind): Add WK_gme. - (trees_out::{mark,tree}_gme): New. - (trees_out::{ref_node,insert}): Deal with WK_gme walk. - (trees_out::tree_{decl,value}): Likewise. - (trees_in::tree_node): Add tt_gme support. - (cluster_tag): Add ct_gme. - (module_state::{read,write}_cluster): Add gme support. - * name-lookup.h (match_global_decl): Declare. - (add_module_decl): Declare. - * name-lookup.c (match_global_decl): New. - (set_module_binding): Don't dedup here. - (add_module_decl): New. - gcc/testsuite/ - * g++.dg/modules/leg-merge-1_[abcd].[CH]: New. - - gcc/cp/ - * modules.cc (trees_{in,out}::tree_node_bools): Break out - tree_node_specific. - (trees_out::ref_force_{lwm.hwm}): Delete. - (trees_out::gme_lwm): New. - (trees_out::insert): Change force to walk_kind. - (trees_out::mark_node): Drop walk_kind arg. - (trees_out::{,un}mark_trees): Adjust. - (trees_out::{mark_node,insert}): Adjust. - (trees_out::start): Drop CODE parm. - (trees_out::{ref_node,tree_ctx}): Adjust. - (trees_out::tree_value): Adjust. - (trees_{in,out}::tree_node): Likewise. - (module_state::write_binfos): Likewise. - (module_state::mark_{class,enum}_def): Adjust. - (module_state::{read,write}_cluster): Adjust. - (module_state::find_dependencies): Adjust. - - 2018-11-26 Nathan Sidwell - - gcc/cp/ - * modules.cc (trees_{in,out}::tree_node_raw): Bifurcate to ... - (trees_{in,out}::tree_node_{bools,vals}): ... these. - (trees_out::tree_value): Adjust. - (trees_in::tree_node): Likewise. - - gcc/cp/ - * modules.cc (trees_out::tree_ref): Rename to ... - (trees_out::ref_node): ... this. - (trees_out::tree{value,decl,type,namespace}): Replace FORCE - paramenter with walk_kind. - (trees_out::tree_node): Adjust. - (module_state::mark_{class,enum,template}_def): Adjust. - (module_state::write_cluster): Adjust. - (module_state::find_dependencies): Adjust. - - gcc/cp/ - * modules.cc (trees_out::walk_kind): New enum. - (trees_out::tree_ref): Return it. - (trees_out::tree_{ctx,decl,node}): Use it. - - gcc/cp/ - * modules.cc (trees_out::ref_force_{lwm.hwm}): New ref values. - (trees_out::{,un}mark_trees): Use them. - (trees_out::{mark_node,tree_ref}): Likewise. - - 2018-11-20 Nathan Sidwell - - gcc/cp/ - * modules.cc (dumper): Rename dump flags. Adjust throughout. - - 2018-11-19 Nathan Sidwell - - gcc/cp/ - * module.cc (handle_module_option): Handle OPT_fmodule_legacy. - gcc/testsuite/ - * g++.dg/modules/modules.exp: Insert /./ in legacy names. - * g++.dg/modules/*.H: Adjust as necessary. - - Merge trunk r266271. - - 2018-11-15 Nathan Sidwell - - Merge trunk r266161. - - gcc/ - * doc/invoke.texi: Rename cookie->ident, people read too much into - 'cookie'. - - 2018-11-07 Nathan Sidwell - - gcc/cp/ - * parser.c (cp_parser_translation_unit): Refactor. - - Implement d0924r1 (to be written). - gcc/cp/ - * lex.c (init_reswords): Set D_CXX_MODULES mask. - * module.cc (declare_module): Check purview state. - * parser.c (cp_parser_translation_unit): Module and import are - always conditional. - (cp_parser_tokenize): Likewise. - gcc/ - * doc/invoke.texi (fno-module-keywords): Delete. - gcc/c-family/ - * c-common.c (c_common_reswords): Don't mark import, module for CXXWARN. - * c.opt (fmodule-keywords): Delete. - gcc/testsuite/ - * g++.dg/modules/atom-decl-1.C: Delete. - * g++.dg/modules/keyword-1_[ab].C: Adjust. - g++.dg/modules/mod-decl-[13].C: Adjust. - g++.dg/modules/p0713-3.C: Adjust. - - gcc/cp/ - * cp-tree.h (module_gmf_p): Adjust. - (not_module_p): New. - * module.cc (declare_module): Don't deal with starting GMF. - * parser.c (cp_parser_translation_unit): Adjust module_purview - values. - - 2018-11-04 Nathan Sidwell - - Implement Bjarne's suggested solution. - gcc/cp/ - * parser.cc (cp_parser_translation_unit): No tentative parsing. - Look for following ::. - (cp_parser_module_{name,declaration,import}): Adjust. - (cp_parser_tokenize): Adjust, tokenize more. - gcc/ - * doc/invoke.texi (C++ Modules): Update. - gcc/testsuite/ - * g++.dg/modules/cpp-5_b.C: Update. - * g++.dg/modules/keyword-1_[ab].C: Likewise. - - 2018-11-02 Nathan Sidwell - - gcc/cp/ - * modules.c (module_state::read): Interface can be lazy too. - - gcc/cp/ - * name-lookup.c (STAT_EXPORTS): Rename to ... - (STAT_VISIBLE): ... this. - (name_lookup::search_namespace_only, name_lookup::add_module_fns) - (check_module_override, set_module_binding): Adjust. - * module.cc (module_state::read_cluster): Likewise. - - gcc/cp/ - * cp-tree.h (module_may_redeclare): Declare. - * decl.c (duplicate_decls): Check moduleness. - * module.cc (module_state::read_cluster): Adjust export tail. - (module_may_redeclare): New. - * name-lookup.c (name_lookup::search_namespace_only): Check - STAT_TYPE_VISIBLE_P. - (update_binding): Allow NULL LEVEL. - (check_module_override): New. - (do_pushdecl): Deal with module overrides. - (set_module_binding): Adjust. Don't push interface bindings. - gcc/testsuite/ - * g++.dg/modules/ambig-1_[ab].C: New. - * g++.dg/modules/macro-4_e.C: Avoid error. - * g++.dg/modules/namespace-2_b.C: Remove xfail. - - gcc/cp/ - * module.cc (module_state::read_cluster): Preserve export_tail. - * name-lookup.c (STAT_HACK_TYPE_VISIBILE_P): New. - (name_lookup::process_module_binding): Reimplement. - (name_lookp::search_namespace_only): Likewise. - (set_module_binding): Adjust when STAT_HACK_EXPORTS is set. - - gcc/cp/ - * decl.c (duplicate_decls): Refactor export check. - gcc/testsuite/ - * g++.dg/modules/export-1.C: New. - - gcc/cp/ - * decl.c (duplicate_decls): Refactor checks. - * name-lookup.c (name_lookup::process_module_binding): Only pubic - namespaces are shared. - gcc/testsuite/ - * g++.dg/lookup/crash6.C: Adjust error - * g++.dg/parse/crash38.C: Likewise. - - 2018-11-01 Nathan Sidwell - - Merge trunk r265714. - Move to autoconf 2.69. - - gcc/cp/ - * module.cc (module_state::read): Don't read macros for - preprocessed innput. - (module_state::set_import): Adjust legacy test. - - 2018-10-31 Nathan Sidwell - - gcc/cp/ - * module.cc (module_state::check_not_purview): Check name. - (mangle_module, module_name): Likewise. - (declare_module): Set parent, not alias. - - Merge trunk r265692. - - Merge trunk r265679. - - gcc/cp/ - * cp-tree.h (OVL_EXPORT_P): Delete. - (OVL_DEDUP_P): Move to lang flag 0. - * module.cc (module_state::read_cluster): Don't set OVL_EXPORT_P. - * tree.c (ovl_copy): Don't copy OVL_EXPORT_P. - - 2018-10-30 Nathan Sidwell - - Module interface gets own mod number - gcc/cp/ - * cp-tree.g (ovl_iterator::set_dedup): New. - * module.cc (module_state::{interface_p,is_interface}): New. - (module_state::check_not_purview): Adjust. - (mangle_module, module_name): Likewise. - (module_state::read_cluster): Adjust. - (module_state::read): Adjust. - (module_state::{set_import,direct_import}): Adjust import setting. - (declare_module): Module interface gets number. - * name-lookup.h (set_module_binding): Add iface parameter. - * name-lookup.c (name_lookup::search_namespace): Fix indexing. - (set_module_binding): Insert interface decls. - gcc/testsuite/ - * g++.dg/modules/namespace-4_b.C: Remove xfails. - * g++.dg/modules/static-1_b.C: Remove xfails. - - gcc/cp/ - * cp-tree.h (OVL_HAS_USING_P): Rename to ... - (OVL_DEDUP_P): ... here. - * name-lookup.c (name_lookup::add_overload) - (get_class_binding_direct): Adjust. - * tree.c (ovl_make, ovl_copy, ovl_insert, lookup_maybe_add): Adjust. - - Less ordered overloads - gcc/cp/ - * cp-tree.h (ovl_sort): Declare. - * name-lookup.h (extract_module_binding): Binding is reference. - * tree.c (ovl_insert): Don't sort non-hidden members. - (ovl_splice, ovl_sort): New. - * name-lookup.c (extract_module_binding): Binding is reference. - Sort the binding. - * ptree.c (cxx_print_xnode): Print MODULE_VEC name. - * module.cc (module_state::add_writables): Binding is reference. - gcc/testsuite/ - * g++.dg/lookup/friend21.C: New. - - 2018-10-29 Nathan Sidwell - - gcc/cp/ - * cp-tree.h (ovl_insert): Drop export_tail parm. - * name-lookup.c (update_binding): No need to track export_tail. - * tree.c (ovl_insert): Drop export_tail parm. - * ptree.c (cxx_print_xnode): Output formatting. - - gcc/cp/ - * module.cc (module_state::read_imports): Do in one pass. - - gcc/cp/ - * module.cc (module_state::direct_import): Drop DEFERRABLE arg. - ({import,declare}_module): Deal with deferring here. - (process_deferred_imports): Adjust direct_import call. - - 2018-10-27 Nathan Sidwell - - Merge trunk r265554. - - 2018-10-26 Nathan Sidwell - - Anon namespaces - gcc/cp/ - * module.cc (elf_out::strtab_write): Fallback to assembler name. - (elf_out::name): Allow 0 name. - (dumper::impl::nested_name): Fallback to assembler name. - (module_state::{read,write}_namespaces): Write assembler name for - anons. - * name-lookup.h (add_imported_namespace): add anon-name arg. - * name-lookup.c (get_imported_namespace): Look in current slot - too. - (make_namespace): Add anon-name arg, calculate as necessary. - (add_imported_namespace): add anon-name arg. - gcc/testsuite/ - * gcc/testsuite/g++.dg/modules/namespace-4_[abc].C: New. - - Statics on bindings - gcc/cp/ - * module.cc (depset::hash::add_binding): Take overload and type - values, do pruning here. - (module_state::write_cluster): Reorder binding emission. - (module_state::read_cluster): Determine export_tail here. - (module_state::add_writables): Adjust. - * cp-tree.h (ovl_iterator::export_tail): Delete. - * name-lookup.h (extract_module_decls): Rename to ... - (extract_module_binding): ... here. Return overload set. - * name-lookup.c ( (extract_module_decls): Rename to ... - (extract_module_binding): ... here. Don't prune here. - (set_module_binding): Simplify. - (lookup_by_ident, get_lookup_ident): Simplify. - gcc/testsuite/ - * g++.dg/modules/static-1_b.C: XFAIL error - * gcc/testsuite/g++.dg/modules/unnamed-1_[ab].C: Adjust scans. - * gcc/testsuite/g++.dg/modules/unnamed-2.C: Likewise. - - gcc/cp/ - * cp-tree.h (module_purview): Declare. - (module_purview_p, module_interface_p, module_gmf_p): Inline - predicates. - * module.cc (module_purview): Extern. - (module_purview_p, module_interface_p): Delete. - - p1103 no implicit namespace export - gcc/cp/ - * module.cc (trees_out::mark_node): Allow namespace marking. - (trees_out::tree_ctx): Namespaces may be forced. - (trees_out::tree_namespace): Reimplement. - (trees_out::tree_{type,decl}): Adjust tree_ctx calls. - (module_state::write_cluster): Likewise. - (module_state::{read,write}_namespace): Adjust. - (module_state::find_dependencies): Also walk namespaces. - * name-lookup.c (name_lookup::process_binding): Fixup hidden - namespaces. - (implicitly_export_namespace): New. - (do_pushdecl, push_namespace): Call it. - (add_imported_namespace): Add export_p arg, adjust. - * name-lookup.h (add_imported_namespace): Add export_p arg. - * ptree.c (cxx_print_node): Adjust MODULE_VEC printing. - gcc/testsuite/ - * g++.dg/modules/indirect-1_b.C: Adjust scans. - * g++.dg/modules/namespace-[23].C: Split to ... - * g++.dg/modules/namespace-[23]_[ab].C: ... these. - - 2018-10-25 Nathan Sidwell - - Rationalize bool ok == true - gcc/cp/ - * module.cc (elf::has_error): Rename to ... - (elf::get_error): ... this. Update all callers. - (elf::end): Return true == ok. Update (indirect) callers. - (module_state::check_read): Likewise. Update callers. - (module_state::lazy_load): Zap slot on failure. - * name-lookup.c (get_binding_or_decl): No need to assert here. - - gcc/cp/ - * module.cc (module_state::write_readme): Tidy. - (module_state::{add_writables,find_dependencies): Dump - DEPENDENCIES. - (module_state::direct_import): Always pop dump. - * ptree.c (cxx_print_decl): Print DECL_MODULE_EXPORT_P. - gcc/c-family/ - * c-ppoutput.c (scan_translation_unit): Remove unused var. - - 2018-10-24 Nathan Sidwell - - gcc/cp/ - * module.cc (enum tree_tag): Add tt_namespace. - (trees_out::tree_namespace): Use it. - (trees_in::tree_node): Grok it. - * name-lookup.h (get_imported_namespace): Declare. - * name-lookup.c (get_imported_namespace): New. - gcc/testsuite/ - * g++.dg/modules/indirect-1_c.C: Adjust. - - gcc/cp/ - * module.cc (trees_out::{tree_{decl,type}): Drop owner arg. - (trees_out::tree_namespace): New. - (trees_out::ctx): Take owning-decl arg, use tree_namespace. - (trees_out::{core_vals,tree_binfo}): Adjust. - (trees_out::{read,write}_cluster): Adjust. - - 2018-10-23 Nathan Sidwell - - gcc/cp/ - * module.cc: Add dumper::TREES to tree streamers. - gcc/testsuite/ - * g++.dg/modules/: Add -uid to several lang dumps. - - gcc/cp/ - * module.cc (slurping::remap_module): New. - (depset::hash::add_binding): Don't deal with namespaces here. - (module_state::write_namespaces): No longer static. Write - locations. - (module_state::read_namespaces): Read locations. - (module_state::add_writables): Deal with namespaces here. - (module_state::find_dependencies): Don't walk namespaces. - * name-lookup.h (get_lookup_ident, find_by_ident): Reorder args, - update callers. - (add_imported_namespace): Add location arg. - * name-lookup.c (module_binding_slot): Fix initial alloc. - (extract_module_decls): Return namespace. - (get_binding_or_decl, lookup_by_ident, get_lookup_ident): Reorder - args. - (make_namespace): Add loc & module args. - (push_namespace): Adjust. - (add_imported_namespace): Adjust. - * ptree.c (cxx_print_decl): Avoid final linefeed. - (cxx_print_xnode): Adjust MODULE_VEC - gcc/ - * doc/invoke.texi: Document -fdump-lang-module options. - gcc/testsuite/ - * g++.dg/modules/namespace-2.C: Adjust. - - 2018-10-22 Nathan Sidwell - - gcc/cp/ - * cp-tree.h (module_exporting_level): Delete. - (module_export_depth): Declare. - (module_exporting_p): New. - ({push,pop}_module_export): Adjust, make inline. - * module.cc (export_depth): Replace with ... - (module_exporting_level): ... this. - ({push,pop}_module_export): Delete. - (set_module_owner, import_module, module_begin_main_file) - (finish_module_parse): Adjust. - * parser.cc (cp_parser_module_export): Adjust. - - gcc/cp/ - * lex.c (module_preprocess_token): Fix padding/comment states. - * parser.c (cp_parser_tokenize): Reduce is_decl states. - - 2018-10-21 Nathan Sidwell - - Merge trunk r265362. - - Add -fno-module-keywords. - gcc/ - * doc/invoke.text (fmodule-keywords): Document. - gcc/cp/ - * lex.c (init_reswords): Don't add module keywords if - fno-module-keywords. - *module_preprocess_token): Adjust. - * module.cc (module_State_config:get_opts): Drop fmodule-keywords. - * parser.c (cp_parser_import_declaration): Allow to be tentative. - (cp_parser_translation_unit): Allow module & import to not be - keywords. Tentatively parse import declaration. - (cp_parser_module_keyword): Commit to tentative parse. - (cp_parser_tokenize): Allow import to not be a keyword. - gcc/testsuite/ - * g++.dg/modules/keywords-1_[ab].C: New. - - gcc/cp/ - * lex.c (module_preprocessing_token): Pay attention to braces. - * parser.c (cp_parser_tokenize): Return ptr to stopping import. - Pay attention to CPP_HEADER tokenization. - (cp_parser_translation_unit): Adjust. - - gcc/cp/ - * parser.c (cp_parser_diagnose_invalid_type_name): Use C_RID_CODE - more. - - 2018-10-19 Nathan Sidwell - - gcc/cp/ - * parser.c (cp_parser_tokenize): Don't stop after nested - module/import decl. - - 2018-10-18 Nathan Sidwell - - gcc/cp/ - * parser.c (cp_parser_translation_unit): Adjust GMF deferred - imports. - (cp_parser_tokenize): Only pay attention to module/export at start - of decl. - - gcc/cp/ - * parser.c (cp_parser_translation_unit): Process deferred imports - here ... - (cp_parser_tokenize): ... not here. - gcc/testsuite/ - * g++.dg/modules/macloc-1_d.C: Correct regexp. - - Expunge -fmodules-atom as a thing. - gcc/ - * doc/invoke.texi (fmodules-atom): Delete. - gcc/cp/ - * cp-tree.h (modules_legacy_p): Adjust. - * module.cc: Expunge OPT_fmodules-atom. - gcc/c-family/ - * c.opt (fmodules-ts): Adjust. - (fmodules-atom): Alias fmodules-ts - (fmodule-legacy*): Adjust. - - gcc/testuite/ - * g++.dg/modules/modules.exp (mode-list): Delete. - (main): Don't use mode-list. - * g++.dg/modules/: Add -fmodules-ts to many tests. - - Remove ATOM as a distinction. - gcc/c-family/ - * c-cppbuiltin.c (c_cpp_builtins): Remove __cpp_modules_{atom,ts}. - * c.opt (fmodules-ts): Adjust. - gcc/cp/ - * cp-tree.h (modules_atom_p): Delete. - * module.cc (module_state::write_readme): Drop ATOM distinction. - (module_state::{read,write}_config): Likewise. - (init_module_processing): Drop atom distinction. - (handle_module_option): Adjust. - gcc/testsuite/ - * g++.dg/modules/: Drop -fmodules-atom from all tests. - - Simplify translate-include hook. - libcpp/ - include/cpplib.h (cpp_translate_include_t): Delete. - (struct cpp_calbacks): Adjust translate_include decl. - gcc/ - * langhooks.h (struct lang_hooks): Adjust preprocess_translate_include. - gcc/c-family - * c-opts.c (c_common_post_options): Adjust. - gcc/cp/ - * cp-tree.h (maybe_import_include): Replace by ... - (module_translate_include): ... this. - * cp-lang.c (LANG_HOOKS_PREPROCESS_TRANSLATE_INCLUDE): Adjust. - * module.c (module_state::do_import): Check read on all top level - imports. - (do_translate_include): Rename to ... - (module_translate_include): ... this. Explicitly turn off. - (maybe_import_include): Delete. - - Preamble on module - gcc/cp/ - * parser.c (cp_parser_import_declaration): Always check past_preamble. - gcc/testsuite/ - * g++.dg/modules/atom-norescan-1.C: Delete. - * g++.dg/modules/atom-pragma-1.C: Not atom-specific. - * g++.dg/modules/atom-pragma-3.C: Likewise. - * g++.dg/modules/atom-preamble-1.C: Likewise. - * g++.dg/modules/atom-preamble-2_a.C: Likewise. - * g++.dg/modules/atom-preamble-2_b.C: Likewise. - * g++.dg/modules/atom-preamble-2_c.C: Likewise. - * g++.dg/modules/atom-preamble-2_d.C: Likewise. - * g++.dg/modules/atom-preamble-2_e.C: Likewise. - * g++.dg/modules/atom-preamble-3.C: Likewise. - * g++.dg/modules/atom-preamble-4.C: Likewise. - * g++.dg/modules/mod-indirect-1_b.C: Adjust. - - No export { import x; } - gcc/cp/ - * parser.c (cp_parser_tokenize): Drop nested arg, adjust. - (cp_parser_translation_unit): Don't deal with outermost export { block. - gcc/testsuite/ - * g++.dg/modules/err-1_a.C: Adjust. - * g++.dg/modules/err-1_c.C: Adjust. - * g++.dg/modules/import-1_c.C: Adjust. - * g++.dg/modules/mod-decl-1.C: Adjust. - - - No atom preamble in non-module - gcc/cp/ - * parser.c (cp_parser_translation_unit): Preamble is tristate. - (cp_parser_module_name): Add FOR_MODULE arg, issue error. - (cp_parser_module_declaration): Adjust. - (cp_parser_import_declaration): Adjust twice. - gcc/testsuite/ - * g++.dg/modules/atom-decl-[23].C: Adjust. - * g++.dg/modules/legacy-6_f.C: Remove XFAIL. - - 2018-10-17 Nathan Sidwell - - gcc/testsuite/ - * g++.dg/modules/err-2_[ab].*: Move to ... - * g++.dg/modules/cpp-5_[ab].*: ... here. - * g++.dg/modules/cpp5_c.C: New. - - Robustify parse errors on module/import decls. - gcc/cp/ - * parser.c (cp_parser_consume_semicolon_at_end_of_statement): - Return void. - (cp_parser_translation_unit): Adjust. - (cp_parser_{module,import}_declaration): Don't try and resync - here. - (cp_parser_tokenize): Deal with unprocessed incoming tokens. - gcc/testsuite/ - * g++.dg/modules/err-2_[ab].*: New. - - 2018-10-16 Nathan Sidwell - - Remove some atom/ts differences. - gcc/cp/ - * module.cc (declare_module): Copy always. - * parser.c (cp_parser_translation_unit): Allo GMF under atom. - (cp_parser_module_name): Allow legacy name under ts - (cp_parser_initial_pragma): Fix from trunk. - gcc/testsuite/ - * g++.dg/modules: Many changes. - - gcc/cp/ - * module.cc (module_purview): New. - (module_purview_p, module_interface_p): Use it. - (module_maybe_interface_p): New. - (module_state::direct_import): Use it. - (process_deferred_imports): Likewise. - (declare_module): Set it. - * parser.c (cp_parser_translation_unit): Inform modules of GMF. - - gcc/testsuite/ - * g++.dg/modules/macloc-1_[abcd].C: No longer atom-specific. - - Locations for everyone! - gcc/cp/ - * module.cc (loc_spans::{init,open,close}): Dump info. - (module_state::{read,write}_location): No longer atom-specific. - (module_state::{read,write}): Locations for everyone. - (process_deferred_imports): Open and close spans correctly. - gcc/testsuite/ - * g++.dg/modules/adhoc-1_[ab].C: No longer atom-specific. - * g++.dg/modules/loc-1_[abc].C: Likewise. - * g++.dg/modules/loc-2_[abcdef].C: Likewise. - - gcc/ - * dumpfile.c (dump_switch_p_1): Don't let a '-' filename fool the - option machinery. - - Legacy importing during -E - gcc/c-family/ - * c-lex.c (init_c_lex): Don't use lang_hooks here. - * c-opts.c (c_common_init): Set them here. - gcc/cp/ - * lex.c (module_preprocess_token): Enable legacy importing. - * module.cc (module_state::read): Skip items when preprocessing - only. - (module_cpp_undef): Adjust unsetting. - gcc/testsuite/ - * g++.dg/modules/cpp-2_c.C: Adjust. - - Remove token peeking & preamble related infrastructure. - libcpp/ - * include/cpplib.h (cpp_relocate_peeked_tokens): Delete. - (cpp_peek_token_with_location): Delete. - (cpp_in_macro_expansion_p): Delete. - * directives-only.c (_cpp_preprocess_dir_only): Adjust - _cpp_handle_directive call. - * directives.c (struct if_stack): Drop hash_loc. - (PEEK_INVISIBLE): Delete. - (linemarker_dir): Adjust. - (_cpp_handle_directive): Drop hash_loc arg. dont set it. - (push_conditional): Drop hash_loc. - * init.c (read_original_filename): Adjust _cpp_handle_directive - call. - * internal.h (struct cpp_reader): Delete peeked_directive field. - (_cpp_handl_directive): Drop hash_loc arg. - * lex.c (cpp_relocate_peeked_tokens): Delete. - (cpp_peek_token): Swallow ... - (cpp_peek_token_with_location): ... this. Delete. - (_cpp_lex_token): Adjust _cpp_handle_directive call. - * macro.c (cpp_in_macro_expansion_p): Rename to ... - (cpp_in_macro_expansion): ... this. Make static. - * traditional.c (_cpp_scan_out_logical_line): Adjust - _cpp_handle_directive call. - - gcc/testsuite/ - * g++.dg/modules/*.H: Drop unnecessary -fmodules-atom option. - - Reimplement preamble peeking - gcc/ - * doc/invoke.texi (fmodule-preamble): Delete. - * langhooks-def.h (LANG_HOOKS_PREPROCESS_PREAMBLE): Replace with ... - (LANG_HOOKS_PREPROCESS_TOKEN): ... this. - * langhooks.h (struct lang_hooks): Replace preprocess_preamble - with preprocess_token. - c-family/ - * c-ppoutput.c (scan_translation_unit): Adjust preprocess lang - hook. - * c.opt (fmodule-preamble, fmodule-preamble=): Delete. - gcc/cp/ - * cp-lang.c (module_preamble_fsm): Delete. - (LANG_HOOKS_PREPROCESS_PREAMBLE): Delete. - (LANG_HOOKS_PREPROCESS_TOKEN): Override. - * cp-tree.h (enum module_preamble_state): Delete. - (module_preamble_prefix_{peek,next}): Delete. - (module_preprocess_token): Declare. - * lex.c (module_preamble_prefix_{peek,next}): Delete. - (module_preprocess_token): New. - * module.c (init_module_processing, handle_module_option): Drop - preamble option handling. - gcc/testsuite/ - * g++.dg/modules/*: Many changes. - - Remove preamble repeating. - gcc/cp/ - * cp-tree.h (maybe_repeat_preamble): Delete. - * module.c (maybe_repeat_preamble): Delete. - * parser.c (cp_parser_initial_pragma): Revert to trunk. - * lex.c (modle_preamble_prefix_peek): Don't repeat preamble. - gcc/testsuite/ - * g++.dg/modules/cpp-preamble-1.C: Adjust. - * g++.dg/modules/atom-preamble-1.C: Is now well formed. - - Remove preamble peeking - gcc/cp/ - * cp-tree.h ({import,declare}_module): return void. - (process_deferred_imports): Return void. - (module_state::direct_import): Return void, deferrable is - tristate. Push onto pending_import vector if permitted. - ({import,declare}_module): Don't return adjustment, use - direct_import always. - (process_deferred_imports): Don't return adjustment. - * parser.c (cp_parser_module_declaration): Return void, drop first - arg. - (cp_parser_import_declaration): Return void. - (cp_parser_module_export): Don't deal with module declaration - here. - (cp_parser_get_module_preamble_tokens) - (cp_parser_parse_module_preamble): Delete. - (cp_parser_tokenize): Delete #ifdef'd adjustment code. - (c_parse_file): Don't peek preamble. - libcpp/ - * line-map.c (linemap_module_restore): Don't calculate adjustment. - * include/line-map.h (linemap_module_restore): Return void. - - Common tokenizer for atom & ts - gcc/cp/ - * module.cc ({import,declare}_module): Don't defer legacy modules. - * parser.c (cp_parser_translation_unit): Deal with atom preamble. - (cp_parser_module_declaration): No need to check if first. - (cp_parser_tokenize): Enable filename token as needed. - (c_parse_file): Disable preamble scan. - gcc/testsuite/ - * g++.dg/modules/alias-1_b.C: Adjust. - * g++.dg/modules/atom-pragma-1.C: Adjust - * g++.dg/modules/atom-pragma-2.C: Delete. - * g++.dg/modules/atom-preamble-2_e.C: Copy from 2_f.C - * g++.dg/modules/atom-preamble-2_f.C: Delete. - * g++.dg/modules/atom-preamble-[34].C: Adjust. - * g++.dg/modules/atom-rescan-1.C: Delete. - * g++.dg/modules/ice-1.C: Adjust - * g++.dg/modules/macro-2_c.H: Adjust - * g++.dg/modules/macro-3_b.H: Adjust - * g++.dg/modules/macro-3_c.C: Adjust - * g++.dg/modules/macro-6_b.C: Adjust - - gcc/cp/ - * cp-tree.h (process_deferred_imports): Drop location arg. - * modules.cc ({import,declare}_module): Disable eager imports. - (process_deferred_imports): Drop location arg, take it from the - deferred imports. - * parser.c (cp_parser_translation_unit): Process deferred imports. - (cp_parser_tokenize): Correct close-brace handling. Process - deferred imports. - (c_parse_file): Adjust prcess_deferred_imports call. - gcc/testsuite/ - * g++.dg/modules/atom-preamble-1.C: More workarounds - - gcc/cp/ - * parser.c (cp_parser_translation_unit): Detect GMF here ... - (cp_parser_module_declaration): ... not here. - - 2018-10-15 Nathan Sidwell - - gcc/cp/ - * cp-tree.h ({import,declare}_module): Return adjustment. - * module.c (module_state::direct_import): Preserve line table, - return adjustment. - * parser.c (cp_parser_fill_main): Delete. - (cp_parser_tokenize): Take cp_token pointer, reorder check & push. - (cp_parser_translation_unit): Take cp_token pointer, call - cp_parser_tokenize. - (c_parse_file): Don't tokenize here. - - gcc/cp/ - * lang-specs.h: Fix .s elision with legacy modules. - - gcc/ - * langhooks.h (struct lang_hooks): Adjust preprocess_main_file - signature. - gcc/c-family/ - * c-opts.c (push_command_line_include): Adjust - preprocess_main_file hook call. - (cb_file_change): Likewise. - gcc/cp/ - * cp-lang.c (LANG_HOOKS_PREPROCESS_MAIN_FILE): Adjust. - * cp-tree.h (module_note_main_file): Rename to ... - (module_begin_main_file): ... here. - (maybe_begin_legacy_module): Delete. - * module.cc (declare_module): Remove legacy handling here. - (module_note_main_file): Rename to ... - (module_begin_main_file): ... here. Swallow ... - (maybe_begin_legacy_module): ... this. - (process_deferred_imports): We're already exporting for legacy - headers. - * parser.c (c_parse_file): Don't call maybe_begin_legacy_module. - - gcc/cp/ - * cp-tree.h (process_deferred_imports): New. - (module_preamble_load): Delete. - * module.cc (module_state::direct_import): Fatal error here. - (module_state::preamble_load): Delete, move into ... - (process_deferred_imports): ... here. Subsume ... - (module_preamble_load): ... this. - * parser.c (c_parse_file): Adjust. - gcc/testsuite/ - * g++.dg/modules/atom-inc-1.C: Delete. - * g++.dg/modules/atom-inc-1_[abc].*: New. - * g++.dg/modules/import-2.C: Adjust. - - gcc/cp/ - * module.cc (module_state::direct_import): New. - ({import,declare}_module): Call it. - (module_state::preamble_load): Likewise. - - 2018-10-12 Nathan Sidwell - - libcpp/ - * lex.c (cpp_peek_token_with_location): Fix pragma rewinding. - gcc/cp/ - * parser.c (cp_parser_initial_pragma): Peek at first token. - - Merge trunk r265127. - - gcc/cp/ - * parser.c (cp_parser_{module,import}_declaration): Remove temp hacks. - (cp_parser_translation_unit, cp_parser_parse_module_preamble): Adjust. - gcc/testsuite/ - * g++.dg/modules/atom-decl-1.C: Adjust errors. - * g++.dg/modules/atom-preamble-1.C: Likewise. XFAIL. - * g++.dg/modules/mod-decl-1.C: Likewise, - * g++.dg/modules/p0713-[23].C: Likewise. - - gcc/cp/ - * parser.c (cp_parser_translation_unit): Deal with one level of - export block here. - (check_module_outermost): Delete. - (cp_parser_{module,import}_declaration): Don't call it. - (cp_parser_declaration): Don't deal with module or import decls. - gcc/testsuite/ - * g++.dg/modules/mod-decl-[13].C: Adjust errors. - - gcc/cp/ - * parser.c (cp_parser_translation_unit): Detect module and import - declarations here. - - Start breaking out toplevel parsing. - gcc/c-family/ - * c.opt (Wlegacy-header): Delete. - gcc/ - * doc/invoke.texi (Wlegacy-header): Delete. - gcc/cp/ - * cp-lang.c (module_preamble_fsm): Don't call atom_preamble_end. - * cp-tree.h (atom_preamble_end): Delete. - * lex.c (module_preamble_prefix_peek): Drop Wlegacy_header check. - * module.cc (module_preamble_end_loc): Delete. - (do_translate_include): Always translate. - (maybe_import_include): Drop Wlegacy_header check. - (atom_preamble_end): Delete. - * parser.h (cp_parser): Drop implicit_extern_c. - * parser.c (cp_parser_tokenize): New. - (cp_debug_parser): Drop implicit_extern_c. - (cp_parser_new): Likewise. - (cp_parser_translation_unit): Move global module detectin here. - (module_preamble_end_loc): Delete declaration. - (in_preamble): Temp hack. - (cp_parser_{import,module}_declaration): A couple of temp hacks. - (cp_parser_parse_module_preamble): Manipulate in_preamble. - (cp_parser_toplevel_declaration): New, broken out of ... - (cp_parser_declaration_seq_opt): ... here, call it. Drop top_level arg. - (c_parse_file): Adjust. - gcc/testsuite/ - * g++.dg/modules/atom-decl-[23].C: Adjust diags. - * g++.dg/modules/atom-preamble-[13].C: Likewise. - * g++.dg/modules/legacy-6_[df].C: Likewise. - - 2018-10-11 Nathan Sidwell - - Merge trunk r265055. - - Kill proclaiming decls - gcc/cp/ - * cp-tree.h (push_module_export): Drop proclaiming arg. - * module.c (proclaimer): Delete. - ({push,pop}_module_export): Adjust. - (maybe_begin_legacy_module, module_preamble_load): Adjust. - * parser.c (cp_parser_module_export): Adjust error. - (cp_parser_module_proclamation): Delete. - (cp_parser_declaration): Don't call it. - gcc/testsuite/ - * g++.dg/modules/proclaim-1.C: Delete. - - Macro locations! (ATOM only) - libcpp/ - * internal.h (linemap_enter_macro): Move declaration to ... - * include/cpplib.h (linemap_enter_macro): ... here. - (linemap_lookup_macro_index): Declare. - * line-map.c (linemap_lookup_macro_index): Break out of ... - (linemap_macro_map_lookup): ... this. Use it. - gcc/cp/ - * module.cc (loc_spans): Record macro spans. - (module_state::write_readme): Record controlling macro. - (module_state::{read,write}_location{s,}): Stream macro locations. - (module_state::write_readme): Move later. - gcc/testsuite/ - * g++.dg/modules/macloc-1_[abcd].C: New. - - Merge trunk r265037. - - 2018-10-10 Nathan Sidwell - - gcc/cp/ - * module.cc (loc_spans::close): Close the current last map. - (module_state::prepare_locations): Adjust. - (module_state::preamble_load): Adjust span closing. - (finish_module_parse): Likewise. - - gcc/cp/ - * module.cc (pending_imports): New. - ({import,declare}_module): Use it. - (module_from_cmp): Delete. - (module_state::preamble_load): Use pending_imports array. - - gcc/ - * doc/invoke.texi (fmodule-legacy): Augment syntax. - gcc/cp/ - * module.cc (module_controlling_macro): Replace with ... - (module_legacy_macro): ... this. - (module_state::{read,write}_config): Controlling macros only for - legacy mode. - (set_module_legacy_name): New. - (maybe_begin_legacy_module, handle_module_option): Use it. - (init_module_processing, finish_module_parse): Adjust. - gcc/c-family/ - * c.opt (fmodule-macro): Delete. - gcc/testsuite/ - * g++.dg/modules/alias-1_a.H: Fix. - * g++.dg/modules/legacy=0[ab].H: Adjust. - * g++.dg/modules/alias-2_*: New. - - gcc/cp/ - * module.cc (module_state::controlling_macro): Delete. - (module_state_config): New struct. - (module_state::{read,write}_config): Wrap args in a struct. - (get_option_string): Move into module_state_config. - (module_state::write_macros): Adjust. - (module_state::{read,write}): Adjust. - - gcc/cp/ - * module.cc (module_state::{read,write}_defines): Rename to ... - (module_state::{read,write}_macros): ... here. - (module_state::{read,write}): Cope with legacy aliases. - (finish_module_parse): Install initialized controlling macro. - gcc/testsuite/ - * g++.dg/modules/alias-1_[cdef].C: New. - - 2018-10-09 Nathan Sidwell - - Lazy macro table loading - gcc/cp/ - * module.cc (struct slurping): Add macro_tbl, rename macros to - macros_def. - (slurping::~slurping): Release macro_tbl. - (module_state::{read,write}_config): Replace macro count with - boolean. - (module_state::{import,install}_defines): New. - (module_state::read_defines): Map in the table, don't read it. - (module_state::{check_read,freeze_an_elf}): Adjust. - (import_module, module_state::preamble_load): Use install_defines. - gcc/testsuite/ - * g++.dg/modules/macro-6_[abc].*: New. - - Controlling macros & alias detection - gcc/cp/ - * module.cc (cpp_node, identifier): Conversions between - cpp_hashnode and IDENTIFIER. Use them. - (data_in::no_more): Seek end. - (module_state::{resolve,is}_alias): New. - (module_state::read): Return alias. - (module_state::read_config): Initialize controlling macro, - determine alias. - (module_state::{read,write}_define): Allow unlocated macros. - (module_controlling_macro): New switch. - (module_state::{read_imports,do_import}): Deal with aliases. - (module_state::write_config): Write controlling macro. - (module_state::write_defines): Deal with controlling macro. - (module_state::preamble_load): Deal with aliases. - (finish_module_parse): Process explicit controlling macro. - gcc/testsuite/ - * g++.dg/modules/alias-1*: New. - * g++.dg/modules/macro-[234]*: Adjust. - * g++.dg/modules/only-[23].C: Adjust. - libcpp/ - * include/cpplib.h (HT_NODE,NODE_LEN,NODE_NAME): Adjust. - (cpp_set_deferred_macro): Add defaulted forced arg. - - 2018-10-05 Nathan Sidwell - - gcc/cp/ - * module.cc (module_state::deferred_macro): Print macro - definition. - gcc/testsuite/ - * g++.dg/modules/macro-2_d.C: Adjust regexps. - * g++.dg/modules/macro-4_[de].C: Likewise. - * g++.dg/modules/macro-5_c.C: Likewise. - libcpp/ - * include/cpplib.h (cpp_macro_definition): Add overload. - (cpp_macro_definition_location): Make inline, adjust. - * macro.c (get_deferred_or_lazy_macro): New, broken out of ... - (_cpp_notify_macro_use): ... here. Call it. - (warn_of_redefinition): Call it. - (cpp_macro_definition): Split into two overloads. Deal with - deferred macros. - (cpp_macro_definition_location): Delete. - - gcc/cp/ - * module.cc (module_state): Add controlling_macro, unionize slurp - with alias. Add accessors. Use them. - (module_state::{read,do_import,read_config}): Drop check_crc arg. - (module_state::read_imports): Zap direct_p before importing. - - Use 'include translation' terminology. - gcc/c-family/ - * c-opts.c (c_common_post_options): Adjust. - gcc/cp/ - * cp-lang.c (LANG_HOOKS_PREPROCESS_TRANSLATE_INCLUDE): Override. - * cp-tree.h (maybe_import_include): Adjust return type. - * module.cc (module_mapper::translate_include): Replace ... - (module_mapper::divert_include): ... this. - (do_translate_include): Replace ... - (do_divert_include): ... this. - (maybe_import_include, atom_preamble_end): Adjust. - gcc/ - * langhooks-def.h (LANG_HOOKS_PREPROCESS_DIVERT_INCLUDE): Replace - with ... - (LANG_HOOKS_PREPROCESS_TRANSLATE_INCLUDE): ... this. - * langhooks.h (struct lang_hooks): Replace - preprocess_divert_include with preprocess_translate_include. - libcpp/ - * directives.c (do_include_common): Adjust. - * include/cpplib.h (cpp_divert_include_t): Rename to ... - (cpp_translate_include_t): ... this. - (struct cpp_callbacks): Replace divert_include with translate_include. - - Mainfile loc has no line number. - libcpp/ - * internal.h (_cpp_stack_file): Add line_one_p arg. - * files.c (_cpp_stack_file): Likewise. Use it. - * include/cpplib.h (cpp_read_main_file): Add line_one_p arg. - * init.c (cpp_read_main_file): Likewise, use it. - gcc/c-family/ - * c-opts.c (c_common_post_options): Start main file on line zero. - (push_command_line_include): Call preprocess_main_file hook here ... - (cb_file_change): ... except when reading preprocessed source. - * c.opt: Add full stops. - gcc/cp/ - * module.cc (module_note_main_file): Remove fixmes fixed yesterday. - gcc/testsuite/ - * g++.dg/modules/macro-4_[de].C: Adjust regexp. - * g++.dg/modules/macro-5_c.C: Likewise. - * lib/options.exp (check_for_options): Fix comment typos. - - 2018-10-04 Nathan Sidwell - - Dump command line macros, better command line locs - libcpp/ - * include/cpplib.h (cpp_force_token_locations): Take location, not - pointer. - * internal.h (cpp_reader): Replace forced_token_location_p with - forced_token_location. - * init.c (cpp_create_reader): Adjust. - * lex.c (_cpp_lex_direct, cpp_force_token_locations): Adjust. - (cpp_stop_forcing_token_locations): Adjust. - gcc/c-family/ - * c-opts.c (c_finish_options): Force command line locations. - gcc/cp/ - * module.cc (loc_spans::init): Add fixed and cmd line locs. - (loc_spans::SPAN_*): New. - (loc_spans::cmd_line): New. - (module_state::read_location): Adjust, return module loc for - UNKNOWN. - (module_state::{prepare,read,write}_locations): Adjust. - (maybe_add_macro): Write cmd_line macros. - (load_macros): Location is main source file. - gcc/fortran/ - * cpp.c (gfc_cpp_init): Adjust token forcing. - gcc/testsuite/ - * g++.dg/modules/macro-4_[de].C: Adjust regexp. - * g++.dg/modules/macro-5_*: New. - - 2018-10-01 Nathan Sidwell - - Merge trunk r264769. - Slip in module.c -> module.cc rename - - Merge trunk r264765. - - gcc/cp/ - * lang-specs.h: Error out on -fcoroutines. - - From c++-coroutines branch: - 2018-10-01 Iain Sandoe - gcc/c-family/ - * c-common.h (RID_CO_AWAIT, RID_CO_YIELD, RID_CO_RETURN, - D_CXX_COROUTINES, D_CXX_COROUTINES_FLAGS): New. - * c-common.c (c_common_reswords): co_await, co_yield, - co_return New keywords. - gcc/cp/ - * lex.c (init_reswords): Handle flag_coroutines. - gcc/c-family/ - * c.opt (fcoroutines, fcoroutines-ts): New. - - Avoid UB type punning union shenanigans - gcc/cp/ - * module.c (macro_import::slot): Explicitly code bit - manipulation. Update all users. - gcc/testsuite/ - * g++.dg/modules/adhoc-1_b.C: Adjust regexp for wierd dejagnu/TCL bug. - - AdHoc locations - gcc/cp/ - * modules.c (dumper): Add LOCATIONS, flags. - (dumper::operator()): Add default arg. - (dumper::push): Set flags. - (module_state::{read,write}_location): Serialize adhoc locs. - (module_state::deferred_macro): Optimize current TU undef case. - gcc/testsuite/ - * g++.dg/modules/adhoc-1_[ab].C: New. - - 2018-09-28 Nathan Sidwell - - gcc/cp/ - * module.c (module_state::deferred_macro): Fix undef hiding logic. - gcc/testsuite/ - * g++.dg/modules/macro-4*: New. - - 2018-09-27 Nathan Sidwell - - No speculative undefs. - gcc/cp/ - * module.c (maybe_add_macro): Simplify. - (module_state::undef_macro): Only add undef for a deferred macro. - - Add -fforce-module-macros - libcpp/ - * include/cpplib.h (get_deferred_macro): Declare. - * macro.c (undefer_macro): Rename to ... - (get_deferred_macro): ... here. Adjust callers. - gcc/ - * doc/invoke.texi (fforce-module-macros): Document. - gcc/c-family/ - * c.opt (fforce-module-macros): New. - gcc/cp/ - * module.c (get_option_string): Prune more options. - (load_macros): New. - (finish_module_parse): Walk identifiers, if forcing macros. - - 2018-09-26 Nathan Sidwell - - Add deferred cpp_hashnode field. Replace macro_imports hash table - with vector and refactor. - libcpp/ - * include/cpplib.h (NODE_DEFERRED_MACRO): Delete. - (cpp_hashnode): Reduce flags width. Add deferred field. - (cpp_deferred_macro_p): Delete. - (cpp_set_deferred_macro): Don't set flag. - * directives.c (do_undef): Adjust deferred check. - * macro.c (undefer_macro): Adjust. - gcc/cp/ - * module.c (macro_export): Drop node field. Add ctor. - (macro_import): Rename one to struct slot. Add ctors, type - erase. Delete struct traits. - (macro_imports): Change to vec type. - (macro_import::{append,exported}): Adjust. - (get_macro_{imports,exports}): Allocate node deferred index, - adjust. - (maybe_add_macro): Add to macros vector, check unexported undefs - here. - (macro_loc_cmp): Reimplement. - (module_state::{read,write}_macros): Adjust. - (module_state::{undef,deferred}_macro): Likewise. - (finish_module_parse): Adjust deallocation. - - Macro import and export (corrected). - libcpp/ - * include/cpplib.h (cpp_callbacks): Add user_deferred_macro. - (NODE_DEFERRED_MACRO): New. - (cpp_hashnode): Increase flags size. - (cpp_deferred_macro_p, cpp_set_deferred_macro): New. - (cpp_compare_macros): Take two macros. - * internal.h (_cpp_notify_macro_use): Take source location, return bool. - (_cpp_maybe_notify_macro_use): Likewise. - * directives.c (do_undef): Don't warn about unresolved deferred - macros. - (do_ifdef, do_ifndef): Cope with deferred macros evaporating. - * expr.c (parse_defined): Likewise. - * macro.c (undefer_macro): New. - (enter_macro_context): Adjust notify call. - (cpp_get_token_1): Deal with deferred nodes. - (warn_of_redefinition): Node extraction of compare, call ... - (cpp_compare_macros): ... this to compare two macros. - (cpp_create_definition): Adjust compare call. - (_cpp_notify_macro_use): Deal with deferred macros. - gcc/ - * langhooks-def.h (LANG_HOOKS_PREPROCESS_DEFERRED_MACRO): New. - * langhooks.h (struct langhooks): Add preprocess_deferred_macro. - gcc/c-family/ - * c-lex.c (init_c_lex): Register deferred_macro hook. - gcc/cp/ - * cp-tree.h (module_cpp_deferred_macro): Declare. - * cp-lang.c (LANG_HOOKS_PREPROCESS_DEFERRED_MACRO): Override. - * module.c (bytes_in::random_access): New. - (elf_in::{preserve,release}): New. - (slurping::{legacies,macros}): New fields. - (slurping::close): New. - (module_state::legacies): Remove field. - (module_state::slurper): Delete. - (module_state::{read,write}_config): Add number of macros. - (module_state::{read,write}_define{,s}): Reimplement. - (module_state::{undef,deferred}_macro): New. - (cpp_undefs): Delete. - (struct macro_export, struct macro_import): New. - (get_macro_{export,import}): New. - (maybe_add_macro,macro_loc_cmp): Adjust. - (module_state::{read,write}): Adjust. - (module_state::check_read): Adjust. - (module_state::set_import): Adjust. - (module_state::freeze_an_elf): Preserve macros. - (import_module): Update legacies bitmap. - (module_cpp_undef): Call module_state::undef_macro. - (module_cpp_deferred_macro): New. - (finish_module_parse): Free macro state. - gcc/testsuite/ - * g++.dg/modules/macro-2_*: Adjust tests. - * g++.dg/modules/macro-3_*: Likewise. - - 2018-09-23 Nathan Sidwell - - gcc/cp/ - * modules (module_state): Add legacies bitmap. - (module_state::write): Write README later. - (module_state::read): Set legacies bit. - (module_state::set_import): Update legacies. - gcc/testsuite/ - * g++.dg/modules/unnamed-1_b.C: Update. - - 2018-09-16 Nathan Sidwell - - gcc/ - * doc/invoke.texi (C++ Modules): Update mapper protocol. - * cxx-mapper.c (client): Remove bewait, forget members. - (client::action): Remove BYIMPORT, BEWAIT & RESET. - - Remove BYIMPORT, BEWAIT. - gcc/cp/ - * module.c (module_mapper::uncork): Send blank command. - (module_mapper::imex_query): Take exported_p bool. - (module_mapper::bewait_{cmd,response}): Delete. - (module_mapper::send_command): Don't shortcut blank format. - (module_state::preamble_load): Avoid async commands. - - 2018-09-14 Nathan Sidwell - - gcc/ - * langhooks.h (preprocess_main_file): Drop index arg. - gcc/c-family/ - * c-opts.c (cb_file_change): Adjust preprocess_main_file hook. - gcc/cp/ - * cp-tree.h (module_node_main_file): Drop index parm. - * module.c (loc_spans::init_p, ): New. - (loc_spans::init_once): Rename to ... - (loc_spans::init): ... here. - (loc_spans::main_start): New. - (prefix_line_maps_hwm, prefix_locations_hwm): Delete. - (maybe_add_macro, declare_module, do_divert_include) - (module_note_main_file, maybe_begin_legacy_module): Adjust. - - A grand renaming - gcc/cp/ - * cp-tree.h (atom_preamble_state, atom_preamble_prefix_peek) - (atom_preamble_prefix_next): Rename to ... - (atom_preamble_state, atom_preamble_prefix_peek) - (atom_preamble_prefix_next): ... here. - (atom_cpp_undef, atom_module_preamble, atom_main_file) - (atom_divert_include, maybe_atom_legacy_module): Rename to ... - (module_cpp_undef, module_preamble_load, module_note_main_file) - (maybe_import_include, maybe_begin_legacy_module): ... here. - * cp-lang.c (LANG_HOOKS_PREPROCESS_MAIN_FILE) - (LANG_HOOKS_PREPROCESS_DIVERT_INCLUDE) - (LANG_HOOKS_PREPROCESS_UNDEF, LANG_HOOKS_PREPROCESS_PREAMBLE): Adjust. - (module_preamble_fsm): Adjust. - * lex.c (atom_preamble_prefix_peek, atom_preamble_prefix_next): - Rename to ... - (atom_preamble_prefix_peek, atom_preamble_prefix_next): ... here. - Adjust. - * module.c (atom_cpp_undef, atom_module_preamble, atom_main_file) - (atom_divert_include, maybe_atom_legacy_module): Rename to ... - (module_cpp_undef, module_preamble_load, module_note_main_file) - (maybe_import_include, maybe_begin_legacy_module): Here ... Adust. - * parser.c (cp_parser_get_module_preamble_tokens, c_parse_file): - Adjust. - - Expunge the spewer - gcc/cp/ - * module.c (struct slurping): No need to tag. - (struct spewing): Delete. - (declare_module, module_state::atom_preamble) - (finish_module_parse): Don't deal with it. - - Expunge old location scheme - gcc/cp/ - * module.c (struct slurper): Remove early_locs, late_locs, - loc_offset, filenames. - (module_state::{prepare,read,write}_locations): Delete - (module_state::{read,write}): Adjust. - - New locations working - gcc/cp/ - * module.c (module_state::prepare_locations): New, broken out of ... - (module_state::write_locations): Adjust. - (module_state::read_locations): Fix. - - 2018-09-13 Nathan Sidwell - - Read & write new locations (buggy, disabled). - gcc/cp/ - * module.c (module_state::{read,write}_location): Add new-loc - scheme. - (module_state::{read,write}_locations): Adjust. - (module_state::read): Select location scheme. - gcc/testsuite/ - * g++.dg/modules/loc-1_c.C: Use regexp for note loc. - - Reading location spans (but not using them). - gcc/cp/ - * module.c (loc_range_t): Global typedef. - (loc_spans::release): Delete. - (slurping): Add new range locs. - (module_state::write_locations): Adjust. - (module_state::read_locations): New. - (module_state::read): Call it. - - Stop passing line_map around. There is only one. - gcc/cp/ - * cp-tree.h (import_module, declare_module, atom_module_preamble) - (finish_module_parse, maybe_atom_legacy_module): Drop line_map - arg. - * decl2.c (c_parse_final_cleanups): Adjust. - * parser.c (cp_parser_module_declaration) - (cp_parser_import_declaration, c_parse_file): Adjust. - * module.c (loc_spans): Drop lmaps member & adjust. - (module_state): Drop line_maps from some but not all members. - - Refactor location spans - gcc/cp/ - * module.c (class loc_spans): New. Absorb ... - ({open,close,ordinary,macro}_interval): ... these. Update all uses. - - 2018-09-12 Nathan Sidwell - - Adding location spans - gcc/cp/ - * module.c (loc_range_t): New range. - (struct lmap_interval): New. - (lmap_spans): New. - (open_interval, close_interval, ordinary_interval) - (macro_interval): New. - (module_state::write_locations): Write spans. - (module_state::write): Write spans. - (module_state::atom_preamble): Update spans. - (atom_main_file): Initialize spans. - (finish_module_parse): Close out span. - - gcc/cp/ - * parser.c (cp_parser_get_module_preamble_tokens): Don't read past - EOF. - gcc/testsuite/ - * g++.dg/modules/ice-1.C: New. - * g++.dg/modules/modules.exp: Remove old pruning. - - Implement p1103r0 19.3/2 not-a-keyword. - gcc/cp/ - * module (module_state::write_define): Don't export keywords. - gcc/testsuite/ - * g++.dg/modules/legacy-7_{a.H,b.C}: New. - - 2018-09-10 Nathan Sidwell - - gcc/ - * diagnostic.c (diagnostic_report_current_module): Do not line - break after module name. - gcc/testsuite/ - * lib/prune.exp (prune_gcc_output): Adjust module loc regexp. - * g++.dg/modules/loc-2_[def].C: Adjust dg-regexp. - * g++.dg/modules/macro-2_d.C: Likewise. - - 2018-09-06 Nathan Sidwell - - gcc/c-family/ - * c.opt (fmodule-only): Set flag. - gcc/cp/ - * decl2.c (c_parse_final_cleanups): Always call finish_module_parse. - * module.c (finish_module_parse): Warn on incorrect -fmodule-only. - gcc/testsuite/ - * g++.dg/modules/only-[123].C: New. - - Add -fmodule-only, rename -fmodules-legacy - gcc/c-family/ - * c.opt (fmodules-legacy*): Rename to ... - (fmodule-legacy*): ... here. - (fmodule-only): New. - gcc/cp/ - * lang-specs.h: Incorporate -fmodule-only. - * module.c (get_option_string, handle_module_option): Adjust. - gcc/ - * doc.invoke.texi: Update module options. - gcc/testsuite/ - * g++.dg/modules/modules.exp: Adjust. - * g++.dg/modules/*: Adjust options. - - 2018-08-31 Nathan Sidwell - - libiberty/ - * configure.ac (checkfuncs, AC_CHECK_FUNCS): Add pipe2. - * configure, config.in: Regenerated. - * pex-unix.c (pex_unix_execute): Use pipe to transfer child failure. - - 2018-08-30 Nathan Sidwell - - AIXify tests - fcc/testsuite/ - * fn-inline-1_[abc].C: Adjust regexps. - * sym-subst-2_a.C: Don't add -fat-lto option, use scan-assembler instead. - - Fix AIX - gcc/cp/ - * cxx-mapper.cc (buffer::get_request): Reinit pos. - - Fix --enable-checking=release. - gcc/cp/ - * name-lookup.c (set_module_binding): Add static cast. - - Fix more GC - gcc/cp/ - * module.c (module_state): Tag for_user. - (module_state_hash): Defive from ggc_ptr_hash. - (init_module_processing): GGC alloc hash table. get mapper when - not lazy, add ggc_collect. - (finish_module_parse): Don't zap hash table here ... - (finish_module_processing): ... do it here instead. - gcc/testsuite/ - * g++.dg/modules/gc-2_a.C: New. - * g++.dg/modules/gc-2.map: New. - - AIX build - gcc/ - * configure.ac: Check sighandler_t, memrchr. - * config.in, configure: Rebuilt. - gcc/cp/ - * Make-lang.in (MODULE_STAMP): Protect against non--r capable - date. - (cxx-mapper): Add LIBINTL, not LIBBACKTRACE. - * module.c (memrchr, sighandler_t): Provide fallback. - * cxx-mapper.cc (memrchr, sighandler_t): Provide fallback. - - * Merge trunk r263974. - - 2018-08-29 Nathan Sidwell - - gcc/cp/ - * module.c (atom_cpp_undef): location_t arg is unused. - - gcc/cp/ - * module.c (module_state::{read,write}_define): Add NUL - terminators to CPP_TOKEN_FLD_STR elements. - - libcpp/ - * lex.c (cpp_alloc_token_string): Don't clobber ending NUL. - - 2018-08-28 Nathan Sidwell - - Undefs - gcc/cp/ - * cp-lang.c (LANG_HOOKS_PREPROCESS_UNDEF): Override. - * cp-tree.h (atom_cpp_undef): Declare. - * module.c: Include langhooks.h. - (cpp_undefs): New global. - (module_state::{read,write}_defines): Stream undefs. - (atom_cpp_undef): Define. - gcc/ - * langhooks-def.h (LANG_HOOKS_PREPROCESS_UNDEF): Default. - (LANG_HOOKS_INITIALIZER): Add it. - * langhooks.h (struct lang_hooks): Add preprocess_undef hook. - gcc/c-family/ - * c-lex.c: Include langhooks.h - (init_c_lex, cb_undef): Look at lang hook. - gcc/testsuite/ - * g++.dg/modules/macro-3_[ab].H: New. - * g++.dg/modules/macro-3_c.C: New. - - Sorted macros - gcc/cp/ - * module.c (module_state::{read,write}_define): New, single-macro - streamers. - (module_state::write_define_cb): Delete. - (maybe_add_macro, macro_loc_cmp): New. - (module_state::write_defines): Write in source order. - (module_state::read_defines): Adjust. - - Macro define locations - libcpp/ - * include/cpplib.h (cpp_macro): Add imported field. - gcc/cp/ - * module.c (module_state::write_define_cb): Ignore imported, write - location. - (module_state::read_defines): Read location. - gcc/testsuite/ - * g++.dg/modules/macro-2_[abc].H: New. - * g++.dg/modules/macro-2_d.C New. - - Reading macros. - gcc/cp/ - * module.c (bytes_{in,out}::cpp_node): New. - (bytes_out::buf): New. - (bytes_{in,out}::str): Treat zero-length strings specially. - (module_state::write_define_cb): Concatenate strings. - (module_state::write_defines): Write padding byte. - (module_state::read_defines): New. - (module_state::read): Call it. - libcpp/ - * include/cpplib.h (cpp_alloc_token_string): New. - (cpp_compare_macros): Declare. - * lex.c (cpp_alloc_token_string): New, broken out of ... - (create_literal): ... here. Call it. - * macro.c (warn_of_redefinition): Rename to ... - (cpp_compare_macros): ... this, and make it extern. - (_cpp_create_definition): Adjust. - gcc/testsuite/ - * g++.dg/modules/macro-1_a.H: Adjust. - * g++.dg/modules/macro-1_b.C: New. - - Writing macros. - gcc/cp/ - * cp-tree.h (import_module, declare_module, atom_module_preamble, - finish_module_parse, maybe_atom_legacy_module): Add cpp_reader - arg. - * decl2.c (c_parse_final_cleanups): Adjust finish_module_parse. - * module.c (bytes_out::str): Overload for cpp_hashnode. - (module_state::read_imports,write_imports,do_import): Add - cpp_reader arg. - (module_state::atom_preamble): Likwise. - (import_module, declare_module, atom_module_preamble) - (finish_module_parse, maybe_atom_legacy_module): Likewise. - (module_state::write_{define_cb,defines}): New. - (module_state::write): Write defines when in legacy mode. - * parser.c (cp_parser_module_declaration) - (cp_parser_import_declaration, c_parse_file): Pass parse_in. - gcc/testsuite/ - * g++.dg/modules/macro-1_a.H: New. - - 2018-08-27 Nathan Sidwell - - Merge trunk r263897. - - gcc/cp/ - * module.c (module_state): Remove depth. - (module_state::maybe_create_loc): Replace ... - (module_state::set_loc): ... this. - (module_state::read_imports): Check CRC of indirect imports too. - (module_state::attach): Simplify logic. - libcpp/ - * include/linemaph (linemap_module_loc): Drop CURRENT parm. - * line-map.c (linemap_module_loc): Drop reseating capability. - - gcc/cp/ - * module.c (module_state::check_not_purview): New. - (module_state::read_imports,import_module): Use it. - - Remove %M formatter, it is not worth complexity. - gcc/c-family/ - * c-format.c (local_module_ptr_node): Remove - (gcc_cxxdiag_char_table): Remove 'M' - (init_dynamic_diag_info): Remove module_state lookup - * c-format.h (T89_M): Remove - gcc/cp/ - * cp-tree.h (class module_state): Move to module.c section. - (pp_module_name): Delete. - * error.c (cp_printer): Remove %M. - * module.c: Remove %M error printing. - (pp_module_name): Delete. - * ptree.c (cxx_print_decl): Print module number too. - - 2018-08-27 Nathan Sidwell - - Mangling substitutions! - gcc/cp/ - * cp-tree.h (module_vec_name): Delete. - * mangle.c (mangle_substitution): Fix name typo. - * module.c (class module_state): Drop vec_name field. Make mod - short. Add subst field. - (module_state::mangle): New. - (mangle_module): Deal with substitutions. - (mangle_module_fini): Undeal with substitutions. - (module_vec_name): Delete. - (module_state::attach): Don't set vec_name. - gcc/testsuite/ - * g++.dg/modules/sym-subst-1.C: New. - * g++.dg/modules/sym-subst-2_[ab].C: New. - - Fix module-state lifetime issue. - gcc/cp/ - * cp-tree.h (finish_module): Break into ... - (finish_modle_{parse,procesing}): ... these two. - * decl2.c (c_parse_final_cleanups): Adjust modules finalization. - * modules.c (finish_modules): Break into ... - (finish_module_{parse,procesing}): ... these two. - (module_state::release): Break out ... - (module_state::slurped): ... this. - (module_state::{init,fini}): Fold into callers. - - Refactor mangling interface. - gcc/cp/ - * cp-tree.h (mangle_module, mangle_module_fini): Declare. - (mangle_substitution, mangle_identifer): Declare. - * mangle.c (mangle_substitution, mangle_identifer): Define. - (struct globals): Add mod field. - (maybe_write_module): Call mangle_module. - (finish_mangling_internal): Call mangle_module_fini. - * module.c (mangle_module, mangle_module_fini): Define. - - 2018-08-23 Nathan Sidwell - - Module state gains parent. - gcc/cp/ - * cp-tree.h (get_module): Add parent argument. - (module_name): Return string. - * error.c (dump_module_suffix): Adjust module_name use. - * module.c (module_state_hash): Adjust for having a parent. - (module_state: Add parent & fullname fields. - (module_state::set_name): Delete. - (get_module): Add parent. - (get_module): Split string. - (module_mapper::{export_done,imex_query}): Adjust module name access. - (module_state::write_readme): Adjust. - (module_state::{read,write}_{imports,config}): Adjust. - (module_state::set_loc): Use fullename. - (module_state::attach): Create fullname. - * parser.c (cp_parser_module_name): Generate parental name. - * ptree.c (cxx_print_decl): Adjust. - gcc/testsuite/ - * g++.dg/modules/mod-decl-1.C: Adjust diags. - - Kill N: prefix notation - gcc/cp/ - * module.c (enum module_kind): Delete. - (module_state): Replace kind with legacy, adjust is_legacy. - (module_state::set_name): Adjust. - (module_state_hash): Adjust hasher & comparator. - (module_legacy_system_p): Delete. - (make_flat_name): Move into ... - (get_module): ... here. Adjust. - (get_module): Add string variant. - (module_mapper::module_mapper): Adjust. - (module_mapper::{module_name_kind,response_name}): Delete. - (module_mapper::{imex_query,bewait_response,divert_include}): Adjust. - (module_state::{read_imports,attach}): Adjust. - (pp_module_name): Adjust. - (maybe_atom_legacy_module, init_module_processing) - (handle_module_option): Adjust. - * cxx-mapper.cc (module2bmi): Remove encoding. - (encode_module_name): Remove encoding. - gcc/c-family/ - * c-lex.c (c_lex_with_flags): CPP_HEADER include quoting. - gcc/ - * doc/invoke.texi (C++ Modules): Adjust protocol doc. - gcc/testsuite/ - * g++.dg/modules/modules.exp: Adjust BMI mapping. - * g++.dg/modules/legacy-0[ab].H: New. - * g++.dg/modules/legacy-*: Adjust. - - 2018-08-22 Nathan Sidwell - - %M formatter - gcc/c-family/ - * c-format.c (local_module_ptr_node): New. - (gcc_cxxdiag_char_table): Add 'M'. - (argument_parser::handle_conversions): Allow wanted type to be - NULL. - (init_dynamic_diag_info): Simplify lookup, add module_state. - * c-format.h (T89_M): New. - gcc/cp/ - * cp-tree.h (class module_state): Declare before diagnostics. - * error.c (cp_printer): Add %M. - * module.c: Use %M error printing. - - Use modules as handles themselves. - gcc/cp/ - * cp-tree.h (class module_state): Forward declare. - (get_module, pp_module_name): Declare. - (import_module, declare_module, push_module_export): Take - module_state. - * module.c (proclaimer): A module. - (get_module, pp_module_name): Define. - (push_module_export, import_module, declare_module): Adjust. - * parser.c (cp_parser_module_name): Return module_state. - (cp_parser_module_declaration, cp_parser_import_declaration) - (cp_parser_module_proclamation): Adjust. - - Fix GTY - gcc/cp/ - * cp-tree.h (struct mc_index): Don't mark. - (struct mc_slot): Converted from union. Adjust. - (struct module_cluster): Skip mc_index. - * module.c (struct slurping,spewing): Skip range_t members. - (class module_state): Remove static data members. - (global_tree_arys, fixed_trees, global_crc, our_opts, lazy_lru) - (lazy_open, modules, modules_hash): New static vars. Adjust uses. - (finish_module): Add gc point. - gcc/testsuite/ - * g++.dg/modules/gc-1_[abcd].C: New. - - 2018-08-21 Nathan Sidwell - - gcc/cp/ - * cp-tree.h (declare_module, import_module): Separate name from - location. - * module.c (module_state::attach): Drop maybe_vec_name arg. - (module_state::get_module): Flatten here. - (declare_module, import_module): Separate name and from loc. - (maybe_atom_legacy_module): Adjust. - * parser.c (cp_parser_module_name): Return tree only. - (cp_parser_module_declaration, cp_parser_import_declaration): Adjust. - gcc/testsuite/ - * g++.dg/modules/legacy-4.H: Adjust error. - - gcc/cp/ - * module.c (module_mapper::divert_include): Don't append export attrib. - (import_module): Don't scan attribs. - (maybe_atom_legacy_module): Push exporting. - gcc/testsuite/ - * g++.dg/modules/legacy-3_[bc].H: Adjust. - * g++.dg/modules/legacy-5_b.C: Adjust. - * g++.dg/modules/legacy-6_[cd].C: Adjust. - - gcc/cp/ - * module.c (module_state::get_module): Lose dflt & insert args. - (module_state::insert_mapping): Move directly into ... - (module_mapper::module_mapper): ... here. - (module_mapper::bewait_response, module_state::read_imports): Adjust. - (import_module, declare_module): Adjust. - - gcc/cp/ - * module.c (module_state::is_mapping): Rename to ... - (module_state::is_detached): ... here. Use from_loc. - (module_state::attach): New broken out of ... - (module_state::find_module): ... here. Delete, fold into ... - (module_state::read_imports, import_module, declare_module): ... - these callers. - (module_state::read): Adjust module index setting. - - libiberty/ - * pex-unix.c (IS_FAKE_VFORK): Rename to VFORK_IS_FORK. - (pex_unix_exec_child): Avoid spuros clobber warning, use stdio - when forking. - - 2018-08-20 Nathan Sidwell - - Merge trunk r263679. - - Merge trunk r263673. - - Revert r263619 2018-08-17 Nathan Sidwell - Revert r263597 2018-08-16 Nathan Sidwell - They break GTY strangely. - - 2018-08-17 Nathan Sidwell - - gcc/cp/ - * module.c (module_state::is_detached): New. - (module_state::attach): New, broken out of ... - (module_state::find_module): ... here. Call it. - (declare_modules): Do module-specific attaching here. - - 2018-08-16 Nathan Sidwell - - gcc/testsuite/ - * g++.dg/modules/modules.exp (dg-module-pre-prune): Delete - (g++-dg-prune): Don't override. - * g++.dg/modules/legacy-4.H: Use dg-regexp. - * g++.dg/modules/loc-2_[def].C: Likewise. - - gcc/cp/ - * cp-tree.h (class module_state): Forward declare. - (get_module, pp_module_name): Declare. - (push_module_export, declare_module, import_module): Take - module_state. - * error.c (cp_printer): Accept %M. - * module.c (module_state::find_module): Take module_state. - (module_state::get_module): Drop default & insert args. - (module_state::insert_mapping): Delete. - (module_mapper::{module_mapper,bewait_response): Adjust. - (module_mapper::divert_include): Drop indentation. - (module_state::read_imports): Adjust. - (proclaimer): Is a module_state pointer. - (push_module_state, declare_module, import_module): Adjust. - (pp_module_name): New. - (get_module): New. - (maybe_atom_legacy_module): Adjust. - * parser.c (cp_parser_module_name): Return module_state, adjust. - (cp_parser_module_declaration, cp_parser_import_declaration): - Adjust. - gcc/testsuite/ - * g++.dg/modules/legacy-4.H: Adjust regexp. - - 2018-08-08 Nathan Sidwell - - Merge trunk r263429. - - 2018-08-02 Nathan Sidwell - - Merge trunk r263272. - - 2018-07-12 Nathan Sidwell - - libcpp/ - * include/cpplib.h (cpp_clear_if_stack): Renamed from - cpp_pop_directives. - * directives.c (cpp_clear_if_stack): Likewise, drop all arg. - gcc/c-family/ - * c-ppoutput.c (scan_translation_unit): Fixup. - - gcc/c-family/ - * c.opt (fmodule-preamble): Alias fmodule-preamble= - (fmodule-preamble): Fix type. - * module.c: Add i18n markers. - (init_module_processing): Detect unsupported option combos. - (handle_module_option): Don't zap explicit modules-ts. - gcc/ - * diagnostic.c (diagnostic_report_current_module): Add i18n - markers. - gcc/testsuite/ - * g++.dg/modules/cpp-preamble-9.C: New. - * g++.dg/modules/modules.exp (mode_list): Preamble is atom. - libcpp/ - * directives.c (cpp_pop_directives): Buffer could be NULL.le - - gcc/cp/ - * lex.c (atom_preamble_prefix_peek): Use cpp_macro_p. - - Hide NT_MACRO - libcpp/ - * include/cpplib.h (cpp_macro_p): New. - * macro.c (cpp_fun_like_macro_p): Use it. - gcc/c-family/ - * c-ada-spec.c (count_ada_macro, store_ada_macro): Use - cpp_macro_p. - * c-ppoutput.c (dump_macro): Likewise. - * c-spellcheck.cc (should_suggest_as_macro_p): Likewise. - gcc/ - * config/rs6000/rs6000-c.c (rs6000_macro_to_expand): Use cpp_macro_p. - * config/powerpcspe/powerpcspe-c.c (rs6000_macro_to_expand): Likewise. - gcc/fortran/ - * cpp.c (dump_macro): Use cpp_macro_p. - - 2018-07-06 Nathan Sidwell - - gcc/testsuite/ - * g++.dg/modules/modules.exp: Restore g++-dg-prune after test. - * g++.dg/modules/legacy-5_c.C: Fix scan-lang-dump. - - 2018-07-05 Nathan Sidwell - - No ALIASes for IMPORTS - gcc/cp/ - * cxx-mapper.cc (module2bmi): No aliases here. - (client::imex_response): Adjust. - gcc/ - * doc/invoke.texi (C++ Modules): Remove ALIAS from IMPORT response - set. - - Legacy header warning - gcc/ - * invoke.texi (Wlegacy-header): New warning. - gcc/c-family/ - * c.opt (Wlegacy-header): New. - gcc/cp/ - * cp-tree.h (atom_preamble_end): Declare. - * cp-lang.c (atom_preamble_fsm): Use it. - * lex.c (atom_preamble_prefix_peek): Check OPT_Wlegacy_header. - * module.c (do_divert_include): Likewise. - (atom_divert_include): Default -Wlegacy-header. - (atom_preamble_end): New. - * parser.c (c_parse_file): Use it. - gcc/testsuite/ - * g++.dg/modules/legacy-6*: New. - - Legacy header aliasing - gcc/ - * doc/invoke.texi (C++ Modules): Update protocol docs - gcc/cp/ - * cxx-module.cc (module2bmi): Deal with aliasing. - (encode_module_name): New. - (read_mapping_file): Use it. Deal with aliasing. - (client::imex_response): Likewise. - (client::action): Likewise, - * module.c (module_mapper::module_name_kind): New. - (module_mapper::response_name): Use it. - (module_mapper::divert_include): Allow aliasing. - gcc/testsuite/ - * g++.dg/modules/legacy-5*: New. - - 2018-07-03 Nathan Sidwell - - Merge legacy header options to -fmodules- - gcc/ - * doc/invoke.texi (C++ Modules): Adjust. - gcc/c-family/ - c.opt (fmodules_legacy, fmodules_legacy=): New. - (fmodule-{user,system}-header{,=}): Delete. - gcc/cp/ - * cp-tree.h (modules_legacy_p): Renamed from modules_header_p. - * lang-specs.h (@c++-header): Update. - * lex.c (atom_preamble_prefix_peek): Adjust. - * module.c (module_legacy_name): Do not force to empty string. - (module_state::get_option_string): Adjust. - (declare_module, maybe_atom_legacy_module, init_module_processing) - (handle_module_option): Likewise. - gcc/testsuite/ - * g++.dg/modules/legacy-[1234]*: update. - * g++.dg/modules/atom-inc-1.C: Update. - - Explicit user/system legacy headers - gcc/c-family/ - * c-lex.c (c_lex_with_flags): Encode header names in tree lists. - * c.opt (fmodule-{user,system}-header): New. - gcc/cp/ - * cxx-mapper.cc (module2bmi): Adjust. - (read_mapping_file): Encode legacy header names. - * lang-specs.h (@c++-header): Update. - * module.c (module_state_hash::hash): Update hashers. - (enum module_kind): New. - (module_state::set_name): Adjust. - (module_state_hash::equal): Adjust. - (module_header_is_system): New. - (make_legacy_name): Delete. - (module_state::get_module): Adjust. - (module_mapper::response_name): New. - (module_mapper::imex_query): Adjust. - (module_mapper::bewait_response): Adjust. - (module_mapper::divert_include): Adjust. - (declare_module, maybe_atom_legacy_module): Likewise. - (handle_module_option): Check new options. - gcc/testsuite/ - * g++.dg/modules/modules.exp: update BMI encodings. - * g++.dg/modules/legacy-[1234]*: update. - * g++.dg/modules/atom-inc-1.C: Update. - gcc/ - * doc/invoke.texi (C++ Modules): Document new options. - - 2018-06-29 Nathan Sidwell - - Diverted header column preservation - libcpp/ - * directives.c (do_include_common): Adjust divert callback. - * include/cpplib.h (cpp_divert_include_t): Likewise. - gcc/cp/ - * module.c (module_mapper::divert_include): Add line_maps. - Preserve column number. - (import_module): Look at attribs. - (do_divert_include): Adjust. - * parser.c (cp_parser_module_declaration): Return loc of name. - (cp_parser_import_declaration): Likewise. - (cp_parser_parse_module_preamble): Adjust. - gcc/ - * langhooks.h (lang_hooks): Adjust preprocess_divert_include. - gcc/testsuite/ - * g++.dg/modules/legacy-3_b.H: Adjust. - * g++.dg/modules/legacy-3_c.H: Adjust. - * g++.dg/modules/legacy-4.H: Adjust. - - Diverted include line numbering - libcpp/ - * directives.c (do_include_common): Fixup diversion line - numbering. - (_cpp_pop_buffer): Free to_free even if not a file. - gcc/c-family/ - * c-ppoutput.c (print_line_1): More C++y. - gcc/cp/ - * module.c (module_mapper::divert_include): Two \n's. - gcc/testsuite/ - * g++.dg/modules/legacy-4: New. - * g++.dg/modules/legacy-3_b.H - - gcc/testsuite/ - * g++.dg/modules/modules.exp (dg-module-pre-prunes): Renamed. - - libcpp/ - * directives.c (do_include_common): Include diverter will push - buffer. - * include/cpplib.h (cpp_divert_include_t): Adjust signature. - gcc/ - * langhooks.h (lang_hooks): Adjust preprocess_divert_include - signature. - gcc/cp/ - * module.c (module_mapper::divert_include): Push buffer here. - (do_divert_include): Adjust. - - 2018-06-28 Nathan Sidwell - - gcc/testsuite/ - * g++.dg/modules/legacy-3*: New. - - gcc/testsuite/ - * g++.dg/modules/modules.exp: Fix execution tests. Add dg-module-literal - * g++.dg/modules/legacy-2_d.C: Fix expected line number. - * g++.dg/modules/loc-2_[def].C: Use dg-module-literal. - - (Beginnings of) Include diversion. - gcc/c-family/ - * c-opts.c (c_common_post_options): Set divert_include hook. - (cb_file_change): Fixup precedence. - gcc/cp/ - * cp-lang.c (LANG_HOOKS_PREPROCESS_DIVERT_INCLUDE): Override. - * cp-tree.h (modules_header_p): New. - (atom_divert_include): Declare. - * cxx-mapper.cc (flag_fallback): New flag. - (module2bmi): Deal with NULL names. - (buffer::get_request): Fix off-by-one error. - (read_mapping_file): Can be multiply called. Target file name can - be null. - (client::action): Deal with INCLUDE. - (main): There can be may files after connection. Fixup networking - errors. - * lex.c (atom_preamble_prefix_peek): Don't rescan legacy header - module. - * module.c (module_preamble_end_loc): Declare here. - (module_mapper::module_mapper): Prepend path for anything looking - defaulty. - (module_mapper::divert_include): New. - (do_divert_include): New. - (atom_divert_include): New. - (init_module_processing): Set header mode here. - * parser.c (module_preamble_end_loc): Extern. - gcc/ - * doc/invoke.text (C++ Modules): Document -fmodule-header. - * langhooks-def.h (LANG_HOOKS_PREPROCESS_DIVERT_INCLUDE): Provide - default. - * langhooks.h (lang_hooks): Add preprocess_divert_include. - libcpp/ - * directives.c (do_include_common): Add diversion smarts. - * include/cpplib.h (cpp_divert_include_t): New. - (struct cpp_callbacks): Add divert_include. - * line-map.c (linemap_module_loc): Missed commit. - gcc/testsuite/ - * g++.dg/modules/legacy-2.*: New. - * g++.dg/modules/modules.exp: Fixup header compilation. - - 2018-06-27 Nathan Sidwell - - (Beginnings of) Legacy importing - gcc/cp/ - * cxx-mapper.cc (module2bmi): Map legacy header names. - * module.c (module_state::legacy): New field. - (module_state::{is_legacy,set_name}): New. - (make_legacy_name): New. - (module_state::get_module): Canonicalize legacy name. - (module_state::get_option_string): Strip -fmodule-header. - (declare_module): Check correct kind. - (maybe_atom_legacy_module): Use make_legacy_name. - * parser.c (cp_parser_module_name): Parse legacy names. - (cp_parser_import_declaration): Don't special case legacy names - here. - gcc/testsuite/ - * g++.dg/modules/atom-inc-1.C: Add expected errors. - * g++.dg/modules/legacy-1_[abc].[CH]: New. - * g++.dg/modules/modules.exp: Support legacy header compilation. - - (Beginnings of) Legacy header modules - libcpp/ - * line-map.c (linemap_module_loc): Expect ordinary loc. - gcc/ - * langhooks-def.h (LANG_HOOKS_PREPROCESS_MAIN_FILE): Provide - default. - * langhooks.h (lang_hooks): Add preprocess_main_file hook. - gcc/c-family/ - * c-opts.c (cb_file_change): Call new hook. - gcc/cp/ - * cp-tree.h (enum atom_preamble_state): Define. - (atom_preamble_prefix_{peek,next}): Use enum. - (atom_main_file, maybe_atom_legacy_module): Declare. - * cxx-mapper.cc (module2bmi): Munge legacy module chars. - * lang-specs.h (@c++-header): Fix -fmodule-header use. - * lex.c (atom_preamble_prefix_{peek,next}): Adjust for enum. - * module.c (prefix_line_maps_hwm, prefix_locations_hwm): New. - (module_state::{read,write,prepare}_locations): Adjust prefix checking. - (ordinary_loc_of): New. - (import_module): Use it. - (declare_module): Set preamble prefix if needed. - (atom_main_file, maybe_atom_legacy_module): New. - (init_module_processing): Don't default module_header_name here. - (atom_module_preamble, finish_module): Push & pop exporting state in - legacy mode. - * parser.c (cp_parser_get_module_preamble_tokens): Adjust for - preamble state. Return indicator of preamble contents. - (c_parse_file): Maybe inject legacy module decl. - * cp-lang.c (LANG_HOOKS_PREPROCESS_MAIN_FILE): Override hook. - (atom_preamble_fsm): Adjust for state enum. - - 2018-06-26 Nathan Sidwell - - Merge trunk r262148. - - gcc/ - * configure.ac: Fix AF_INET6 & accept4 tests. - * configure, config.in: Rebuilt. - gcc/cp/ - * module.c: Update some comments. - (module_mapper::module_mapper): Fix up conditional code. - (module_state::read_imports): Replace local class with std::pair, - because C++98. - * cxx-mapper.cc (accept_from): Fixup conditional code. - - 2018-06-25 Nathan Sidwell - - gcc/cp/ - * cxx-mapper.cc (kill_signal): New. - (server): Fixup inet_ntop use. - - gcc/ - * configure.ac: Check for inet_ntop. - * configure, config.in: Rebuilt. - gcc/cp/ - * cxx-mapper.cc (server): Use inet_ntop when available. - - 2018-06-24 Nathan Sidwell - - gcc/cp/ - * cxx-mapper.cc: BMI->GCC - * module.c: Likewise. - gcc/ - * doc/invoke.texi: Likewise. - - 2018-06-23 Nathan Sidwell - - gcc/cp/ - * cxx-mapper.cc (struct netmask): New. - (server): Validate connection addresses. - (accept_from): New. - (process_args): Add -a arg. - - Simplify protocol. - gcc/cp/ - * cxx-mapper.c (buffer::empty): New. - (buffer::send_response): Fixup buffer management. - (client::imex_response): New. - (client::action): Reimplement. - * module.c (module_mapper): Update. - gcc/ - * doc/invoke.texi (C++ Modules): Update protocol. - gcc/testsuite/ - * g++.dg/modules/indirect-1_c.C: Tweak scan. - - A proper server - gcc/cp/ - * cxx-module-mapper.sh: Delete. - * cxx-mapper.cc: New. - * Make-lang.in: Adjust. - * module.c (module_mapper:get_response): Fixup errors. - (module_mapper::import_query): Drop filename. - - 2018-06-22 Nathan Sidwell - - gcc/cp/ - * module.c (module_mapper::send_command): Fix off-by-one. - (module_mapper::get_response): Cleanup batch splitting. - (module_mapper::handshake): Adjust. - * cxx-module-mapper.sh (cmd): Adjust HELLO. - gcc/ - * doc/invoke.texi (C++ Modules): Tweak mapper protocol. - - gcc/ - * configure.ac: Check select, accept4. - * config.in, configure: Rebuilt. - - 2018-06-21 Nathan Sidwell - - gcc/c-family/ - * c.opt: Add -fmodule-header. - gcc/cp/ - * lang-specs.h: Add legacy import options. - * module.c (module_header_name): New. - (init_module_processing): Default it. - (handle_module_option): Set it. - - Use getaddrinfo, not gethostbyname2 - gcc/ - * configure.ac (HAVE_AF_INET6): Test for getaddrinfo. - * configure: Rebuilt. - * doc/invoke.text (C++ Modules): Default is loopback. - gcc/cp/ - * module.c (module_mapper::module_mapper): Reorganize network startup. - gcc/testsuite/ - * g++.dg/modules/bad-mapper-[23].C: Adjust diagnostics. - - 2018-06-19 Nathan Sidwell - - Early & late location maps. - gcc/cp/ - * modules.c (slurping, spewing): Rearrange. - (module_state::{prepare,read,write}_locations): Reimplement. - (module_state::{read,write}): Adjust. - (module_state::atom_preamble): Adjust. - - 2018-06-18 Nathan Sidwell - - gcc/testsuite/ - * g++.dg/modules/loc-2_[a-f].C: New. - - 2018-06-17 Nathan Sidwell - - gcc/ - * configure.ac: Detect epoll & pselect. - * configure, config.in: Rebuilt. - - gcc/cp/ - * module.c (module_mapper::module_mapper): Fixup length errors. - - gcc/cp/ - * cxx-module-mapper.sh: Remove recompilation capability. - gcc/testsuite/ - * g++.dg/modules/import-2.C: Adjust messages. - * g++.dg/modules/main-aux.cc: Delete. - * g++.dg/modules/main_1.C: Delete. - - 2018-06-15 Nathan Sidwell - - gcc/ - * diagnostic.c (diagnostic_report_current_module): Starting - location could be a module. - gcc/cp/ - * module.c (trees_{in,out}::loc): Move to ... - (module_state::{read,write}_location}): ... here. - (trees_{in,out}::core_vals): Adjust. - (module_state::{read,write}_imports): Serialize import location. - (module_state::set_loc): Add floc parm, adjust. - gcc/testsuite/ - * lib/prune.exp (prune_gcc_output): Adjust regexp. - - gcc/cp/ - * cp-tree.h (make_module_loc): Delete. - * lex.c (make_module_loc): Delete. - * module.c (module_state): Add depth field. - (module_state::set_loc): Deal with reseating. Add line_maps parm. - (module_state::read_imports): Do two passes. - (module_state::write_imports): Write length. - gcc/testsuite/ - * g++.dg/modules/import-1_e.C Adjust lang dump scan. - * g++.dg/modules/mod-imp-1_d.C: Likewise. - libcpp/ - * include/line-map.h (linemap_module_loc): Add incomping loc parm. - * line-map.c (linemap_module_loc): Do reseating. - - Location! Location! Location! - gcc/cp/ - * module.c (module_state::slurper): New. - (trees_{in,out}::loc): Implement. - (trees_in::core_vals): Set locus. - (spewing::linemaps): Fixup offset calculation. - (module_state::read_locations): Set ord_locs. - gcc/testsuite/ - * g++.dg/module/loc-1_[abc].C: New. - - libcpp/ - * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New. - (IS_ADHOC_LOC): Simplify. - (MAP_ORDINARY_P): Use IS_ORDINARY_LOC. - * line-map.c (linemap_module_restore): Fixup included_at. - - gcc/ - * diagnostic.c (diagnostic_report_current_module): Fixup include - stack messages. - gcc/testsuite/ - * lib/prune.exp (prune_gcc_output): Adjust include stack regexps. - - gcc/cp/ - * module.c (spewer::linemaps): Return mask. - (module_state::{find,write}_locations): Use mask. - (module_state::read_locations): Implement. - - Line_maps args everywhere! - gcc/cp/ - * cp-tree.h (declare_module, import_module, atom_module_preamble): - Add line_maps arg. - * module.c (module_state::{read_imports,do_import}): Add line_maps. - (module_state::set_loc): New. - (module_state::atom_preamble): Deal with restoring line_maps. - (module_state::read): Add line_maps. Call read_locations. - * parser.c (cp_parser_module_declaration) - (cp_parser_import_declaration): Adjust. - (c_parse_file): Line_maps restoration is moved. - libcpp/ - * include/line-map.h (linemap_save_pre_module): Delete. - (linemap_restore_pre_module): Rename to ... - (linemap_module_restore): ... here. - * line-map.c (linemap_save_pre_module): Delete. - (linemap_restore_pre_module): Rename to ... - (linemap_module_restore): ... here. - - gcc/cp/ - * module.c (bytes_{in,out}::align): New. - (bytes_{in,out}::buf): Use it. - - libcpp/ - * line-map.c (linemap_init): Set default allocator here. - (line_map_new_raw): Break out of ... - (new_linemap): ... here. Call it. - * include/line-map.h (line_map_new_raw): Declare - - 2018-06-14 Nathan Sidwell - - Break out import section. - gcc/cp/ - * module.c (module_state::{read,write}_imports): New. - (module_state::{read,write}_config): Don't do imports here ... - (module_state::{read,write}): ... do them here. - - Fix section alignment. - gcc/cp/ - * module.c (elf_out::grow): Fix padding calc. - (elf_out::add): Assert aligned. - - Write out line maps. - gcc/cp/ - * cp-tree.g (atom_module_preamble, finish_module): Add line_maps. - * decl2.c (c_parse_final_cleanups): Pass line_table. - * parser.c (c_parse_file): Adjst. - * module.c (struct spewing): New. - (struct slurping): Add GTY tagging. - (module_state::spewer): New. - (module_state::{write,atom_preamble}): Add linemaps. - (module_state::{find,write,read}_locations): New. - - gcc/cp/ - * module.c (struct slurping): New, broken out of ... - (struct module_state): ... here. Move loading data there and - adjust all users. - - 2018-06-13 Nathan Sidwell - - Reorg line_map data structures. - libcpp/ - * include/line-map.h (LINE_MAP_MAX_LOCATION): Define here. - (struct line_map): Move reason field to line_map_ordinary. Adjust - GTY tagging. - (struct line_map_ordinary): Reorder fields for less padding. - (struct line_map_macro): Likewise. - (MAP_ORDINARY_P): New. - (linemap_check_ordinary, linemap_check_macro): Adjust. - (MAP_MODULE_P): Adjust. - * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete. - (new_linemap): Take start_location, not reason. Adjust. - (linemap_add, linemap_enter_macro): Adjust. - (linemap_line_start): Likewise. - (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P. - (linemap_macro_loc_to_spelling_point): Likewise. - (linemap_macro_loc_to_def_point): Likewise. - (linemap_dump): Likewise. - - 2018-06-12 Nathan Sidwell - - Better socket handling. Kill mapping from fd - gcc/cp/ - * module.c (class module_mapper): Add from & to fds. - (module_mapper::{module_mapper,kill}): Adjust. - (module_mapper::{send_command,get_response}): Likewise. - (module_from_cmp): New. - (module_state::atom_preamble): Reimplement. - gcc/ - * doc/invoke.texi (C++ Modules): Remove fd mapper options. - gcc/testsuite/ - * g++.dg/modules/import-2.C: Adjust messages. - * g++.dg/modules/flag-1_b.C: Likewise. - * g++.dg/modules/mod-stamp-1_d.C: Likewise. - - gcc/ - * configure.ac: Rename HOST_HAS_AF_$FOO to HAVE_AF_$FOO. - * configure, config.in: Rebuilt. - gcc/cp/ - * module.c: Adjust. - - 2018-06-11 Nathan Sidwell - - gcc/cp/ - * module.c - (elf_out::grow): Always define, always align. - (elf_out::write): Streaming buffers must be using our - allocator. No need to align here. - - MMAP writing - gcc/ - * configure.ac: Check for posix_fallocate. - * configure, config.in: Rebuilt. - gcc/cp/ - * module.c (MAPPED_WRITING): New. - (data::allocator::{grow,shrink}): New overloads. - (data::use): Check available. - (data::allocator::grow): Deal with allocator failure. - (bytes_in::read): Set overflow on fail. - (bytes_{in,out}::{u32,c,i,u,wi,buf}): Adjust. - (bytes_out::printf): Likewise. - (bytes_out::bytes_out): Allocator is non-optional. - (elf_out): Derive from data::allocator. - (elf_out::{grow,shrink}): New overriders. - (elf_out::elf_out): Find page size. - (elf_out::{create,remove}_mapping): New. - (elf_out::write): New overload. - (elf_out::add): Take bytes_out. Adjust users. - (elf_out::{begin,end}): Add mapping support. - (trees_out::trees_out): Add allocator parm. - (trees_{in::out}::fixed_refs): Delete, adjust uses. - (module_state::write_{readme,config,namespaces,bindings}): Adjust. - (module_state::write_{unnamed,cluster}): Adjust. - - Prep for MMAP exporting. - gcc/cp/ - * module.c (MODULE_MMAP_IO): Rename to ... - (MAPPED_READING): This. - (data): Add allocator class with default instance. - (data::{write,printf}): Move to bytes_out. - (data::read): Move to bytes_in. - (data::{extend,release}): Delete. Adjust uses. - (bytes_out): Add allocator pointer, alter ctor. - (bytes_out::begin): Add need_crc parm. - (elf::section_vec): Delete. - (elf): Add sectab, strtab data members. - (get_num_sections): Delete. - (elf_{in,out}::strings): Delete here. - (elf_in::{grow,shrink}): New. - (elf_in::{get_section{,_limit}): New, adjust uses. - (elf_in::{keep_sections,forget_section}): Delete. - - 2018-06-09 Nathan Sidwell - - MMAP importing! - gcc/cp/ - * module.c (MODULE_MMAP_IO): New define. - (bytes::{begin,end}): Delete. - (elf_in::{freeze,defrost}): Adjust. - (elf_in::{begin,end}): Adjust. - (elf_in::{keep,forget}_section): Adjust. - (elf_in::read): Adjust. - (module_state::our_opts): New static member. Adjust uses. - gcc/ - * doc/invoke.texi (C++ Modules): Document lazy limit change. - - 2018-06-08 Nathan Sidwell - - gcc/cp/ - * module.c (elf): Replace FILE *stream with int fd. Update uses. - - gcc/cp/ - * module.c (bytes::begin): Add CRC parm. - (elf_in): Read buffers, adjust. - - gcc/cp/ - * module.c (elf_out): Track file position directly. - (elf_out::pad): Remove, fold into ... - (elf_out::write): ... here. Take a buffer. - (elf_out::{add,begin,end}): Adjust. - - gcc/cp/ - * module.c (elf): Add hdr member. - (elf_in::begin): Adjust. - (elf_out::{begin,end}): Adjust. - - gcc/cp/ - * module.c (data::printf): Moved from ... - (bytes_out::printf): ... here. - (elf): Replace sections pointer with section_vec local class. - Adjust all uses. - (elf_out): Remove strtab member class. - (elf_out::end): Adjust. - - 2018-06-07 Nathan Sidwell - - gcc/cp/ - * module.c (bytes::calc_crc): Take length parm. Adjust callers. - (elf_out::strtab): Reimplement. - (elf_out::add): Use buffer pos for length. - - gcc/cp/ - * module.c (struct data): Resurrect. Move buffer extension here. - Update users. - (class bytes): Derive from data. - - gcc/cp/ - * module.c (struct data): Delete. Move into ... - (struct bytes): ... here. Update uses. - - gcc/cp/ - * module.c (struct data): Make buffer a pointer. Redo interface. - - Change integer on-disk format. - gcc/cp/ - * module.c (bytes_{in,out}::{i,u,wi}): Reimplement. - (make_bmi_path): Don't prefix absolute paths. - - BMI repo directory - libiberty/ - * pex-unix.c: Fixup optimization issues. - gcc/cp/ - * cxx-module-mapper.sh: Add repo to HELLO. - * module.c (bmi_repo, bmi_repo_length, bmi_path, bmi_path_alloc): New. - (set_bmi_repo, make_bmi_path, drop_bmi_prefix): New. - (module_mapper::{handshake,module_mapper}): Repo location from file. - (relativize_import): Delete. - (module_state::{write_readme,maybe_defrost,do_import,finish_module): - Adjust. - gcc/ - * doc/invoke.texi (C++ Modules): Document bmi repo. - - 2018-06-06 Nathan Sidwell - - Better pex-unix. - libiberty/ - * pex-unix.c (VFORK_STRING): Replace with ... - (IS_FAKE_VFORK): ... this. - (pex_child_error): Delete, fold into ... - (pex_unix_exec_child): ... here. Inform parent, when really vforking. - gcc/cp/ - * module.c (module_mapper::module_mapper): Merge error message. - gcc/testsuite/ - * g++.dg/modules/bad-mapper-1.C: Adjust. - * g++.dg/modules/bad-mapper-{2,3}.C: New. - - gcc/cp/ - * module.c (module_mapper::module_mapper): Ignore sigpipe. - (module_mapper::kill): Restore sigpipe. - (module_mapper::{response_unexpected,get_response}): Cope with EOF. - gcc/testsuite/ - * g++.dg/modules/bad-mapper-1.C: New. - - 2018-06-05 Nathan Sidwell - - gcc/ - * doc/invoke.texi (C++ Modules): Clarify and extend. - - 2018-06-04 Nathan Sidwell - - Self relative direct import pathnames. - gcc/cp/ - * module.c (relativize_import): New. - (module_state::write_readme): Call it. - (module_state::read_imports): Make import relative to importer, - query mapper if needed. - - Cookies for mapping files - gcc/cp/ - * module.c (module_mapper::response_eol): Add ignore arg. - (module_mapper::module_mapper): Cookie on file mapper. - gcc/ - * invoke.texi (C++ Modules): Document file mapper cookie. - gcc/testsuite/ - * g++.dg/modules/map-1_b.C: Use specific mapper. - * g++.dg/modules/map-1_b.map: New. - - 2018-06-03 Nathan Sidwell - - gcc/ - * diagnostic.c (diagnostic_report_current_module): Don't claim - module was imported. - * doc/invoke.texi (C++ Modules): Update module-mapper docs. - gcc/cp/ - * module.c (module_mapper::module_mapper): Change syntax for - option. - (module_mapper::response_token): Add all parm. - (module_mapper::bmi_response): Use it. - (module_state::check_read): Fix error reporting. - (finish_module): Warn if not exporting due to errors. - gcc/testsuite/ - * lib/prune.exp (prune_gcc_output): Adjust module import regexp/ - * g++.dg/modules/map-1_[ab].C: Adjust module-mapper arg. - * g++.dg/modules/atom-decl-2.C: Add expected warning - * g++.dg/modules/mod-decl-1.C: Likewise. - * g++.dg/modules/mod-decl-3.C: Likewise. - * g++.dg/modules/proclaim-1.C: Likewise. - - 2018-06-01 Nathan Sidwell - - gcc/cp/ - * module.c (module_mapper): Robustify. - - gcc/fortran/ - * cpp.c (cb_file_change): Adjust for line map inclusion changes. - - Module mapping file is back - gcc/ - * doc/invoke.text (C++ Modules): Document mapping file. - gcc/cp/ - * cxx-module-mapper.sh: Strip -fmodule-preamble=. - * module.c (elf::get_error): Detect no file name. - (module_state): Add imported field. - (module_state::is_{imported,mapping}): New. - (module_mapper::module_mapper): Read mapping file. - (module_mapper::get_response): Distingish empty from end. - (module_state::get_module): Copy a mapping. - (module_state::insert_mapping): New. - (module_state::read_imports): Adjust. - (module_state::do_import): Set imported. - (import_module, declare_module): Adjust. - (module_state::atom_preamble): Adjust. - gcc/testsuite/ - * g++.dg/modules/map-1{_a.C,_b.C,.map}: New. - - 2018-05-31 Nathan Sidwell - - gcc/ - * doc/invoke.texi (C++ Modules): Show mapper cookie. - gcc/cp/ - * module.c (module_mapper::fini): Assert. - (module_mapper::module_mapper): Remove dup2. - (module_mapper::reset): Delete. - - gcc/ - * doc/invoke.texi (C++ Modules): Rename -fmodule-server to - -fmodule-mapper. - gcc/c-family/ - * c.opt (fmodule-mapper): Renamed from fmodule-server. - gcc/cp/ - * cxx-module-mapper.sh: Renamed from cxx-module-server.sh. - * Make-lang.in: Update. - * module.c (struct module_mapper): Renamed from module_server. - - Merge trunk r261033. - - gcc/cp/ - * module.c (bytes_in::begin): Add location_t arg. - (elf_in::begin): Add location args. - (trees_in::{tree_node,finish}): Use error_at. - (module_server::module_server): Likewise. - (module_state::read*): Adjust. - (module_state::{do_import,lazy_load}): Don't set input_location. - (finish_module): Likewise. - - ASYNC loading & server cookie. - gcc/cp/ - * cp-tree.h (reseat_module_loc, module_from_loc): Delete. - (atom_module_preamble): Declare. - * cxx-module-server.sh (cmd): Fix ASYNC response. - * lex.c (reseat_module_loc, module_from_loc): Delete. - * module.c (module_state::from_loc): Is a field. - (module_server): Require locations throughout. Redesign - interface. Add cookie. - (module_state::read_config): Use from_loc. - (module_state::read): Don't set module_purview here ... - (module_state::find_module): ... do it here. - (module_state::do_import): Add check_crc flag. Don't query server - here. - (import_module, declare_module): Query server here (ts). - (module_state::atom_preamble): New. - (atom_module_preamble): Call it. - (finish_module): Adjust. - * parser.c (cp_parser_peek_module_name): Fold into ... - (cp_parser_module_name): ... here. - (cp_parser_module_declaration): No injected atom end marker. - (cp_parser_module_preamble): Rename to ... - (cp_parser_get_module_preamble_tokens): ... this. Don't append - end marker. Return end loc. - (cp_parser_parse_module_preamble): New. - (cp_parser_declaration_seq_opt): Adjust. - (cp_parser_fill_main): Skip preamble. - (c_parse_file): Do preamble tokenization and parsing here. - gcc/ - * doc/invoke.texi (C++ Modules): Document server cookie. - libcpp/ - * include/cpplib.h (cpp_relocate_peeked_tokens): Declare. - * include/line-map.h (linemap_save_pre_module) - (linemap_restore_pre_module): Declare. - (LINEMAP_MODULE_SET_FROM): Delete. - * lex.c (cpp_relocate_peeked_tokens): New. - * line-map.c (linemap_module_loc): Set from direcly. - (linemap_save_pre_module, linemap_restore_pre_module): New. - gcc/testsuite/ - * g++.dg/modules/flag-1_b.C - * g++.dg/modules/freeze-1_d.C - * g++.dg/modules/import-2.C - * g++.dg/modules/indirect-1_c.C - * g++.dg/modules/mod-stamp-1_d.C - - 2018-05-30 Nathan Sidwell - - Module location - libcpp/ - * include/cpplib.h (cpp_module_file): Delete. - * include/line-map.h (MAP_MODULE_P, LINEMAP_MODULE_SET_FROM): New. - (linemap_module_loc): Declare. - * files.c (cpp_module_file): Delete. - * line-map.c (linemap_module_loc): New. - gcc/cp/ - * cp-tree.h (module_file_nest): Delete. - (make_module_loc, reseat_module_loc, module_from_loc): Declare. - * lex.c (module_file_nest): Delete. - (make_module_loc, reseat_module_loc, module_from_loc): New. - * module.c (struct module_state): Replace imp_loc and self_loc - with plain loc. - (module_state::{push,pop}_location): Delete. - (module_state::from_loc): New. - (module_state::find_module): Set module loc here. - (module_state::do_import): Adjust loc setting. - (module_state::lazy_load): Likewise. - (finish_module): Likewise. - gcc/ - * diagnostic.c (diagnostic_report_current_module): Show module imports. - gcc/testsuite/ - * lib/prune.exp: Prune 'module imported at'. - * g++.dg/modules/atom-check-1_b.C: Adjust. - * g++.dg/modules/circ-1_c.C: Adjust. - * g++.dg/modules/flag-1_b.C: Adjust. - * g++.dg/modules/import-2.C: Adjust. - * g++.dg/modules/mod-decl-1.C: Adjust. - * g++.dg/modules/mod-decl-2_b.C: Adjust. - * g++.dg/modules/mod-stamp-1_d.C: Adjust. - - gcc/cp/ - * module.c (struct module_state): Replace loc with imp_loc & - self_loc. Rename imported to direct. - (module_state::occupied): Delete. - (module_state::read{_,config}): Replace crc_ptr with bool flag. - (module_state::do_import): ... here. Break out ... - (module_state::find_module): ... this part. Absorb ... - (module_state::occupy): ... this. Delete. - (module_state::get_module): Change default insert. Check vec_name - for occupation. - (module_state::write_imports): Adjust. - (import_module, declare_module): Adjust. - - 2018-05-29 Nathan Sidwell - - Included from index becomes included_at location - libcpp/ - * include/line-map.h (line_map_ordinary): Replace included_from - index with included_at source_location. - (ORDINARY_MAP_INCLUDER_FILE_INDEX, LAST_SOURCE_LINE_LOCATION) - (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete. - (INCUDED_FROM): Delete. - (INCLUDED_AT, linemap_included_at): New. - (MAIN_FILE_P): Adjust. - * directives.c (do_linemarker): Use linemap_included_at. - * line-map.c (include_at_map): New. - (line_check_files_exited): Use it. - (LAST_SOURCE_LINE_LOCATION): New (moved from header). - (linemap_add, linemap_dump, linemap_dump_location): Adjust. - gcc/ - * diagnostic.c (diagnostic_report_current_module): Use - linemap_included_at. Adjust line & col discovery. - gcc/c-family/ - * c-common.c (try_to_locate_new_include_insertion_point): Use - linemap_included_at. - * c-lex.c (fe_file_change): Use INCLUDED_AT. - * c-ppoutput.c (pp_file_change): Likewise. - - libcpp/ - * include/line-map.h (enum lc_reason): Add LC_HWM, LC_CXX_MODULE. - * line-map.c (linemap_dump): Adjust. - gcc/ - * diagnostic.c (diagnostic_report_current_module): Reroll loop. - - gcc/cp/ - * cxx-module-server.sh: Add batching and ASYNC support. - gcc/ - * doc/invoke.texi (C++ Modules): More protocol explanation - - 2018-05-25 Nathan Sidwell - - Server protocol batching - gcc/ - * doc/invoke.texi (C++ Modules): Document protocol batching. - gcc/cp/ - * cp-tree.h (maybe_peek_import): Delete. - * lex.c (atom_preamble_prefix_peek): Drop import peeking. - * parser.c (cp_parser_module_preamble): Likewise. - * module.c (module_server::{send_command,get_response}): Deal with - batching. - (module_state::peek_import_query, maybe_peek_import): Delete. - (module_state::next_line): New. - gcc/tesutsuite/ - * g++.dg/modules/atom-peek-1_[abc].C: Delete. - - Merge trunk r260753. - - Direct import lambda returns! - gcc/cp/ - * module.c (depset::decl_key): Remove assert. - (trees_{in,out}::core_vals): Serialize type context, lambda expr and - decl size & value. - (trees_out::tree_decl): Spot voldemort returns. Ident by index. - (trees_in::tree_node): Ident by index. - (trees_in::finish_type): Don't set type context here. - (depset::hash::add_dependency): Namespaces are also ok. - * decl.c (fndecl_declared_return_type): Default to auto. - * decl2.c (no_linkage_error): Ignore imported decls. - * name-lookup.h (lookup_by_ident): Ident is index. - (get_lookup_ident): Declare. - * name-lookup.c (get_binding_or_decl): New. - (lookup_by_ident): Use it. Ident is index. - (get_lookup_ident): New. - gcc/testsuite/ - * g++.dg/modules/vmort-1_[ab].C: New. - * g++.dg/modules/lambda-1_[ab].C: New. - - 2018-05-24 Nathan Sidwell - - gcc/cp/ - * name-lookup.c (extract_module_decls): Don't strip template of - result. - gcc/ - * doc/invoke.texi (C++ Modules): Consider batching. - - gcc/ - * doc/invoke.texi (C++ ModuleS): Update server docs. - gcc/cp/ - * cxx-module-server.sh: Add INCLUDE. - * semantics.c (deferred_access): Move GTY. - * module.c (module_state::global_vec): Move GTY. - (module_state::modules): Likewise. - * parser.c (cp_parser_peek_module_name): Remove incomplete - partition work. - - DECL_DISCRIMINATOR for local classes, merge local var disc. - gcc/cp/ - * cp-tree.h (language_function): Remove x_local_names. - (DECL_DISCRIMINATOR_P): Allow IMPLICIT_TyPEDEF too. - (DECL_DISCRIMINATOR_SET_P): Delete. - (local_classes): Delete declaration. - (determine_local_discriminator): Declare. - * class.c (local_classes): Delete. - (init_class_processing): Don't init it. - * decl.c (local_names): Delete. - (local_entities): New. - (push_local_name): Replace with ... - (determine_local_discriminator): ... this. - (cp_finish_decl): Adjust. - (save_function_data, finish_function): Remove local_name handling. - * decl2.c (finish_anon_union): Set discriminator. - * mangle.c (write_unnamed_type_name): Use discriminator_for_local_entity. - (local_class_index): Delete. - (discriminator_for_local_entity): Use DECL_DISCRIMINATOR for both - cases. - (write_local_name): Adjust. - * name-lookup.c (do_pushtag): Use determine_local_discriminator. - gcc/testsuite/ - * g++.dg/abi/anon5.C: New. - - 2018-05-23 Nathan Sidwell - - gcc/ - * diagnostic-code.h (fullname): Delete. - * diagnostic.c (fullname): Delete. - * toplev.c (general_init): Don't set it. - gcc/cp/ - * module.c: Include opts.h. - (module_state::get_option_string): New. - (module_state::write_{readme,config}): Write option string. - (module_state::read_config): Check it. - (module_state::write): Adjust. - (module_server::module_server): Adjust. - gcc/testsuite/ - * g++.dg/modules/flag-1_[ab].C: New. - - Now with a Sneakoscope! - gcc/cp/ - * module.c (depset::hash): Add a sneakoscope. - (module_state::find_dependencies): Turn it on. - (trees_out::tree_decl): Check it. - gcc/testsuite/ - * g++.dg/modules/local-1_[ab}.C: New. - - gcc/cp/ - * cxx-module-server.sh: Remove --no-default. - * module.c (module_server::send_command): New. - (module_server::{reset,handshake,import_export_query,export_done}): - Use it. - gcc/testsuite/ - * g++.dg/modules/atom-peek-1_[bc].C: Adjust scans. - * g++.dg/modules/indirect-1_c.C: Likewise. - - 2018-05-22 Nathan Sidwell - - gcc/cp/ - * cxx-module-server.sh: Add --no-compile, --no-default and - --mapping options. - - gcc/cp/ - * module.c (depset::defn_key): Add is_def parm. - (depset::hash::add_definition): Delete. - (depset::hash::add_dependency): Add either decl or defn. - (depset::hash::add_binding): Use add_dependency. - (cluster_cmp): Swap defns and decls. - (cluster_tag): Delete ct_voldemort, ct_no_decl. - (module_state::{read,write}_cluster): Voldemorts are implicit. - (module_state::write): Adjust. - gcc/testsuite/ - * g++.dg/modules/unnamed-1_b.C: Adjust module scan. - - Revert lazy definition patches. Once one gets into template land - it's all very brittle. We end up with an unmaintained difference - betweek 'we need the definition right now', and 'we need the - definition at some point'. I end up not being able to maintin the - SCC dependency graph, and my head melted, looking a the rat hole - that was appearing. Until proved otherwise, there are other - things to get on with. - gcc/cp/ - * cp-tree.h (DECL_MODULE_LAZY_DEFN, HAS_DECL_MODULE_LAZY_DEFN_P) - (MAYBE_DECL_MODULE_LAZY_DEFN): Delete. - (struct lang_decl_min): Remove lazy_module_defn field. - (lazy_load_defn): Delete decl. - * constexpr.c (cxx_eval_call_expression): Remove lazy loading. - * decl2.c (decl_defined_p, mark_used): Likewise. - * module.c (depset::hash::add_definition): Remove DEFERRED parm. - (trees_in::{pre,}seed): Delete. - (trees_out::seeding{,_p}): Delete. - (trees_out::unmark_trees): Seeding not needed. - (trees_out::{begin,end}): Delete seeding variants. - (trees_out::seed): Remove. - (trees_out::insert): Return val, remove seeding. - (trees_{in,out}::lang_decl_vals): Remove seeding. - (has_definition): Return bool. - (ct_seed_decl, ct_self_used): Delete. - - (module_state::{read,write}_cluster): Remove lazy handling. - (module_state::{find_dependencies,write}): Adjust. - (module_state::check_read): Adjust. - (module_state::lazy_load, lazy_load_defn): Delete. - * ptree.c (cxx_print_decl): Remove lazy defn index. - - Almost lazy function definitions. - gcc/cp/ - * constexpr.c (cxx_eval_call_expression): Maybe lazy load. - * decl2.c (decl_defined_p): Lazy definitions are ok. - (mark_used): Try and lazy load. - * module.c (module_state::lazy_load): Lazy load a definition. - (trees_out::seed): Mark template result. - (trees_in::tree_node): Adjust mark_used. - (module_state::write_cluster): Adjust. - (module_state::read_cluster): Accept ct_self_used. - (lazy_load_defn): New. - - gcc/cp/ - * module.c (trees_out::seed): Reimplement mechanim. - (trees_out::{begin,end}): Don't turn seeding on/off here. - (trees_out::unmark_trees): Add logging. - (trees_in::preseed): Fix addition calculation. - (module_state::write_cluster): Adjust lazy defn seeding. - (module_state::read_cluster): Add lazy defn seeding. - (module_State::find_dependencies): Adjust. - - 2018-05-21 Nathan Sidwell - - libcpp/ - * directives.c (struct if_stack): Add hash_loc field. - (PEEKED): Replace with ... - (PEEK_INVISIBLE): ... this. Inverted sense. - (DIRECTIVE_TABLE): Update. - (linemarker_dir): Add PEEK_INVISIBLE. - (_cpp_handle_directive): Correctly handle if nests. - - gcc/testsuite/ - * g++.dg/modules/atom-preamble-2_[def].C: New. - - gcc/cp/ - * cp-tree.h (HAS_DECL_MODULE_LAZY_DEFN_P): New. - (MAYBE_DECL_MODULE_LAZY_DEFN): Use it. - * module.c (trees_in::{pre,}seed): Adjust. - (trees_out::{begin,end}): New overloads. - (trees_out::unmark_trees): Adjust. - (trees_out::{preseed,insert}): Correct force marking. - (trees_in::tree_node): Robustify. - (module_state::write_cluster): Fix name, better messages, - (module_state::read_cluster): Use ct_no_decl. - (module_state::write): Use HAS_DECL_MODULE_LAZY_DEFN_P. - (module_state::check_read): Use decl if it makes sense. - - Write lazy decls (no reading yet) - gcc/cp/ - * module.c (elf_out::strtab::named_decl): Add IS_DEFN parm. - (elf_out::named_decl): Likewise. - (elf_out::strtab::write): Adjust. - (FIXED_LIMIT): New. - (trees_out::set_seed): Delete. - (trees_out::{pre,un,}seed): New. - (trees_out::insert): Adjust for seeding. - (trees_out::tree_ref): Likewise. - (cluster_tag): Add ct_lazy. - (module_state::write_cluster): Preseed decls of lazy defns. - (module_state::find_dependencies): Adjust seeding changes. - (module_state::write): Determine lazy defn section numbers. - - 2018-05-20 Nathan Sidwell - - libcpp/ - * internal.h (_cpp_handle_directive): Add HASH_LOC arg. - * directives.c (_cpp_handle_directive): Add HASH_LOC arg, store it. - * init.c (read_original_filename): Adjust _cpp_handle_directive call. - * lex.c (_cpp_lex_token): Likewise. - * traditional.c (_cpp_scan_out_logical_line): Likewise. - * directives-only.c (_cpp_preprocess_dir_only): Likewise. - - Import peeking - gcc/c-family/ - * c-lex.c (c_lex_with_flags) : Check - C_LEX_STRING_IS_HEADER. - * c-pragma.h (C_LEX_STRING_IS_HEADER): New flag. - gcc/cp/ - * cp-tree.h (HEADER_STRING_LITERAL_P): Delete. - (maybe_peek_import): Declare. - * cxx-module-server.sh: Adjust. - * lex.c (atom_preamble_prefix_peek): Add peeking state. - * module.c (module_server::peek_import_query): New. - (make_flat_name): New. Broken out of ... - (module_state::do_import): ... here. Call it. - (maybe_peek_import): New. - * parser.c (cp_parser_peek_module_name): New. - (cp_parser_module_name): Use it. - (cp_parser_import_declaration): Adjust. - (cp_parser_module_preamble): Do peeking. - gcc/ - * doc/invoke.texi (C++ Modules): Tweak server protocol - gcc/testsuite/ - * g++.dg/modules/atom-peek-1_[abc].C: New. - * g++.dg/modules/mod-decl-1.C: Adjust diags. - * g++.dg/modules/p0713-2.C: Likewise. - * g++.dg/modules/proclaim-1.C: Likewise. - - Diagnose pragmas ending preamble. - libcpp/ - * lex.c (cpp_peek_token_with_location): Set peeked_location to - incoming location. Fix pragma unwind. - gcc/cp/ - * cxx-module-server.sh: Add new commands. - * lex.c (atom_preamble_prefix_peek): Note trailing pragma. - gcc/ - * doc/invoke.text (C++ Modules): More server commands. - gcc/testsuite/ - * g++.dg/modules/atom-pragma-[123].C: New. - - 2018-05-19 Nathan Sidwell - - Parse after tokenizing - libcpp/ - * lex.c (cpp_peek_token_with_location): Adjust for compiler warning. - gcc/cp/ - * parser.c (module_preamble_end_loc): Rename to ... - (module_marker_loc): ... here. - (cp_parser_module_declaration): Reimplement. - (cp_parser_import_declaration): Adjust. - (cp_parser_module_preamble): Don't parse here. Add artificial end - marker. - (cp_parser_declaration_seq_opt): Adjust for atom. - (cp_parser_fill_main): Whole buffer is to be parsed. - (c_parse_file): Don't set end_loc here. - gcc/testsuite/ - * g++.dg/modules/atom-decl-1.C: Adjust diagnostics. - * g++.dg/modules/atom-preamble-1.C: Likewise. - * g++.dg/modules/mod-decl-1.C: Likewise. - * g++.dg/modules/p0713-[23].C: Likewise. - - 2018-05-18 Nathan Sidwell - - gcc/cp/ - * module.c (trees_out::maybe_insert_typeof): New. - (trees_out::{force_,maybe_,}insert): Merge, adjust callers. - (trees_out::tree_decl): Use maybe_insert_typeof. - (module_state::write_cluster): Likewise. - gcc/testsuite/ - * g++.dg/modules/indirect-3_c.C: Adjust scans. - - gcc/cp/ - * module.c (module_state::write_cluster): Break apart unnamed - numbering from marking. - (module_state::write): Break apart cluster sizing from section - numbering. - - gcc/cp/ - * module.c (trees_out::mark_node): Lose walk_into parm. Adjust - all callers. - (module_state::write_cluster): Assert binding already marked. - - gcc/cp/ - * module.c (module_state::mark_definition): Remove include_decl - parm. - (module_state::mark_{template,function,var,class,enum}_def): Likewise. - - gcc/cp/ - * module.c (trees_in::{preseed,seed}): New. - (trees_out::seeding): New member. - (trees_out::seeding_p): New predicate. - (trees_out::unmark_trees): Add trees_in parm to preseed. - (trees_out::end): Add trees_in parm. - (trees_out::set_seed): New. - (trees_out::tree_decl): Check seeding_p. - (module_state::find_dependencies): Preseed the decl of a defn. - gcc/testsuite/ - * g++.dg/modules/defer-1.C :New. - - gcc/cp/ - * module.c (depset::hash::add_definition): Add DEFERRABLE parm. - (has_definition): Return tristate. - (depset::hash::add_{dependency,binding}): Adjust. - (module_state::find_dependencies): Refactor. - - Add lazy_module_defn cookie. - * cp-tree.h (DECL_MODULE_LAXY_DEGN, MAYBE_DECL_MODULE_LAZY_DEFN): New. - (struct lang_decl_min): Add lazy_module_defn field. - * module.c (trees_{in,out}::lang_decl_vals): Serialize it. - * ptree.c (cxx_print_decl): Print it. - - gcc/cp/ - * cp-tree.h (ovl_op_flags, ovl_op_code): Reindent. - * lex.c (atom_preamble_prefix_peek): FIXME. - * parser.c (cp_parser_module_preamble): FIXME. - * module.c (bytes_out::streaming_p (): New. - (trees_out::streaming_p): Delete. - (tt_backref): Delete. Update uses to know -ve == backref - (module_state::write_cluster): Some refactoring. - - 2018-05-16 Nathan Sidwell - - Preamble rescanning! - gcc/ - * configure.ac: Look for execv. - * config.in, configure: Rebuilt. - * toplev.h (original_argc, original_argv): Declare. - * toplev.c (original_argc, original_argv): Declare. - (toplev::main): Set them. - doc/invoke.texi (EE) Rename to ... - (fmodule-preamble): ... this. - (C++ Modules): Document RESET message. Document N,N. - gcc/c-family/ - * c.opt (EE): Rename to ... - (fmodule-preamble) ... here. - (fmodule-preamble=): New hidden option. - * c-ppoutput.c (scan_translation_unit): Use cpp_pop_directives. - gcc/cp/ - * cp-tree.h (atom_preamble_prefix_peek): Add from-parser parm. - (maybe_repeat_preamble): Declare. - * cp-lang.c (atom_preamble_fsm): Adjust. - * cxx-module-server.sh (RESET): New command. - * lang-specs.h (@c++): Adjust EE->fmodule-preamble. - * lex.c (atom_preamble_prefix_peek): Add from-parser parm. Check - flag_module_preamble. Call maybe_repeat_preamble. - * module.c: #include "toplev.h" - (module_server_name): Is const. - (module_server::module_server): Copy command. Support N,N for two - pipes. - (module_server::make): Adjust. - (module_server::reset): New. - (module_server::fini): Add reset arg. Reset. - (maybe_repeat_preamble): New. - (handle_module_option): Adjust. - * parser.c (cp_parser_module_preamble): Adjust. - gcc/testsuite/ - * g++.dg/modules/cpp-preamble-[1-8].C: Adjust options. - * g++.dg/modules/atom-rescan-1.C: New. - * g++.dg/modules/atom-no-rescan-1.C: New. - - 2018-05-15 Nathan Sidwell - - Detect cpp directives at end of preamble - libcpp/ - * include/cpplib.h (cpp_peek_token_with_location): Declare. - (cpp_pop_directives): Declare. - * internal.h (struct cpp_reader): Add peeked_directive field. - * directives.c (PEEKED): New. - (DIRECTIVE_TABLE): Add it. - (_cpp_handle_directive): Set peeked_directive. - (cpp_pop_directives): New. - * lex.c (cpp_peek_token): Wrapper around ... - (cpp_peek_token_with_location): ... this. - gcc/cp/ - * cp-lang.c (atom_preamble_fsm): Update for new state transitions. - * lex.c (atom_preamble_prefix_peek): Check peeked directives. - * parser.c (cp_parser_module_preamble): Update. - gcc/testsuite/ - * g++.dg/modules/cpp-preamble-1.C: Add diag - * g++.dg/modules/cpp-preamble-[678].C: New. - - libcpp/ - * include/cpplib.h (cpp_in_macro_expansion_p): Declare. - * macro.c (in_macro_expansion_p): Rename to ... - (cpp_in_macro_expansion_p): ... here. Externalize. - (cpp_get_token_1): Adjust. - * internal.h: Update docs. - gcc/ - * langhooks.h (struct lang_hooks): Adjust preprocess_preamble. - gcc/c-family/ - * c-ppoutput.c (scan_translation_unit): Pass token location to - preamble hook. - gcc/cp/ - * cp-lang.c (atom_preamble_fsm): Pass token loc through. - * cp-tree.h (atom_preamble_prefix_next): Take token loc. - * lex.c (atom_preamble_prefix_next): Take token loc. Warn if - ending inside macro. - * parser.c (cp_parser_module_preamble): Adjust. - gcc/testsuite/ - * g++.dg/modules/cpp-preamble-5.C: New. - - gcc/ - * langhooks.h (struct lang_hooks): Adjust preprocess_preamble. - gcc/cp/ - * cp-tree.h (atom_preamble_prefix_{peek,next}): Declare. - * cp-lang.c (atom_preambls_fsm): Adjust args. Use - atom_preamble_prefix_{peek,next}. - * lex.c (atom_preamble_prefix_len): Turn into ... - (atom_preamble_prefix_peek): ... this. - (atom_preamble_prefx_next): New. - * parser.c (cp_parser_module_preamble): Adjust. - gcc/c-family/ - * c-ppoutput.c (scan_translation_unit): Adjust - gcc/testsuite/ - * g++.dg/modules/atom-preamble-2_c.C: New. - * g++.dg/modules/cpp-preamble-4.C: New. - - gcc/cp/ - * Make-lang.in: Dont sed server version - * module.c: Use fixed server version. - * cxx-module-server.sh: Likewise[...] [diff truncated at 524288 bytes]