Oops forgot to reply all the first time...
On Fri, Sep 9, 2011 at 4:54 PM, Diego Novillo<dnovillo@google.com> wrote:
This was not causing any failures, but it is pretty wasteful to read
the same PPH more than once.
We cannot just skip them, however. We need to read the line table to
properly modify the line table for the current translation unit.
I don't think that's right. If the header is not re-read (i.e. ifdef
guarded out), it should not show in the line_table either. I think you
simply want to do this check at the top of pph_read_file itself.
@@ -1667,7 +1696,7 @@ pph_read_file (const char *filename)
else
error ("Cannot open PPH file for reading: %s: %m", filename);
- return stream;
+ pph_add_read_image (stream);
}
This needs to be after the check for an already read image I think
(having it here wouldn't create test failures, but would create
duplicate entries for skipped headers (as right now they are still
added to pph_read_images when skipped I think)).