Clang: Fix some issues with running indexer over Qt Creator

- fix qDebug channels on Windows
 - fix the number of perameters in the sql statement
 - fix nullptr access
 - speed up preprocessor a little bit

Change-Id: Ic9b32fbcc6b409c4064c4f522b94391cbff8654e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2019-01-30 09:07:45 +01:00
parent f369556dca
commit 7d64c9e3ec
12 changed files with 57 additions and 33 deletions

View File

@@ -95,8 +95,6 @@ public:
bool isClean() const;
private:
RefactoringCompilationDatabase m_compilationDatabase;
std::vector<FileContent> m_fileContents;

View File

@@ -341,12 +341,14 @@ public:
m_database};
mutable ReadStatement m_getProjectPartArtefactsBySourceId{
"SELECT toolChainArguments, compilerMacros, systemIncludeSearchPaths, "
"projectIncludeSearchPaths, projectPartId FROM projectParts WHERE projectPartId = (SELECT "
"projectIncludeSearchPaths, projectPartId, language, languageVersion, languageExtension "
"FROM projectParts WHERE projectPartId = (SELECT "
"projectPartId FROM projectPartsSources WHERE sourceId = ?)",
m_database};
mutable ReadStatement m_getProjectPartArtefactsByProjectPartName{
"SELECT toolChainArguments, compilerMacros, systemIncludeSearchPaths, "
"projectIncludeSearchPaths, projectPartId FROM projectParts WHERE projectPartName = ?",
"projectIncludeSearchPaths, projectPartId, language, languageVersion, languageExtension "
"FROM projectParts WHERE projectPartName = ?",
m_database};
mutable ReadStatement m_getPrecompiledHeader{
"SELECT projectPchPath, projectPchBuildTime FROM precompiledHeaders WHERE projectPartId = ?",

View File

@@ -68,7 +68,8 @@ public:
bool isAlreadyParsed(clang::FileID fileId)
{
const clang::FileEntry *fileEntry = m_sourceManager->getFileEntryForID(fileId);
if (!fileEntry)
return false;
return m_sourcesManager.alreadyParsed(filePathId(fileEntry),
fileEntry->getModificationTime());
}