diff options
author | Ulrich Drepper <drepper@gmail.com> | 2022-10-20 10:50:23 +0200 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2022-10-20 10:56:29 +0200 |
commit | a2e28389354495a532eb4b7124106b21236f4f72 (patch) | |
tree | 0e4eae544effc17c0dbc537bb96cd56cbe5fd336 /gcc/cp/Make-lang.in | |
parent | 53e6d7a3102409f0f2a5a9ffbfbeaa62c135d991 (diff) | |
download | gcc-a2e28389354495a532eb4b7124106b21236f4f72.zip gcc-a2e28389354495a532eb4b7124106b21236f4f72.tar.gz gcc-a2e28389354495a532eb4b7124106b21236f4f72.tar.bz2 |
Add C++ library interface data
This patch adds a CSV file with information about the API of the
standard C++ library. This information can be used in multiple ways.
So far there are two use cases:
- to generate the module export list for the standard C++ library
- to create the name hints to compiler emits when symbols in the
std namespace are not found
Adding more uses can be easily done by potentially adding more columns
to the CSV file and adding to the Python script which generates the
output file.
contrib/
2022-10-18 Jonathan Wakely <jwakely@redhat.com>
Ulrich Drepper <drepper@redhat.com>
* gcc_update: Add rule for gcc/cp/std-name-hint.gperf.
gcc/cp/
2022-10-18 Jonathan Wakely <jwakely@redhat.com>
Ulrich Drepper <drepper@redhat.com>
* Make-lang.in: Add rules to generate std-name-hint.gperf. Adjust
rule to generate std-name-hint.h to allow chain rule.
* std-name-hint.h: Regenerated.
* std-name-hint.gperf: This file is now generated.
* cxxapi-data.csv: New file. CSV file with C++ API data.
* gen-cxxapi-file.py: New file. Generate std-name-hint.gperf
and module export source (in future).
Diffstat (limited to 'gcc/cp/Make-lang.in')
-rw-r--r-- | gcc/cp/Make-lang.in | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index aa84d68..291835d 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -153,15 +153,30 @@ endif gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h -# The same procedure for the std-name-hint.gperf file. +# We always need the dependency on the .gperf file because it itself is generated. ifeq ($(ENABLE_MAINTAINER_RULES), true) $(srcdir)/cp/std-name-hint.h: $(srcdir)/cp/std-name-hint.gperf else -$(srcdir)/cp/std-name-hint.h: +$(srcdir)/cp/std-name-hint.h: | $(srcdir)/cp/std-name-hint.gperf endif gperf -o -C -E -k '1,2,7,11,$$' -D -N find -L C++ \ $(srcdir)/cp/std-name-hint.gperf --output-file $(srcdir)/cp/std-name-hint.h +# The std-name-hint.gperf file itself is generated from a general +# C++ API description. +ifeq ($(ENABLE_MAINTAINER_RULES), true) +$(srcdir)/cp/std-name-hint.gperf: $(srcdir)/cp/gen-cxxapi-file.py $(srcdir)/cp/cxxapi-data.csv +else +$(srcdir)/cp/std-name-hint.gperf: +endif + python3 $(srcdir)/cp/gen-cxxapi-file.py hints $(srcdir)/cp/cxxapi-data.csv > $@ +ifneq ($(ENABLE_MAINTAINER_RULES), true) +.SECONDARY: $(srcdir)/cp/std-name-hint.gperf +endif + +# This is the file that depends on the generated header file. +cp/name-lookup.o: $(srcdir)/cp/std-name-hint.h + cc1plus.fda: ../stage1-gcc/cc1plus$(exeext) ../prev-gcc/$(PERF_DATA) $(CREATE_GCOV) -binary ../stage1-gcc/cc1plus$(exeext) -gcov cc1plus.fda -profile ../prev-gcc/$(PERF_DATA) -gcov_version 1 |