Clang: Ensure using correct translation unit flags for clang >= 7.0

...otherwise things will get slower.

Change-Id: Ifc01c31a2bb50a277a38ede5dbe58583d15010f5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-06-13 10:05:39 +02:00
parent bcd1158b33
commit 92230d57d6
2 changed files with 7 additions and 1 deletions

View File

@@ -46,4 +46,9 @@ enum class PreferredTranslationUnit
# define IS_INVALIDDECL_SUPPORTED # define IS_INVALIDDECL_SUPPORTED
#endif #endif
// CLANG-UPGRADE-CHECK: Remove IS_LIMITSKIPFUNCTIONBODIESTOPREAMBLE_SUPPORTED once we require clang >= 7.0
#if defined(CINDEX_VERSION_HAS_LIMITSKIPFUNCTIONBODIESTOPREAMBLE_BACKPORTED) || CINDEX_VERSION_MINOR >= 46
# define IS_LIMITSKIPFUNCTIONBODIESTOPREAMBLE_SUPPORTED
#endif
} // namespace ClangBackEnd } // namespace ClangBackEnd

View File

@@ -25,6 +25,7 @@
#include "clangtranslationunitupdater.h" #include "clangtranslationunitupdater.h"
#include "clangbackend_global.h"
#include "clangfilepath.h" #include "clangfilepath.h"
#include "clangstring.h" #include "clangstring.h"
#include "clangunsavedfilesshallowarguments.h" #include "clangunsavedfilesshallowarguments.h"
@@ -176,7 +177,7 @@ uint TranslationUnitUpdater::defaultParseOptions()
return CXTranslationUnit_CacheCompletionResults return CXTranslationUnit_CacheCompletionResults
| CXTranslationUnit_PrecompiledPreamble | CXTranslationUnit_PrecompiledPreamble
| CXTranslationUnit_CreatePreambleOnFirstParse | CXTranslationUnit_CreatePreambleOnFirstParse
#ifdef CINDEX_VERSION_HAS_LIMITSKIPFUNCTIONBODIESTOPREAMBLE_BACKPORTED #ifdef IS_LIMITSKIPFUNCTIONBODIESTOPREAMBLE_SUPPORTED
| CXTranslationUnit_SkipFunctionBodies | CXTranslationUnit_SkipFunctionBodies
| CXTranslationUnit_LimitSkipFunctionBodiesToPreamble | CXTranslationUnit_LimitSkipFunctionBodiesToPreamble
#endif #endif