diff --git a/codechecker-llvm8.patch b/codechecker-llvm8.patch deleted file mode 100644 index 5f2618b861e..00000000000 --- a/codechecker-llvm8.patch +++ /dev/null @@ -1,213 +0,0 @@ -diff --git a/ClangTidy.h b/ClangTidy.h -index 0ea9a70..dc11200 100644 ---- a/ClangTidy.h -+++ b/ClangTidy.h -@@ -230,12 +230,13 @@ getCheckOptions(const ClangTidyOptions &Options, - /// \param StoreCheckProfile If provided, and EnableCheckProfile is true, - /// the profile will not be output to stderr, but will instead be stored - /// as a JSON file in the specified directory. --void runClangTidy(clang::tidy::ClangTidyContext &Context, -- const tooling::CompilationDatabase &Compilations, -- ArrayRef InputFiles, -- llvm::IntrusiveRefCntPtr BaseFS, -- bool EnableCheckProfile = false, -- llvm::StringRef StoreCheckProfile = StringRef()); -+std::vector -+runClangTidy(clang::tidy::ClangTidyContext &Context, -+ const tooling::CompilationDatabase &Compilations, -+ ArrayRef InputFiles, -+ llvm::IntrusiveRefCntPtr BaseFS, -+ bool EnableCheckProfile = false, -+ llvm::StringRef StoreCheckProfile = StringRef()); - - // FIXME: This interface will need to be significantly extended to be useful. - // FIXME: Implement confidence levels for displaying/fixing errors. -@@ -243,9 +244,10 @@ void runClangTidy(clang::tidy::ClangTidyContext &Context, - /// \brief Displays the found \p Errors to the users. If \p Fix is true, \p - /// Errors containing fixes are automatically applied and reformatted. If no - /// clang-format configuration file is found, the given \P FormatStyle is used. --void handleErrors(ClangTidyContext &Context, bool Fix, -+void handleErrors(llvm::ArrayRef Errors, -+ ClangTidyContext &Context, bool Fix, - unsigned &WarningsAsErrorsCount, -- llvm::IntrusiveRefCntPtr BaseFS); -+ llvm::IntrusiveRefCntPtr BaseFS); - - /// \brief Serializes replacements into YAML and writes them to the specified - /// output stream. -diff --git a/ClangTidyDiagnosticConsumer.h b/ClangTidyDiagnosticConsumer.h -index ae25013..a868203 100644 ---- a/ClangTidyDiagnosticConsumer.h -+++ b/ClangTidyDiagnosticConsumer.h -@@ -102,6 +102,12 @@ public: - /// \brief Initializes \c ClangTidyContext instance. - ClangTidyContext(std::unique_ptr OptionsProvider, - bool AllowEnablingAnalyzerAlphaCheckers = false); -+ /// Sets the DiagnosticsEngine that diag() will emit diagnostics to. -+ // FIXME: this is required initialization, and should be a constructor param. -+ // Fix the context -> diag engine -> consumer -> context initialization cycle. -+ void setDiagnosticsEngine(DiagnosticsEngine *DiagEngine) { -+ this->DiagEngine = DiagEngine; -+ } - - ~ClangTidyContext(); - -@@ -160,12 +166,6 @@ public: - /// counters. - const ClangTidyStats &getStats() const { return Stats; } - -- /// \brief Returns all collected errors. -- ArrayRef getErrors() const { return Errors; } -- -- /// \brief Clears collected errors. -- void clearErrors() { Errors.clear(); } -- - /// \brief Control profile collection in clang-tidy. - void setEnableProfiling(bool Profile); - bool getEnableProfiling() const { return Profile; } -@@ -192,18 +192,9 @@ public: - } - - private: -- // Calls setDiagnosticsEngine() and storeError(). -+ // Writes to Stats. - friend class ClangTidyDiagnosticConsumer; -- friend class ClangTidyPluginAction; -- -- /// \brief Sets the \c DiagnosticsEngine so that Diagnostics can be generated -- /// correctly. -- void setDiagnosticsEngine(DiagnosticsEngine *Engine); - -- /// \brief Store an \p Error. -- void storeError(const ClangTidyError &Error); -- -- std::vector Errors; - DiagnosticsEngine *DiagEngine; - std::unique_ptr OptionsProvider; - -@@ -243,13 +234,12 @@ public: - void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, - const Diagnostic &Info) override; - -- /// \brief Flushes the internal diagnostics buffer to the ClangTidyContext. -- void finish() override; -+ // Retrieve the diagnostics that were captured. -+ std::vector take(); - - private: - void finalizeLastError(); -- -- void removeIncompatibleErrors(SmallVectorImpl &Errors) const; -+ void removeIncompatibleErrors(); - - /// \brief Returns the \c HeaderFilter constructed for the options set in the - /// context. -@@ -257,13 +247,12 @@ private: - - /// \brief Updates \c LastErrorRelatesToUserCode and LastErrorPassesLineFilter - /// according to the diagnostic \p Location. -- void checkFilters(SourceLocation Location); -+ void checkFilters(SourceLocation Location, const SourceManager& Sources); - bool passesLineFilter(StringRef FileName, unsigned LineNumber) const; - - ClangTidyContext &Context; - bool RemoveIncompatibleErrors; -- std::unique_ptr Diags; -- SmallVector Errors; -+ std::vector Errors; - std::unique_ptr HeaderFilter; - bool LastErrorRelatesToUserCode; - bool LastErrorPassesLineFilter; -diff --git a/ClangTidyOptions.h b/ClangTidyOptions.h -index b2a4ce4..3ea3538 100644 ---- a/ClangTidyOptions.h -+++ b/ClangTidyOptions.h -@@ -15,7 +15,7 @@ - #include "llvm/ADT/StringRef.h" - #include "llvm/ADT/IntrusiveRefCntPtr.h" - #include "llvm/Support/ErrorOr.h" --#include "clang/Basic/VirtualFileSystem.h" -+#include "llvm/Support/VirtualFileSystem.h" - #include - #include - #include -@@ -221,7 +221,7 @@ public: - FileOptionsProvider(const ClangTidyGlobalOptions &GlobalOptions, - const ClangTidyOptions &DefaultOptions, - const ClangTidyOptions &OverrideOptions, -- llvm::IntrusiveRefCntPtr FS = nullptr); -+ llvm::IntrusiveRefCntPtr FS = nullptr); - - /// \brief Initializes the \c FileOptionsProvider instance with a custom set - /// of configuration file handlers. -@@ -255,7 +255,7 @@ protected: - llvm::StringMap CachedOptions; - ClangTidyOptions OverrideOptions; - ConfigFileHandlers ConfigHandlers; -- llvm::IntrusiveRefCntPtr FS; -+ llvm::IntrusiveRefCntPtr FS; - }; - - /// \brief Parses LineFilter from JSON and stores it to the \p Options. -diff --git a/tool/ClangTidyMain.cpp b/tool/ClangTidyMain.cpp -index f36c4ec..d72cf98 100644 ---- a/tool/ClangTidyMain.cpp -+++ b/tool/ClangTidyMain.cpp -@@ -254,7 +254,7 @@ static void printStats(const ClangTidyStats &Stats) { - } - - static std::unique_ptr createOptionsProvider( -- llvm::IntrusiveRefCntPtr FS) { -+ llvm::IntrusiveRefCntPtr FS) { - ClangTidyGlobalOptions GlobalOptions; - if (std::error_code Err = parseLineFilter(LineFilter, GlobalOptions)) { - llvm::errs() << "Invalid LineFilter: " << Err.message() << "\n\nUsage:\n"; -@@ -302,7 +302,7 @@ static std::unique_ptr createOptionsProvider( - OverrideOptions, std::move(FS)); - } - --llvm::IntrusiveRefCntPtr -+llvm::IntrusiveRefCntPtr - getVfsOverlayFromFile(const std::string &OverlayFile) { - llvm::IntrusiveRefCntPtr OverlayFS( - new vfs::OverlayFileSystem(vfs::getRealFileSystem())); -@@ -315,7 +315,7 @@ getVfsOverlayFromFile(const std::string &OverlayFile) { - return nullptr; - } - -- IntrusiveRefCntPtr FS = vfs::getVFSFromYAML( -+ IntrusiveRefCntPtr FS = vfs::getVFSFromYAML( - std::move(Buffer.get()), /*DiagHandler*/ nullptr, OverlayFile); - if (!FS) { - llvm::errs() << "Error: invalid virtual filesystem overlay file '" -@@ -329,7 +329,7 @@ getVfsOverlayFromFile(const std::string &OverlayFile) { - static int clangTidyMain(int argc, const char **argv) { - CommonOptionsParser OptionsParser(argc, argv, ClangTidyCategory, - cl::ZeroOrMore); -- llvm::IntrusiveRefCntPtr BaseFS( -+ llvm::IntrusiveRefCntPtr BaseFS( - VfsOverlay.empty() ? vfs::getRealFileSystem() - : getVfsOverlayFromFile(VfsOverlay)); - if (!BaseFS) -@@ -421,9 +421,9 @@ static int clangTidyMain(int argc, const char **argv) { - - ClangTidyContext Context(std::move(OwningOptionsProvider), - AllowEnablingAnalyzerAlphaCheckers); -- runClangTidy(Context, OptionsParser.getCompilations(), PathList, BaseFS, -- EnableCheckProfile, ProfilePrefix); -- ArrayRef Errors = Context.getErrors(); -+ std::vector Errors = -+ runClangTidy(Context, OptionsParser.getCompilations(), PathList, BaseFS, -+ EnableCheckProfile, ProfilePrefix); - bool FoundErrors = llvm::find_if(Errors, [](const ClangTidyError &E) { - return E.DiagLevel == ClangTidyError::Error; - }) != Errors.end(); -@@ -433,7 +433,7 @@ static int clangTidyMain(int argc, const char **argv) { - unsigned WErrorCount = 0; - - // -fix-errors implies -fix. -- handleErrors(Context, (FixErrors || Fix) && !DisableFixes, WErrorCount, -+ handleErrors(Errors, Context, (FixErrors || Fix) && !DisableFixes, WErrorCount, - BaseFS); - - if (!ExportFixes.empty() && !Errors.empty()) { diff --git a/codechecker.spec b/codechecker.spec index 3563d8ab097..bf4913a3997 100644 --- a/codechecker.spec +++ b/codechecker.spec @@ -1,18 +1,16 @@ ### RPM external codechecker 0.1 ## INITENV +PATH LD_LIBRARY_PATH %i/lib64 -%define tag 5248cbf0bc6e0f5a81e5f2fe75d81f55601b23b9 -%define branch master -%define github_user gartung +%define tag f10d1156e2295d688d6b0a80fae50df029caa1fd +%define branch llvm9 +%define github_user cms-externals Source: git+https://github.com/%github_user/CMSCodeChecker.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz BuildRequires: cmake Requires: llvm -Patch0: codechecker-llvm8 %prep %setup -n %n-%{realversion} -%patch0 -p1 %build mkdir build diff --git a/llvm-gcc-toolfile.spec b/llvm-gcc-toolfile.spec index 71ead2cfb9e..12f05b8f290 100644 --- a/llvm-gcc-toolfile.spec +++ b/llvm-gcc-toolfile.spec @@ -1,4 +1,4 @@ -### RPM cms llvm-gcc-toolfile 13.0 +### RPM cms llvm-gcc-toolfile 14.0 Requires: llvm BuildRequires: python @@ -55,6 +55,7 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/llvm-cxxcompiler.xml + @@ -64,6 +65,7 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/llvm-cxxcompiler.xml + diff --git a/llvm.spec b/llvm.spec index 519f79d1721..b94b1473bb2 100644 --- a/llvm.spec +++ b/llvm.spec @@ -1,4 +1,4 @@ -### RPM external llvm 8.0.1 +### RPM external llvm 9.0.1 ## INITENV +PATH LD_LIBRARY_PATH %{i}/lib64 ## INITENV +PATH PYTHON27PATH %{i}/lib64/python`echo $PYTHON_VERSION | cut -d. -f 1,2`/site-packages ## INITENV +PATH PYTHON3PATH %{i}/lib64/python`echo $PYTHON3_VERSION | cut -d. -f 1,2`/site-packages @@ -11,10 +11,10 @@ Requires: cuda %endif AutoReq: no -%define llvmCommit dd3df36604b9a3418a28efce78ac470b22992f70 -%define llvmBranch cms/release/8.x/635f8ff -%define iwyuCommit 4d2bbcc0d98faccfc51d15c6f6a573ec78d7751d -%define iwyuBranch master +%define llvmCommit 379a43bc841451feccf78db64f2ed5c9e62c7de8 +%define llvmBranch cms/release/9.x/c1a0a21 +%define iwyuCommit 06e88efada2ff6dbccee3bbb1279c10439daa4d2 +%define iwyuBranch clang_9.0 Source0: git+https://github.com/cms-externals/llvm-project.git?obj=%{llvmBranch}/%{llvmCommit}&export=llvm-%{realversion}-%{llvmCommit}&module=llvm-%{realversion}-%{llvmCommit}&output=/llvm-%{realversion}-%{llvmCommit}.tgz Source1: git+https://github.com/include-what-you-use/include-what-you-use.git?obj=%{iwyuBranch}/%{iwyuCommit}&export=iwyu-%{realversion}-%{iwyuCommit}&module=iwyu-%{realversion}-%{iwyuCommit}&output=/iwyu-%{realversion}-%{iwyuCommit}.tgz diff --git a/pip/llvmlite.file b/pip/llvmlite.file index bca656fce1e..673eb26e96f 100644 --- a/pip/llvmlite.file +++ b/pip/llvmlite.file @@ -1,4 +1,6 @@ Requires: llvm py2-wheel py2-enum34 Patch0: py2-llvmlite-fpic-flag +Patch1: py2-llvmlite-llvm9 +%define source0 git+https://github.com/numba/llvmlite?obj=master/6435ea21f73dbf909a0418ed16375361e40d9892&export=llvmlite-%{realversion}&output=/source.tar.gz %define PipPreBuild export LLVM_CONFIG=${LLVM_ROOT}/bin/llvm-config diff --git a/pip/requirements.txt b/pip/requirements.txt index d6a4f3ae048..e73f6173506 100644 --- a/pip/requirements.txt +++ b/pip/requirements.txt @@ -112,7 +112,8 @@ keras-preprocessing==1.1.0 kiwisolver==1.1.0 lazy-object-proxy==1.4.3 lizard==1.16.6 -llvmlite==0.30.0 +#NO_AUTO_UPDATE: Source is defined in llvmlite.file, changing version here is not going to get new sources +llvmlite==0.32.0x lxml==4.4.1 lz4==2.2.1 Mako==1.1.0 diff --git a/py2-llvmlite-llvm9.patch b/py2-llvmlite-llvm9.patch new file mode 100644 index 00000000000..641b567a162 --- /dev/null +++ b/py2-llvmlite-llvm9.patch @@ -0,0 +1,12 @@ +diff -Naur a/ffi/build.py b/ffi/build.py +--- a/ffi/build.py 2020-01-10 14:51:38.000000000 +0100 ++++ b/ffi/build.py 2020-01-10 14:45:27.059843040 +0100 +@@ -110,7 +110,7 @@ + out = out.decode('latin1') + print(out) + if not (out.startswith('8.0.') or out.startswith('7.0.') +- or out.startswith('7.1.')): ++ or out.startswith('7.1.') or out.startswith('9.0.')): + msg = ( + "Building llvmlite requires LLVM 7.0.x, 7.1.x or 8.0.x Be sure to " + "set LLVM_CONFIG to the right executable path.\n"