r179677 - Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.

Jordan Rose jordan_rose at apple.com
Wed Apr 17 10:14:55 PDT 2013


On Apr 17, 2013, at 1:06 , Andy Gibbs <andyg1001 at hotmail.co.uk> wrote:

> +        // Lookup file via Preprocessor, like a #include.
> +        const DirectoryLookup *CurDir;
> +        const FileEntry *FE = PP->LookupFile(Filename, false, NULL, CurDir,
> +                                             NULL, NULL, 0);

This seems a bit awkward...what if the file is included on the command line with -include? (Some of our tests do this.)

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.

> +        if (PH.Next(Line) && Line > 0)
> +          ExpectedLoc = SM.translateFileLineCol(FE, Line, 1);

This should probably be asserted or checked; it doesn't make sense to specify another file without a line number.

I'll look into the 79/80 issue too. Thanks for doing this!
Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130417/ae059c04/attachment.html>


More information about the cfe-commits mailing list