<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7601.18106"></HEAD>
<BODY
style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; WORD-WRAP: break-word; PADDING-TOP: 15px; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT size=2 face=Consolas></FONT> </DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=jordan_rose@apple.com
href="mailto:jordan_rose@apple.com">Jordan Rose</A> </DIV>
<DIV><B>Sent:</B> Wednesday, April 17, 2013 7:14 PM</DIV>
<DIV><B>To:</B> <A title=andyg1001@hotmail.co.uk
href="mailto:andyg1001@hotmail.co.uk">Andy Gibbs</A> </DIV>
<DIV><B>Cc:</B> <A title=cfe-commits@cs.uiuc.edu
href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</A> </DIV>
<DIV><B>Subject:</B> Re: r179677 - Extended VerifyDiagnosticConsumer to also
verify sourcefile for diagnostic.</DIV></DIV></DIV>
<DIV><BR></DIV><BR>
<DIV>
<DIV>On Apr 17, 2013, at 1:06 , Andy Gibbs <<A
href="mailto:andyg1001@hotmail.co.uk">andyg1001@hotmail.co.uk</A>>
wrote:</DIV><BR class=Apple-interchange-newline>
<BLOCKQUOTE type="cite"><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; DISPLAY: inline !important; FONT: medium monospace; WHITE-SPACE: normal; ORPHANS: 2; FLOAT: none; LETTER-SPACING: normal; WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">+
// Lookup file via Preprocessor,
like a #include.</SPAN><BR
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; FONT: medium monospace; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; DISPLAY: inline !important; FONT: medium monospace; WHITE-SPACE: normal; ORPHANS: 2; FLOAT: none; LETTER-SPACING: normal; WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">+
const DirectoryLookup
*CurDir;</SPAN><BR
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; FONT: medium monospace; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; DISPLAY: inline !important; FONT: medium monospace; WHITE-SPACE: normal; ORPHANS: 2; FLOAT: none; LETTER-SPACING: normal; WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">+
const FileEntry *FE =
PP->LookupFile(Filename, false, NULL, CurDir,</SPAN><BR
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; FONT: medium monospace; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; DISPLAY: inline !important; FONT: medium monospace; WHITE-SPACE: normal; ORPHANS: 2; FLOAT: none; LETTER-SPACING: normal; WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">+
NULL,
NULL, 0);</SPAN><BR
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; FONT: medium monospace; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"></BLOCKQUOTE></DIV><BR>
<DIV>This seems a bit awkward...what if the file is included on the command line
with -include? (Some of our tests do this.)</DIV>
<DIV><BR></DIV>
<DIV>I guess it works. I was just expecting something like a last-path-component
match, using, say, a search over fileinfo_begin()/_end() in
SourceManager.</DIV>
<DIV><FONT size=2 face=Consolas></FONT> </DIV>
<DIV><FONT color=#ff0000 size=2 face=Consolas>The problem is choosing a solution
that works with modules, which is always the tricky case. I chose this
route because the file may not have already been loaded (which is why there is
also a check to see whether the file needs to be registered). Using the
Preprocessor LookupFile method works quite well because it enables use of the
#include search paths, plus most test-cases will use #include for the included
files so there is some symmetry here. See what you think after you've used
it for a bit; if it needs further perfecting, I can do so!</FONT></DIV>
<DIV><FONT size=2 face=Consolas></FONT><BR></DIV>
<DIV>
<BLOCKQUOTE type="cite"><SPAN style="FONT-FAMILY: monospace">+
if (PH.Next(Line) && Line
> 0)</SPAN><BR style="FONT-FAMILY: monospace"><SPAN
style="FONT-FAMILY: monospace">+
ExpectedLoc =
SM.translateFileLineCol(FE, Line, 1);</SPAN><BR
style="FONT-FAMILY: monospace"></BLOCKQUOTE><BR></DIV>
<DIV>This should probably be asserted or checked; it doesn't make sense to
specify another file without a line number.</DIV>
<DIV><FONT size=2 face=Consolas></FONT><FONT size=2 face=Consolas></FONT><FONT
size=2 face=Consolas></FONT> </DIV>
<DIV><FONT color=#ff0000 size=2 face=Consolas>It is checked. You get an
error message if the line number is omitted or invalid. :o)</FONT></DIV>
<DIV><BR></DIV>
<DIV>I'll look into the 79/80 issue too. Thanks for doing this!</DIV>
<DIV>Jordan</DIV></BODY></HTML>