Clang: Avoid parse loop if libclang crashed or file vanished

Remember whether clang_parseTranslationUnit() or
clang_reparseTranslationUnit() failed the last time and do not trigger
parse/reparse again.

Also, check whether the main file exists before reparsing.

Task-number: QTCREATORBUG-16051
Task-number: QTCREATORBUG-16140
Change-Id: Ied39e66a18032854911229898573941fe2ada35b
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
This commit is contained in:
Nikolai Kosjar
2016-04-22 15:31:49 +02:00
parent 66e9cb0a54
commit 7b7b1823cb
9 changed files with 251 additions and 27 deletions

View File

@@ -12,6 +12,7 @@ HEADERS += $$PWD/clangipcserver.h \
$$PWD/projects.h \
$$PWD/translationunits.h \
$$PWD/translationunitparseerrorexception.h \
$$PWD/translationunitreparseerrorexception.h \
$$PWD/projectpart.h \
$$PWD/translationunitfilenotexitexception.h \
$$PWD/translationunitdoesnotexistexception.h \
@@ -46,6 +47,7 @@ SOURCES += $$PWD/clangipcserver.cpp \
$$PWD/projects.cpp \
$$PWD/translationunits.cpp \
$$PWD/translationunitparseerrorexception.cpp \
$$PWD/translationunitreparseerrorexception.cpp \
$$PWD/projectpart.cpp \
$$PWD/translationunitfilenotexitexception.cpp \
$$PWD/translationunitdoesnotexistexception.cpp \