summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-01-06 00:23:04 +0000
committerTed Kremenek <kremenek@apple.com>2010-01-06 00:23:04 +0000
commite51136ee05aa613a09aa43d5852aabebb019696e (patch)
tree597abc9bd6c996687a9d1143e161ee5cef828f57 /clang/lib
parent1a5f292fbfcae4b6ddd6ba3fb3b03d068845c70e (diff)
downloadbcm5719-llvm-e51136ee05aa613a09aa43d5852aabebb019696e.tar.gz
bcm5719-llvm-e51136ee05aa613a09aa43d5852aabebb019696e.zip
Per offline discussion with Doug, don't perform typo correction when we have encountered a fatal error. On some files that are woefully wrong (missing headers) this can cause a 3x slowdown in some cases when parsing the file. It makes sense not to perform typo correction in this case because after a fatal error diagnostics will either be suppressed or not really make any sense.
llvm-svn: 92809
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 1f2943cb1f2..9ed15225b49 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -2199,6 +2199,10 @@ void TypoCorrectionConsumer::FoundDecl(NamedDecl *ND, NamedDecl *Hiding) {
bool Sema::CorrectTypo(LookupResult &Res, Scope *S, const CXXScopeSpec *SS,
DeclContext *MemberContext, bool EnteringContext,
const ObjCObjectPointerType *OPT) {
+
+ if (Diags.hasFatalErrorOccurred())
+ return false;
+
// We only attempt to correct typos for identifiers.
IdentifierInfo *Typo = Res.getLookupName().getAsIdentifierInfo();
if (!Typo)
OpenPOWER on IntegriCloud