[cfe-commits] [PATCH] Allow PCHReader to be used without having a pre-initialized Preprocessor

Eli Friedman eli.friedman at gmail.com
Wed Jun 17 19:46:56 PDT 2009


On Wed, Jun 17, 2009 at 7:28 PM, Chris Lattner<clattner at apple.com> wrote:
>
> On Jun 17, 2009, at 6:53 PM, Eli Friedman wrote:
>
>> On Wed, Jun 17, 2009 at 6:19 PM, Argyrios Kyrtzidis<kyrtzidis at apple.com>
>> wrote:
>>>
>>> Currently PCHReader depends on getting a pre-initialized Preprocessor.
>>> The attached patch modifies PCHReader so that we can use it to load a
>>> .pch
>>> file, get the information we need and *afterwards* initialize a
>>> Preprocessor
>>> with that info.
>>
>> Why do we want to do this?
>
> Argiris is working on building some infrastructure around the PCH format.
>  Instead of just using the PCH writer for PCH, we'd like to use it for
> general AST serialization/deserialization.  To do something like "load an
> ast and send it to codegen", you really just want to use whatever settings
> the AST was serialized with.  Seem reasonable?

Ah, okay, that makes sense.  Although, what specific uses do you have
in mind?  I can only think of a couple off the top of my head: a
dist-cc-like thing and an inter-procedural analysis tool.

-Eli




More information about the cfe-commits mailing list