<div dir="ltr">On Wed, Aug 21, 2013 at 5:00 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im">On Wed, Aug 21, 2013 at 2:53 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br>
</div><div class="im"><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.<div>


<br></div><div>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).]<br>


<div><br></div><div><br></div><div>+  /// whether it came from a file other than the main file. This is different<br>
</div><div><div>+  // from isFromMainFile() because it takes line marker directives into</div><div>+  // account.</div></div><div><br></div><div>/// not // here :-)</div><div><br></div><div><br></div><div>The testing seems a little light.</div>



</div></div><div class="gmail_extra"></div></blockquote></div><br></div></div><div class="gmail_extra">Do you have any suggestions for tests?  I'm not sure adding a test for every user of isMainFile is productive.</div>
</div></blockquote><div><br></div><div>If you can find the existing tests for some of these features, maybe add another RUN: line with</div><div><br></div><div>  %clang_cc1 -E %s -o - | %clang_cc1 -</div></div></div></div>