forked from qt-creator/qt-creator
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:
@@ -91,6 +91,8 @@ public:
|
||||
void reset();
|
||||
void reparse() const;
|
||||
|
||||
bool isIntact() const;
|
||||
|
||||
CXIndex index() const;
|
||||
CXTranslationUnit cxTranslationUnit() const;
|
||||
CXTranslationUnit cxTranslationUnitWithoutReparsing() const;
|
||||
@@ -150,10 +152,14 @@ private:
|
||||
bool projectPartIsOutdated() const;
|
||||
bool isMainFileAndExistsOrIsOtherFile(const Utf8String &filePath) const;
|
||||
void createTranslationUnitIfNeeded() const;
|
||||
void checkTranslationUnitErrorCode(CXErrorCode errorCode) const;
|
||||
void checkParseErrorCode() const;
|
||||
void checkReparseErrorCode() const;
|
||||
void reparseTranslationUnit() const;
|
||||
void reparseTranslationUnitIfFilesAreChanged() const;
|
||||
bool parseWasSuccessful() const;
|
||||
bool reparseWasSuccessful() const;
|
||||
void updateIncludeFilePaths() const;
|
||||
bool fileExists() const;
|
||||
static void includeCallback(CXFile included_file,
|
||||
CXSourceLocation * /*inclusion_stack*/,
|
||||
unsigned /*include_len*/,
|
||||
|
||||
Reference in New Issue
Block a user