diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-02-02 02:07:01 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-02-02 02:07:01 +0000 |
commit | d0ed44812057f1adf0ebe38f3fab55973c4efaeb (patch) | |
tree | 03ec6b08d225a418cfa4f9347d4c78085511b3e6 /lib/Sema/Sema.cpp | |
parent | 61e8e1b84292e882553a47edec830a79606c78f4 (diff) |
Add a stop gap to Sema::CorrectTypo() to correct only up to 20 typos.
This is to address a serious performance problem observed when running
'clang -fsyntax-only' on really broken source files. In one case,
repeatedly calling CorrectTypo() caused one source file to be rejected
after 2 minutes instead of 1 second.
This patch causes typo correction to take neglible time on that file
while still providing correction results for the first 20 cases. I
felt this was a reasonable number for moderately broken source files.
I don't claim this is the best solution. Comments welcome. It is
necessary for us to address this issue because it is a serious
performance problem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95049 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index c0e7572cdd..903b987080 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -364,7 +364,7 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer, GlobalNewDeleteDeclared(false), CompleteTranslationUnit(CompleteTranslationUnit), NumSFINAEErrors(0), NonInstantiationEntries(0), - CurrentInstantiationScope(0) + CurrentInstantiationScope(0), TyposCorrected(0) { TUScope = 0; if (getLangOptions().CPlusPlus) |