diff options
-rw-r--r-- | llvm10.patch | 274 | ||||
-rw-r--r-- | qt-creator.spec | 12 |
2 files changed, 282 insertions, 4 deletions
diff --git a/llvm10.patch b/llvm10.patch new file mode 100644 index 0000000..858a4b8 --- /dev/null +++ b/llvm10.patch @@ -0,0 +1,274 @@ +From 44023c8f43fd8daf8b7be305ea6d99b8b56fa551 Mon Sep 17 00:00:00 2001 +From: Orgad Shaneh <orgad.shaneh@audiocodes.com> +Date: Mon, 17 Feb 2020 23:21:17 +0200 +Subject: [PATCH] Clang: Fix build with Clang/LLVM 10 + +Change-Id: I740286c9dcfd325b1c31ab863fb5c91bf9c6ec70 +Reviewed-by: hjk <hjk@qt.io> +--- + src/plugins/clangformat/clangformatutils.cpp | 8 ++++++ + .../source/collectbuilddependencytoolaction.h | 17 ++++++++++- + .../source/collectusedmacroactionfactory.h | 12 ++++++++ + .../source/generatepchactionfactory.h | 7 +++++ + .../source/clangquery.cpp | 3 +- + .../source/collectsymbolsaction.h | 6 +++- + .../source/indexdataconsumer.cpp | 28 +++++++++++++------ + .../source/indexdataconsumer.h | 28 +++++++++++++------ + .../source/symbolscollector.cpp | 4 +++ + 9 files changed, 92 insertions(+), 21 deletions(-) + +diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp +index f087f77a948..0a32d3a9297 100644 +--- a/src/plugins/clangformat/clangformatutils.cpp ++++ b/src/plugins/clangformat/clangformatutils.cpp +@@ -57,7 +57,11 @@ static clang::format::FormatStyle qtcStyle() + style.AlignOperands = true; + style.AlignTrailingComments = true; + style.AllowAllParametersOfDeclarationOnNextLine = true; ++#if LLVM_VERSION_MAJOR >= 10 ++ style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never; ++#else + style.AllowShortBlocksOnASingleLine = false; ++#endif + style.AllowShortCaseLabelsOnASingleLine = false; + style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; + #if LLVM_VERSION_MAJOR >= 9 +@@ -72,7 +76,11 @@ static clang::format::FormatStyle qtcStyle() + style.BinPackArguments = false; + style.BinPackParameters = false; + style.BraceWrapping.AfterClass = true; ++#if LLVM_VERSION_MAJOR >= 10 ++ style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never; ++#else + style.BraceWrapping.AfterControlStatement = false; ++#endif + style.BraceWrapping.AfterEnum = false; + style.BraceWrapping.AfterFunction = true; + style.BraceWrapping.AfterNamespace = false; +diff --git a/src/tools/clangpchmanagerbackend/source/collectbuilddependencytoolaction.h b/src/tools/clangpchmanagerbackend/source/collectbuilddependencytoolaction.h +index 538f2c7d3fa..88ed3d23448 100644 +--- a/src/tools/clangpchmanagerbackend/source/collectbuilddependencytoolaction.h ++++ b/src/tools/clangpchmanagerbackend/source/collectbuilddependencytoolaction.h +@@ -60,6 +60,16 @@ class CollectBuildDependencyToolAction final : public clang::tooling::FrontendAc + diagnosticConsumer); + } + ++#if LLVM_VERSION_MAJOR >= 10 ++ std::unique_ptr<clang::FrontendAction> create() override ++ { ++ return std::make_unique<CollectBuildDependencyAction>( ++ m_buildDependency, ++ m_filePathCache, ++ m_excludedIncludeUIDs, ++ m_alreadyIncludedFileUIDs); ++ } ++#else + clang::FrontendAction *create() override + { + return new CollectBuildDependencyAction(m_buildDependency, +@@ -67,6 +77,7 @@ class CollectBuildDependencyToolAction final : public clang::tooling::FrontendAc + m_excludedIncludeUIDs, + m_alreadyIncludedFileUIDs); + } ++#endif + + std::vector<uint> generateExcludedIncludeFileUIDs(clang::FileManager &fileManager) const + { +@@ -77,7 +88,11 @@ class CollectBuildDependencyToolAction final : public clang::tooling::FrontendAc + NativeFilePath nativeFilePath{filePath}; + const clang::FileEntry *file = fileManager.getFile({nativeFilePath.path().data(), + nativeFilePath.path().size()}, +- true); ++ true) ++#if LLVM_VERSION_MAJOR >= 10 ++ .get() ++#endif ++ ; + + if (file) + fileUIDs.push_back(file->getUID()); +diff --git a/src/tools/clangpchmanagerbackend/source/collectusedmacroactionfactory.h b/src/tools/clangpchmanagerbackend/source/collectusedmacroactionfactory.h +index 423d5f88764..473b8e7df8a 100644 +--- a/src/tools/clangpchmanagerbackend/source/collectusedmacroactionfactory.h ++++ b/src/tools/clangpchmanagerbackend/source/collectusedmacroactionfactory.h +@@ -61,6 +61,17 @@ class CollectUsedMacrosToolActionFactory final : public clang::tooling::Frontend + diagnosticConsumer); + } + ++#if LLVM_VERSION_MAJOR >= 10 ++ std::unique_ptr<clang::FrontendAction> create() override ++ { ++ return std::make_unique<CollectUsedMacrosAction>( ++ m_usedMacros, ++ m_filePathCache, ++ m_sourceDependencies, ++ m_sourceFiles, ++ m_fileStatuses); ++ } ++#else + clang::FrontendAction *create() override + { + return new CollectUsedMacrosAction(m_usedMacros, +@@ -69,6 +80,7 @@ class CollectUsedMacrosToolActionFactory final : public clang::tooling::Frontend + m_sourceFiles, + m_fileStatuses); + } ++#endif + + private: + UsedMacros &m_usedMacros; +diff --git a/src/tools/clangpchmanagerbackend/source/generatepchactionfactory.h b/src/tools/clangpchmanagerbackend/source/generatepchactionfactory.h +index c4a8cae0286..f1e4c74457e 100644 +--- a/src/tools/clangpchmanagerbackend/source/generatepchactionfactory.h ++++ b/src/tools/clangpchmanagerbackend/source/generatepchactionfactory.h +@@ -68,10 +68,17 @@ class GeneratePCHActionFactory final : public clang::tooling::FrontendActionFact + , m_fileContent(fileContent) + {} + ++#if LLVM_VERSION_MAJOR >= 10 ++ std::unique_ptr<clang::FrontendAction> create() override ++ { ++ return std::make_unique<GeneratePCHAction>(m_filePath, m_fileContent); ++ } ++#else + clang::FrontendAction *create() override + { + return new GeneratePCHAction{m_filePath, m_fileContent}; + } ++#endif + + private: + llvm::StringRef m_filePath; +diff --git a/src/tools/clangrefactoringbackend/source/clangquery.cpp b/src/tools/clangrefactoringbackend/source/clangquery.cpp +index 21ebeb83674..78f2350d8de 100644 +--- a/src/tools/clangrefactoringbackend/source/clangquery.cpp ++++ b/src/tools/clangrefactoringbackend/source/clangquery.cpp +@@ -78,7 +78,8 @@ void ClangQuery::findLocations() + std::make_move_iterator(asts.end()), + [&] (std::unique_ptr<clang::ASTUnit> &&ast) { + Diagnostics diagnostics; +- auto optionalMatcher = Parser::parseMatcherExpression({m_query.data(), m_query.size()}, ++ llvm::StringRef query{m_query.data(), m_query.size()}; ++ auto optionalMatcher = Parser::parseMatcherExpression(query, + nullptr, + &diagnostics); + parseDiagnostics(diagnostics); +diff --git a/src/tools/clangrefactoringbackend/source/collectsymbolsaction.h b/src/tools/clangrefactoringbackend/source/collectsymbolsaction.h +index a38f1c4f879..4f36adadf5f 100644 +--- a/src/tools/clangrefactoringbackend/source/collectsymbolsaction.h ++++ b/src/tools/clangrefactoringbackend/source/collectsymbolsaction.h +@@ -48,7 +48,11 @@ class CollectSymbolsAction : public clang::WrapperFrontendAction + public: + CollectSymbolsAction(std::shared_ptr<IndexDataConsumer> indexDataConsumer) + : clang::WrapperFrontendAction( +- clang::index::createIndexingAction(indexDataConsumer, createIndexingOptions(), nullptr)) ++ clang::index::createIndexingAction(indexDataConsumer, createIndexingOptions() ++#if LLVM_VERSION_MAJOR < 10 ++ , nullptr ++#endif ++ )) + , m_indexDataConsumer(indexDataConsumer) + {} + +diff --git a/src/tools/clangrefactoringbackend/source/indexdataconsumer.cpp b/src/tools/clangrefactoringbackend/source/indexdataconsumer.cpp +index e2871444625..5d21b30b9c2 100644 +--- a/src/tools/clangrefactoringbackend/source/indexdataconsumer.cpp ++++ b/src/tools/clangrefactoringbackend/source/indexdataconsumer.cpp +@@ -118,11 +118,16 @@ bool IndexDataConsumer::isAlreadyParsed(clang::FileID fileId, SourcesManager &so + return sourcesManager.alreadyParsed(filePathId(fileEntry), fileEntry->getModificationTime()); + } + +-bool IndexDataConsumer::handleDeclOccurence(const clang::Decl *declaration, +- clang::index::SymbolRoleSet symbolRoles, +- llvm::ArrayRef<clang::index::SymbolRelation> /*symbolRelations*/, +- clang::SourceLocation sourceLocation, +- IndexDataConsumer::ASTNodeInfo /*astNodeInfo*/) ++#if LLVM_VERSION_MAJOR >= 10 ++ bool IndexDataConsumer::handleDeclOccurrence( ++#else ++ bool IndexDataConsumer::handleDeclOccurence( ++#endif ++ const clang::Decl *declaration, ++ clang::index::SymbolRoleSet symbolRoles, ++ llvm::ArrayRef<clang::index::SymbolRelation> /*symbolRelations*/, ++ clang::SourceLocation sourceLocation, ++ IndexDataConsumer::ASTNodeInfo /*astNodeInfo*/) + { + const auto *namedDeclaration = clang::dyn_cast<clang::NamedDecl>(declaration); + if (namedDeclaration) { +@@ -175,10 +180,15 @@ SourceLocationKind macroSymbolType(clang::index::SymbolRoleSet roles) + + } // namespace + +-bool IndexDataConsumer::handleMacroOccurence(const clang::IdentifierInfo *identifierInfo, +- const clang::MacroInfo *macroInfo, +- clang::index::SymbolRoleSet roles, +- clang::SourceLocation sourceLocation) ++#if LLVM_VERSION_MAJOR >= 10 ++bool IndexDataConsumer::handleMacroOccurrence( ++#else ++bool IndexDataConsumer::handleMacroOccurence( ++#endif ++ const clang::IdentifierInfo *identifierInfo, ++ const clang::MacroInfo *macroInfo, ++ clang::index::SymbolRoleSet roles, ++ clang::SourceLocation sourceLocation) + { + if (macroInfo && sourceLocation.isFileID() + && !isAlreadyParsed(m_sourceManager->getFileID(sourceLocation), m_macroSourcesManager) +diff --git a/src/tools/clangrefactoringbackend/source/indexdataconsumer.h b/src/tools/clangrefactoringbackend/source/indexdataconsumer.h +index c80e066b6c1..e1d3529806e 100644 +--- a/src/tools/clangrefactoringbackend/source/indexdataconsumer.h ++++ b/src/tools/clangrefactoringbackend/source/indexdataconsumer.h +@@ -57,16 +57,26 @@ class IndexDataConsumer : public clang::index::IndexDataConsumer, + IndexDataConsumer(const IndexDataConsumer &) = delete; + IndexDataConsumer &operator=(const IndexDataConsumer &) = delete; + +- bool handleDeclOccurence(const clang::Decl *declaration, +- clang::index::SymbolRoleSet symbolRoles, +- llvm::ArrayRef<clang::index::SymbolRelation> symbolRelations, +- clang::SourceLocation sourceLocation, +- ASTNodeInfo astNodeInfo) override; ++#if LLVM_VERSION_MAJOR >= 10 ++ bool handleDeclOccurrence( ++#else ++ bool handleDeclOccurence( ++#endif ++ const clang::Decl *declaration, ++ clang::index::SymbolRoleSet symbolRoles, ++ llvm::ArrayRef<clang::index::SymbolRelation> symbolRelations, ++ clang::SourceLocation sourceLocation, ++ ASTNodeInfo astNodeInfo) override; + +- bool handleMacroOccurence(const clang::IdentifierInfo *identifierInfo, +- const clang::MacroInfo *macroInfo, +- clang::index::SymbolRoleSet roles, +- clang::SourceLocation sourceLocation) override; ++#if LLVM_VERSION_MAJOR >= 10 ++ bool handleMacroOccurrence( ++#else ++ bool handleMacroOccurence( ++#endif ++ const clang::IdentifierInfo *identifierInfo, ++ const clang::MacroInfo *macroInfo, ++ clang::index::SymbolRoleSet roles, ++ clang::SourceLocation sourceLocation) override; + + void finish() override; + +diff --git a/src/tools/clangrefactoringbackend/source/symbolscollector.cpp b/src/tools/clangrefactoringbackend/source/symbolscollector.cpp +index a233f6d8fe5..dffd5838944 100644 +--- a/src/tools/clangrefactoringbackend/source/symbolscollector.cpp ++++ b/src/tools/clangrefactoringbackend/source/symbolscollector.cpp +@@ -74,7 +74,11 @@ std::unique_ptr<clang::tooling::FrontendActionFactory> newFrontendActionFactory( + : m_action(consumerFactory) + {} + ++#if LLVM_VERSION_MAJOR >= 10 ++ std::unique_ptr<clang::FrontendAction> create() override { return std::make_unique<AdaptorAction>(m_action); } ++#else + clang::FrontendAction *create() override { return new AdaptorAction(m_action); } ++#endif + + private: + class AdaptorAction : public clang::ASTFrontendAction diff --git a/qt-creator.spec b/qt-creator.spec index 7833220..de44330 100644 --- a/qt-creator.spec +++ b/qt-creator.spec @@ -1,13 +1,14 @@ Summary: An IDE tailored to the needs of Qt developers Summary(pl.UTF-8): IDE dostosowane do potrzeb developerow Qt Name: qt-creator -Version: 4.10.2 -Release: 4 +Version: 4.11.2 +Release: 1 Epoch: 1 License: LGPL v2.1 Group: X11/Development/Tools -Source0: http://download.qt.io/official_releases/qtcreator/4.10/%{version}/%{name}-opensource-src-%{version}.tar.xz -# Source0-md5: 9840630aeedfd1d403fabcf42edd1e53 +Source0: http://download.qt.io/official_releases/qtcreator/4.11/%{version}/%{name}-opensource-src-%{version}.tar.xz +# Source0-md5: 91a1e74b75dadfc336bb76d2bde7c270 +Patch0: llvm10.patch URL: http://doc.qt.io/qt-5/topics-app-development.html BuildRequires: Qt5Concurrent-devel >= 5.9.0 BuildRequires: Qt5Designer-devel >= 5.9.0 @@ -52,6 +53,7 @@ Qt. %prep %setup -q -n %{name}-opensource-src-%{version} +%patch0 -p1 # fix unresolved symbols in libQtcSsh echo >> src/libs/ssh/ssh_dependencies.pri @@ -136,6 +138,8 @@ rm -rf $RPM_BUILD_ROOT %dir %{_libdir}/qtcreator/plugins/qbs %dir %{_libdir}/qtcreator/plugins/qbs/plugins %attr(755,root,root) %{_libdir}/qtcreator/plugins/qbs/plugins/libclangcompilationdbgenerator.so +%attr(755,root,root) %{_libdir}/qtcreator/plugins/qbs/plugins/libiarewgenerator.so +%attr(755,root,root) %{_libdir}/qtcreator/plugins/qbs/plugins/libkeiluvgenerator.so %attr(755,root,root) %{_libdir}/qtcreator/plugins/qbs/plugins/libmakefilegenerator.so %attr(755,root,root) %{_libdir}/qtcreator/plugins/qbs/plugins/libqbs_cpp_scanner.so %attr(755,root,root) %{_libdir}/qtcreator/plugins/qbs/plugins/libqbs_qt_scanner.so |