[PATCH] D51333: Diagnose likely typos in include statements

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 31 05:05:25 PDT 2018


aaron.ballman added a comment.

In https://reviews.llvm.org/D51333#1219938, @rsmith wrote:

> Instead of guessing whether the corrected filename would be valid, why not strip off the leading and trailing non-alphanumeric characters, look up the resulting filename, and find out? If we did that, then not only could we be a lot more confident that we'd found the file that was intended, but we could also recover from the error by including the trimmed filename.


I was contemplating that approach, but I was also a bit worried about reaching out to the filesystem again. We already reach out once for angled vs quoted include path issues, and I don't think these two tests can be combined easily. However, this is on an error path and so performance isn't super important, so I think I've convinced myself this is a good approach to try.


https://reviews.llvm.org/D51333





More information about the cfe-commits mailing list