[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL342177: Diagnose likely typos in #include directives. (authored by rsmith, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D51333?vs=165361&id=

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Christy Lee via Phabricator via cfe-commits
christylee updated this revision to Diff 165361. christylee added a comment. Added tests. https://reviews.llvm.org/D51333 Files: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/PPDirectives.cpp test/Preprocessor/empty_file_to_include.h test/Preprocessor/include-likely-typo.c Index:

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. The tests seem to have disappeared form the diff. https://reviews.llvm.org/D51333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Christy Lee via Phabricator via cfe-commits
christylee added a comment. @rsmith , thanks for the review, I fixed the variable capitalization. If you could land it for me that'll be awesome! In https://reviews.llvm.org/D51333#1233042, @sammccall wrote: > One thing I'd like to do sometime is add code completion of filenames in > #include

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Christy Lee via Phabricator via cfe-commits
christylee updated this revision to Diff 165350. https://reviews.llvm.org/D51333 Files: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/PPDirectives.cpp Index: lib/Lex/PPDirectives.cpp === --- lib/Lex/PPDirectives.cpp +++ lib

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Christy Lee via Phabricator via cfe-commits
christylee updated this revision to Diff 165349. https://reviews.llvm.org/D51333 Files: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/PPDirectives.cpp Index: lib/Lex/PPDirectives.cpp === --- lib/Lex/PPDirectives.cpp +++ lib

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. Where here, I would love to have a fixint hints for unknown functions. E.g. std::forward somewhere in code-> fixit: "try to add #include " https://reviews.llvm.org/D51333 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Looks good (with a couple of minor code style adjustments). Do you need someone to commit this for you? In https://reviews.llvm.org/D51333#1233042, @sammccall wrote: > One thing I'd like to d

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Christy Lee via Phabricator via cfe-commits
christylee updated this revision to Diff 165311. christylee added a comment. Addressed @rsmith 's comments. https://reviews.llvm.org/D51333 Files: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/PPDirectives.cpp Index: lib/Lex/PPDirectives.cpp ===

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Christy Lee via Phabricator via cfe-commits
christylee added inline comments. Comment at: lib/Lex/PPDirectives.cpp:1901 +FilenameLoc, +LangOpts.MSVCCompat ? NormalizedPath.c_str() : Filename, false, +LookupFrom, LookupFromFile, CurDir, rsmith wrote: > You're passing in `

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. (No action needed, but curious on your thoughts) One thing I'd like to do sometime is add code completion of filenames in #include directives. This would mean listing the relevant directories from the include path. (VFS is slow for this today, but I have a patch out f

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-12 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Thanks, some comments but the approach here looks great. Comment at: include/clang/Basic/DiagnosticLexKinds.td:428-429 +def err_pp_file_not_found_typo_not_fatal +: Error<"'%0' file not found due to leading or trailing non-alphanumeric " +

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-12 Thread Christy Lee via Phabricator via cfe-commits
christylee updated this revision to Diff 165162. christylee edited the summary of this revision. christylee added a comment. Emit non-fatal error for typo if file exists. https://reviews.llvm.org/D51333 Files: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/PPDirectives.cpp Index: lib/L

[PATCH] D51333: Diagnose likely typos in include statements

2018-08-31 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D51333#1220878, @christylee wrote: > 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,

[PATCH] D51333: Diagnose likely typos in include statements

2018-08-31 Thread Christy Lee via Phabricator via cfe-commits
christylee marked 2 inline comments as done. christylee 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 > result

[PATCH] D51333: Diagnose likely typos in include statements

2018-08-31 Thread Aaron Ballman via Phabricator via cfe-commits
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

[PATCH] D51333: Diagnose likely typos in include statements

2018-08-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. 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 fil

[PATCH] D51333: Diagnose likely typos in include statements

2018-08-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: rsmith. aaron.ballman added inline comments. Comment at: lib/Lex/PPDirectives.cpp:1876 + "\"" + Filename.str() + "\"") + << isFileNotFoundLikelyTypo; } I'd pass `fa

[PATCH] D51333: Diagnose likely typos in include statements

2018-08-29 Thread Christy Lee via Phabricator via cfe-commits
christylee updated this revision to Diff 163132. christylee edited the summary of this revision. christylee added a comment. Merged warning with existing file_not_found_error. https://reviews.llvm.org/D51333 Files: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/PPDirectives.cpp lib/Lex

[PATCH] D51333: Diagnose likely typos in include statements

2018-08-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/Basic/DiagnosticLexKinds.td:476 + ExtWarn<"likely typo, expected \"FILENAME\" or " + "but filename is '%0'">, InGroup; + This seems like the wrong warning group for this diagnostic as it doesn't r

[PATCH] D51333: Diagnose likely typos in include statements

2018-08-28 Thread Brian Gesiak via Phabricator via cfe-commits
modocache added subscribers: aaron.ballman, erikjv, modocache. modocache added reviewers: aaron.ballman, erikjv. modocache added a comment. This looks good to me, but maybe some people who've modified this part of the codebase before could review this as well? @aaron.ballman added a fix-it for a

[PATCH] D51333: Diagnose likely typos in include statements

2018-08-27 Thread Christy Lee via Phabricator via cfe-commits
christylee created this revision. Herald added a subscriber: cfe-commits. When someone writes #include "" or #include " some_file.h " the compiler returns "file not fond..." with fonts and quotes that may make it hard to see there are excess quotes or surprising bytes in the filename. Th