[PATCH] Correctly check for the main file in the presence of line markers

Eli Friedman eli.friedman at gmail.com
Wed Aug 21 16:36:14 PDT 2013


On Wed, Aug 21, 2013 at 2:53 PM, Richard Smith <richard at metafoo.co.uk>wrote:

> I think isPresumedFromMainFile should be the more common choice, so maybe
> should have the more obvious name. Perhaps call the new mechanism
> isFromMainFile and rename the existing mechanism to isWrittenInMainFile?
> I'm still not overjoyed with those names.
>
> FWIW, all calls of isFromMainFile in lib/StaticAnalyzer look like they
> should be using the new mechanism, for consistency when handling
> preprocessed source. [That only leaves the calls in lib/Rewrite and
> VerifyDiagnosticConsumer (both of which should stay as-is), and the one
> caller of isInPrimaryFile that you didn't change (which seems reasonable to
> switch over, assuming the #include_next implementation can cope with
> presumed locations).]
>

#include_next can't use presumed locations: evaluating it requires keeping
track of state (specifically, which search directory the file was found in)
which isn't recorded in line marker directives.

The other feedback makes sense; thanks.

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130821/6aec39a3/attachment.html>


More information about the cfe-commits mailing list