This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [pph] Do not read pph files more than once (issue4983055)


On 11-09-12 10:50 , Gabriel Charette wrote:
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.

Thanks. I'll try this suggestion.


@@ -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)).

Yeah, we now end up with the file mentioned twice in the vector of images.



Diego.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]