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: cpplib: reusing cached include files


Per Bothner wrote:-

> Zack Weinberg wrote:
> 
> >What we want to do is cache the results of _cpp_clean_line, not the
> >raw buffers.
> 
> Yes.  The problem is the _cpp_clean_line cleans the raw buffer
> in-place, possibly shortening each line.  If we try then re-read
> the buffer, there is left-over duplicate crud between the end of
> the cleaned line, and the original raw line.  My patch overwrites
> this crud with whitespace to avoid confusion.
> 
> What we could do is append the new cleaned line to the end of
> the previous cleaned line, but we don't do that.  I suspect the
> current behavior is better for memory caches. We could also
> maintain a data structure mapping the start of each cleaned line,
> but that seems over-kill.

Ultimately we want to append the cleaned lines like you say.  We also
need to keep the annotations around.

Until we do that it will not work properly.  I don't think something
should go in that doesn't work 100%.

Neil.


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