Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7466)

Issue 4983055: [pph] Do not read pph files more than once (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by Diego Novillo
Modified:
12 years, 7 months ago
Reviewers:
gcharette1
CC:
Lawrence Crowl, gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -17 lines) Patch
M gcc/cp/pph-streamer.h View 2 chunks +2 lines, -2 lines 0 comments Download
M gcc/cp/pph-streamer-in.c View 6 chunks +35 lines, -6 lines 0 comments Download
M gcc/cp/pph-streamer-out.c View 1 chunk +4 lines, -9 lines 0 comments Download

Messages

Total messages: 3
Diego Novillo
This was not causing any failures, but it is pretty wasteful to read the same ...
12 years, 7 months ago (2011-09-09 20:54:37 UTC) #1
gcharette1
Oops forgot to reply all the first time... On Fri, Sep 9, 2011 at 4:54 ...
12 years, 7 months ago (2011-09-12 14:50:52 UTC) #2
Diego Novillo
12 years, 7 months ago (2011-09-27 17:16:51 UTC) #3
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.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b