[cfe-dev] Late Parsed Template support for PCH

Will Wilson will at indefiant.com
Thu Jul 25 12:57:49 PDT 2013


Thanks for the feedback.

I've started work on supporting serialization and I've made reasonable
progress so far. The need for lazy deserialization hadn't escaped me but I
was concentrating on just getting it up and running initially - as slightly
slower would be better than completely broken. I can look into lazy
deserialization but I may need a few pointers on the best approach and if
it's going to be a substantial job it might have to wait until a later
patch.

- Will.



On 25 July 2013 18:18, Douglas Gregor <dgregor at apple.com> wrote:

>
> On Jul 24, 2013, at 9:18 AM, Will Wilson <will at indefiant.com> wrote:
>
> Hi All,
>
> I've discovered a rather nasty issue with -fdelayed-template-parsing
> enabled. If this is used to build a PCH all of the stored template tokens
> are lost leading an incomplete AST when the PCH is used to create the
> complete TU.
>
> Is this by design or a missing feature for the serialization code?
>
> Unfortunately, due to a huge body of MSVC targeted code and a need to use
> PCH files to maintain acceptable performance I need to make this work
> seamlessly. The data that would need preserving is currently stored in the
> Parser and is a map of const FunctionDecl* to LateParsedTemplatedFunction*.
> The LateParsedTemplatedFunction is essentially a SmallVector of Tokens.
>
> Before I dive in and attempt to add support for serializing this, is there
> anything I should know?
>
>
> It’s a missing feature. One will need to serialize the actual tokens for
> each of the late-parsed FunctionDecl’s, and be able to lazily deserialize
> and then parse the tokens when an actual definition is needed.
>
> - Doug
>
>
>


-- 
*Indefiant Ltd.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130725/915f8b1f/attachment.html>


More information about the cfe-dev mailing list