diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-04-17 11:53:55 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-05-17 12:46:37 +0000 |
commit | 319daa2612dcdd205e271cf2b4b5bf4532fad163 (patch) | |
tree | b67dcbf4424c1cc00475b0ead75b218fb66e2942 /src | |
parent | c49854f423af755191a375dc030157f929648ced (diff) |
Clang: Require LLVM/Clang >= 6.0.0
Adapt versions and tests, remove code assuming clang < 6.0.
Switch also to our custom repositories instead of dealing with patch
files.
LLVM/Clang 6 was released on 09 Mar 2018.
Task-number: QTCREATORBUG-18535
Task-number: QTCREATORBUG-18552
Change-Id: I0ec2c2f56265e161ae7cbb5b03e7b8a182ba6cc6
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/clang/clang_installation.pri | 8 | ||||
-rw-r--r-- | src/tools/clangbackend/source/clangtype.cpp | 3 | ||||
-rw-r--r-- | src/tools/clangbackend/source/sourcelocation.cpp | 3 |
3 files changed, 5 insertions, 9 deletions
diff --git a/src/shared/clang/clang_installation.pri b/src/shared/clang/clang_installation.pri index 34132a6b53..b9cc4c9704 100644 --- a/src/shared/clang/clang_installation.pri +++ b/src/shared/clang/clang_installation.pri @@ -101,10 +101,10 @@ isEmpty(LLVM_VERSION) { $$llvmWarningOrError(\ "Cannot determine clang version. Set LLVM_INSTALL_DIR to build the Clang Code Model",\ "LLVM_INSTALL_DIR does not contain a valid llvm-config, candidate: $$llvm_config") -} else:!versionIsAtLeast($$LLVM_VERSION, 5, 0, 0): { +} else:!versionIsAtLeast($$LLVM_VERSION, 6, 0, 0): { # CLANG-UPGRADE-CHECK: Adapt minimum version numbers. $$llvmWarningOrError(\ - "LLVM/Clang version >= 5.0.0 required, version provided: $$LLVM_VERSION") + "LLVM/Clang version >= 6.0.0 required, version provided: $$LLVM_VERSION") LLVM_VERSION = } else { LLVM_LIBDIR = $$quote($$system($$llvm_config --libdir, lines)) @@ -141,11 +141,11 @@ isEmpty(LLVM_VERSION) { QTC_NO_CLANG_LIBTOOLING=$$(QTC_NO_CLANG_LIBTOOLING) isEmpty(QTC_NO_CLANG_LIBTOOLING) { QTC_FORCE_CLANG_LIBTOOLING = $$(QTC_FORCE_CLANG_LIBTOOLING) - versionIsEqual($$LLVM_VERSION, 5, 0)|!isEmpty(QTC_FORCE_CLANG_LIBTOOLING) { + versionIsEqual($$LLVM_VERSION, 6, 0)|!isEmpty(QTC_FORCE_CLANG_LIBTOOLING) { !contains(QMAKE_DEFAULT_LIBDIRS, $$LLVM_LIBDIR): LIBTOOLING_LIBS = -L$${LLVM_LIBDIR} LIBTOOLING_LIBS += $$CLANGTOOLING_LIBS $$LLVM_STATIC_LIBS } else { - warning("Clang LibTooling is disabled because only version 5.0 is supported.") + warning("Clang LibTooling is disabled because only version 6.0 is supported.") } } else { warning("Clang LibTooling is disabled.") diff --git a/src/tools/clangbackend/source/clangtype.cpp b/src/tools/clangbackend/source/clangtype.cpp index faa97a437e..633df3e596 100644 --- a/src/tools/clangbackend/source/clangtype.cpp +++ b/src/tools/clangbackend/source/clangtype.cpp @@ -163,8 +163,7 @@ static const char *builtinTypeToText(CXTypeKind kind) // https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html case CXType_Float128: return "__float128"; - // CLANG-UPGRADE-CHECK: CXType_Float16 available with >= clang-6.0: -// case CXType_Float16: return "_Float16"; + case CXType_Float16: return "_Float16"; // https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/scalarDataTypes.html case CXType_Half: diff --git a/src/tools/clangbackend/source/sourcelocation.cpp b/src/tools/clangbackend/source/sourcelocation.cpp index 2450dcf590..7fbe8c03eb 100644 --- a/src/tools/clangbackend/source/sourcelocation.cpp +++ b/src/tools/clangbackend/source/sourcelocation.cpp @@ -93,8 +93,6 @@ SourceLocation::SourceLocation(CXTranslationUnit cxTranslationUnit, return; filePath_ = ClangString(clang_getFileName(cxFile)); -// CLANG-UPGRADE-CHECK: Remove HAS_GETFILECONTENTS_BACKPORTED check once we require clang >= 7.0 -#if defined(CINDEX_VERSION_HAS_GETFILECONTENTS_BACKPORTED) || CINDEX_VERSION_MINOR >= 47 if (column_ > 1) { const uint lineStart = offset_ + 1 - column_; const char *contents = clang_getFileContents(cxTranslationUnit, cxFile, nullptr); @@ -106,7 +104,6 @@ SourceLocation::SourceLocation(CXTranslationUnit cxTranslationUnit, column_ = static_cast<uint>(QString::fromUtf8(&contents[lineStart], static_cast<int>(column_)).size()); } -#endif } SourceLocation::SourceLocation(CXTranslationUnit cxTranslationUnit, |