[PATCH] D52778: [Preprocessor] Hide include typo correction behind SpellChecking.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 06:42:05 PDT 2018


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/Lex/PPDirectives.cpp:1891
       StringRef OriginalFilename = Filename;
-      if (!File) {
-        // A heuristic to correct a typo file name by removing leading and
-        // trailing non-isAlphanumeric characters.
-        auto CorrectTypoFilename = [](llvm::StringRef Filename) {
-          Filename = Filename.drop_until(isAlphanumeric);
-          while (!Filename.empty() && !isAlphanumeric(Filename.back())) {
-            Filename = Filename.drop_back();
+      if (LangOpts.SpellChecking) {
+        if (!File) {
----------------
(just merge with existing if statement?)


Repository:
  rC Clang

https://reviews.llvm.org/D52778





More information about the cfe-commits mailing list