Clang: Workaround for clang bug to gather inclusions

We have to revert it if the fix is going in.

Change-Id: I28418e6c7cf6c40afdb5025eb1a52c13a0aa1302
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-09-01 10:23:45 +02:00
parent d041a79a18
commit 74e24084c8

View File

@@ -316,11 +316,16 @@ UnsavedFiles &TranslationUnit::unsavedFiles() const
void TranslationUnit::updateIncludeFilePaths() const
{
auto oldDependedFilePaths = d->dependedFilePaths;
d->dependedFilePaths.clear();
d->dependedFilePaths.insert(filePath());
clang_getInclusions(d->translationUnit, includeCallback, const_cast<TranslationUnit*>(this));
if (d->dependedFilePaths.size() == 1)
d->dependedFilePaths = oldDependedFilePaths;
d->translationUnits.addWatchedFiles(d->dependedFilePaths);
}