<div dir="ltr"><div>This patch removes Sema::UnqualifiedTyposCorrected. </div><div><br></div><div>I'm not sure this is the right thing to do. As far as I can tell this cache can't be made to be correct (wouldn't we need to invalidate it every time a new decl is declared?) and I'm not convinced it saves us much compile time. However, I'm not confident in my understanding of the code, so please do push back if it is beneficial.</div><div><br></div><div>One bug it fixes is a case where the same full-expression has the two typos in the same identifier, and we emit the correction at the SourceRange for the first typo twice instead of once for each place it's misspelled. This is because the SourceRange is on the TypoCorrection, and the cache key is an IdentifierInfo. Adding the SourceRange to the cache key wouldn't make much sense because we wouldn't ever re-use it. (NB, I have similar feelings about TypoCorrectionFailures which I am not touching in this patch. Why would we do typo correction twice at the same location?)</div>
<div><br></div><div>Removing it improves typo correction quality and there are changes to the tests (see p11.cpp, and the last two tests in typo-correction) where it fired. Because the cutoff for typos is a function of this cache, I move that to a flag (-fspell-checking-limit=...) and turn the limit off entirely to merge typo-correction-pt2.cpp and typo-correction.cpp. Also turn it up from 20 to 50 to accommodate existing tests. Without caching, we run up the counter more quickly. <br></div><div><br></div><div>Please review!</div><div><br></div><div>Nick</div><div><br></div></div>