This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [pph] New PPH command line and tests
- From: Diego Novillo <dnovillo at google dot com>
- To: Lawrence Crowl <crowl at google dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 17 Feb 2011 09:37:35 -0500
- Subject: Re: [pph] New PPH command line and tests
- References: <AANLkTinrv8BqMbgfb7OPCfOKGaEAXDxt-PZb31tpcwU1@mail.gmail.com>
On 11-02-16 07:03 PM, Lawrence Crowl wrote:
The pre-tokenized header (PTH) tests that are currently in
the gcc/testsuite/pph directory have been rewritten to the new
command-line-driven scheme. In the process, I've renamed tests to
the following conventions in the prefix of the name.
[acdpxy][12]*
a - auxillary headers
c - positive tests for c-level headers and sources
d - negative tests for c-level headers and sources
p - positive tests for what would be c-level code, but which
due to C++ standard namespace games are not quite C level
tests.
x - C++-level positive tests.
y - C++-level negative tests.
1 - first priority feature tests
2 - second priority feature tests
Could you add a README file in g++.dg/pph documenting this convention?
You rely on tcl expansion ordering to get at these files in the proper
order, right?
Index: gcc/strstrmap.c
===================================================================
*** gcc/strstrmap.c (revision 0)
--- gcc/strstrmap.c (revision 0)
***************
*** 0 ****
--- 1,181 ----
+ /* A string to string mapping.
+
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Lawrence Crowl <crowl@google.com> and
+ Diego Novillo <dnovillo@google.com>.
I had nothing to do with this :)
+ /* A string to string mapping.
+
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Lawrence Crowl <crowl@google.com> and
+ Diego Novillo <dnovillo@google.com>.
Likewise.
+
+ length = strlen (basename);
+ strcpy (hdrbuf, basename);
+ strcpy (hdrbuf+length, ".h");
Space around '+'.
+ strcpy (pphbuf, basename);
+ strcpy (pphbuf+length, ".pph");
Likewise.
+ old_file = strstrmap_insert (include_pph_mapping, hdrbuf, pphbuf);
+ if (old_file != NULL)
+ {
+ /* FIXME pph: free (CONST_CAST (void*, old_file)); */
+ fatal_error ("PPH include %s was remapped: ", pphbuf);
What's this FIXME? You're about to fatal_error, freeing memory is not
really important.
+ include = line;
+ pph_file = tab+1;
space around '+'.
+ old_file = strstrmap_insert (include_pph_mapping, include, pph_file);
+ if (old_file != NULL)
+ {
+ /* FIXME pph: free (CONST_CAST (void*, old_file)); */
+ fatal_error ("PPH include %s was remapped: ", include);
Same as before.
--- 1154,1160 ----
# Language-specific object files shared by all C-family front ends.
C_COMMON_OBJS = c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o \
c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o \
! c-family/c-omp.o strstrmap.o c-family/c-opts.o c-family/c-pch.o \
c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o \
c-family/c-semantics.o c-family/c-ada-spec.o
strstrmap.o should be in OBJS-common, actually.
Looks OK otherwise.
I'm currently finishing the move to use the LTO streamer to write out
trees from the front end. To test it out, I will hook it to -fpth to
write the few trees produced during pre-tokenization. So, I've added a
pth testsuite directory and a dg-pth.exp.
Once I have that working, you can start using it to emit/read trees from
pph. We can decide later what to do with the pre-tokenization code.
Diego.