[cfe-dev] Proposal to change the PPCallbacks interface

Chandler Carruth chandlerc at google.com
Wed Mar 16 11:38:46 PDT 2011


FYI, lacking any specific objections, I worked with Manuel to fix some
stylistic issues and committed it in r127742. Further comments on the
particulars of the implementation welcome.

On Wed, Mar 9, 2011 at 6:51 PM, Manuel Klimek <klimek at google.com> wrote:

> Hi,
>
> the attached patch is a proposal to add the "raw path" (== the path
> that a file was accessed by in the file manager) into the PPCallback's
> InclusionDirective call.
>
> The problem this solves is that we're trying to replay the compilation
> after observing it via PPCallbacks by mapping virtual files into the
> cache.
> Considering the following example:
>
> lib/b/b.h:
> #include "../a/a.h"
>
> lib/a/a.h:
> int a();
>
> b.cc:
> #include "lib/b/b.h"
> #include "lib/a/a.h"
> int main() { return 0; }
>
> When compiled with -Ilib/b, the FileEntry in the InclusionDirective
> will have a getName() leading to "lib/b/../a/a.h" for both include
> directives of a.h because of inode caching.
> When we replay this compilation, we need to inject the raw path under
> which the include is looked up, which means that we need to get a.h
> into the cache for "./lib/a/a.h".
>
> Is this an acceptable solution?
> Thanks,
> /Manuel
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110316/48051db6/attachment.html>


More information about the cfe-dev mailing list