Author: hokein Date: Tue Oct 2 06:59:49 2018 New Revision: 343591 URL: http://llvm.org/viewvc/llvm-project?rev=343591&view=rev Log: [Preprocessor] Hide include typo correction behind SpellChecking.
Summary: Similar to Sema typo correction, the Preprocessor typo correction should also be hidden behind the SpellChecking flag. Reviewers: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52778 Modified: cfe/trunk/lib/Lex/PPDirectives.cpp Modified: cfe/trunk/lib/Lex/PPDirectives.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=343591&r1=343590&r2=343591&view=diff ============================================================================== --- cfe/trunk/lib/Lex/PPDirectives.cpp (original) +++ cfe/trunk/lib/Lex/PPDirectives.cpp Tue Oct 2 06:59:49 2018 @@ -1888,7 +1888,7 @@ void Preprocessor::HandleIncludeDirectiv // Check for likely typos due to leading or trailing non-isAlphanumeric // characters StringRef OriginalFilename = Filename; - if (!File) { + if (LangOpts.SpellChecking && !File) { // A heuristic to correct a typo file name by removing leading and // trailing non-isAlphanumeric characters. auto CorrectTypoFilename = [](llvm::StringRef Filename) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits