Changeset View
Changeset View
Standalone View
Standalone View
languages/clang/duchain/clangindex.cpp
Show All 32 Lines | |||||
33 | #include <clang-c/Index.h> | 33 | #include <clang-c/Index.h> | ||
34 | 34 | | |||
35 | using namespace KDevelop; | 35 | using namespace KDevelop; | ||
36 | 36 | | |||
37 | ClangIndex::ClangIndex() | 37 | ClangIndex::ClangIndex() | ||
38 | // NOTE: We don't exclude PCH declarations. That way we could retrieve imports manually, as clang_getInclusions returns nothing on reparse with CXTranslationUnit_PrecompiledPreamble flag. | 38 | // NOTE: We don't exclude PCH declarations. That way we could retrieve imports manually, as clang_getInclusions returns nothing on reparse with CXTranslationUnit_PrecompiledPreamble flag. | ||
39 | : m_index(clang_createIndex(0 /*Exclude PCH Decls*/, qEnvironmentVariableIsSet("KDEV_CLANG_DISPLAY_DIAGS") /*Display diags*/)) | 39 | : m_index(clang_createIndex(0 /*Exclude PCH Decls*/, qEnvironmentVariableIsSet("KDEV_CLANG_DISPLAY_DIAGS") /*Display diags*/)) | ||
40 | { | 40 | { | ||
41 | // demote the priority of the clang parse threads to reduce potential UI lockups | ||||
42 | // but the code completion threads still retain their normal priority to return | ||||
43 | // the results as quickly as possible | ||||
44 | clang_CXIndex_setGlobalOptions(m_index, clang_CXIndex_getGlobalOptions(m_index) | ||||
45 | | CXGlobalOpt_ThreadBackgroundPriorityForIndexing); | ||||
41 | } | 46 | } | ||
42 | 47 | | |||
43 | CXIndex ClangIndex::index() const | 48 | CXIndex ClangIndex::index() const | ||
44 | { | 49 | { | ||
45 | return m_index; | 50 | return m_index; | ||
46 | } | 51 | } | ||
47 | 52 | | |||
48 | QSharedPointer<const ClangPCH> ClangIndex::pch(const ClangParsingEnvironment& environment) | 53 | QSharedPointer<const ClangPCH> ClangIndex::pch(const ClangParsingEnvironment& environment) | ||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |