[cfe-dev] adding FileSkipped() to PPCallbacks
Zhanyong Wan (λx.x x)
wan at google.com
Fri Apr 16 14:09:56 PDT 2010
Thanks for the review, Chris. Please see the new patch. I kept the
signature of FileSkipped() unchanged to be consistent with
On Fri, Apr 16, 2010 at 1:34 PM, Chris Lattner <clattner at apple.com> wrote:
> On Apr 16, 2010, at 11:48 AM, Zhanyong Wan (λx.x x) wrote:
>> Hi Doug,
>> Per our IRC chat yesterday, I'm extending PPCallbacks with a new
>> method FileSkipped() to notify a listener when a #include is skipped
>> due to header guard optimization. Please see the attached patch and
>> let me know if this is the right direction. (I verified that it works
>> for my use case.) Also, how should I add a test for this?
> The .h file change look fine to me, but it isn't good to sink the check below SourceMgr.createFileID. Skipping headers is a fairly hot path, so we don't want it to do additional work when ppcallbacks aren't being used.
> Please change the callback to take the FileEntry or some other information that doesn't require sinking the check below the potentially expensive work.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2246 bytes
Desc: not available
More information about the cfe-dev