[cfe-dev] PCH without original files

Axel Naumann Axel.Naumann at cern.ch
Mon Jan 31 01:55:29 PST 2011


Hi,

Tom Prince wrote on 01/31/2011 09:41 AM:
> On 2011-01-25, Axel Naumann wrote:
>> Attached patch allows the ASTReader to use a PCH even if the original
>> files (which are store as absolute file names or relative to sysroot)
>> have been removed. Drawback: without these original files, diagnostics
>> referring to source locations in the original files cannot show the
>> source code:
> 
> Should it be possible to generate equivalent source code from the AST?

Yes, though without line numbers etc. It would require passing both a
source location and an AST node into Diagnostics. I didn't implement
that because I wanted to reduce dependencies, and because in the end I
expect this case to be rare: PCHs will soon find their header files
again through HeaderSearch, even if they have been moved.

Cheers, Axel.



More information about the cfe-dev mailing list