[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

llvm-svn: 343591
This commit is contained in:
Haojian Wu 2018-10-02 13:59:49 +00:00
parent 51be55d0ec
commit dea577191c
1 changed files with 1 additions and 1 deletions

View File

@ -1888,7 +1888,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
// 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) {