From 2e19cab18c3eb0428604c04295e70773686827df Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 8 May 2020 20:31:20 +0200 Subject: [PATCH] include-what-you-use: rebuild for llvm10 --- .../include-what-you-use/patches/llvm10.patch | 61 +++++++++++++++++++ srcpkgs/include-what-you-use/template | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/include-what-you-use/patches/llvm10.patch diff --git a/srcpkgs/include-what-you-use/patches/llvm10.patch b/srcpkgs/include-what-you-use/patches/llvm10.patch new file mode 100644 index 00000000000..c6e0a5c1b39 --- /dev/null +++ b/srcpkgs/include-what-you-use/patches/llvm10.patch @@ -0,0 +1,61 @@ +--- iwyu_driver.cc ++++ iwyu_driver.cc +@@ -205,11 +205,8 @@ CompilerInstance* CreateCompilerInstance(int argc, const char **argv) { + + // Initialize a compiler invocation object from the clang (-cc1) arguments. + const ArgStringList &cc_arguments = command.getArguments(); +- const char** args_start = const_cast(cc_arguments.data()); +- const char** args_end = args_start + cc_arguments.size(); + std::shared_ptr invocation(new CompilerInvocation); +- CompilerInvocation::CreateFromArgs(*invocation, +- args_start, args_end, diagnostics); ++ CompilerInvocation::CreateFromArgs(*invocation, cc_arguments, diagnostics); + invocation->getFrontendOpts().DisableFree = false; + + // Use libc++ headers bundled with Xcode.app on macOS. +--- iwyu_preprocessor.cc ++++ iwyu_preprocessor.cc +@@ -34,6 +34,7 @@ + #include "clang/Lex/MacroInfo.h" + + using clang::FileEntry; ++using clang::FileEntryRef; + using clang::FileID; + using clang::MacroDefinition; + using clang::MacroDirective; +@@ -694,7 +695,7 @@ void IwyuPreprocessorInfo::FileChanged(SourceLocation loc, + // Called when we see an #include, but decide we don't need to + // actually read it because it's already been #included (and is + // protected by a header guard). +-void IwyuPreprocessorInfo::FileSkipped(const FileEntry& file, ++void IwyuPreprocessorInfo::FileSkipped(const FileEntryRef& file, + const Token &filename, + SrcMgr::CharacteristicKind file_type) { + CHECK_(include_filename_loc_.isValid() && +@@ -705,11 +706,11 @@ void IwyuPreprocessorInfo::FileSkipped(const FileEntry& file, + GetInstantiationLoc(filename.getLocation()); + ERRSYM(GetFileEntry(include_loc)) + << "[ (#include) ] " << include_name_as_written +- << " (" << GetFilePath(&file) << ")\n"; ++ << " (" << GetFilePath(&file.getFileEntry()) << ")\n"; + +- AddDirectInclude(include_loc, &file, include_name_as_written); +- if (ShouldReportIWYUViolationsFor(&file)) { +- files_to_report_iwyu_violations_for_.insert(&file); ++ AddDirectInclude(include_loc, &file.getFileEntry(), include_name_as_written); ++ if (ShouldReportIWYUViolationsFor(&file.getFileEntry())) { ++ files_to_report_iwyu_violations_for_.insert(&file.getFileEntry()); + } + } + +--- iwyu_preprocessor.h ++++ iwyu_preprocessor.h +@@ -204,7 +204,7 @@ class IwyuPreprocessorInfo : public clang::PPCallbacks, + void FileChanged(clang::SourceLocation loc, FileChangeReason reason, + clang::SrcMgr::CharacteristicKind file_type, + clang::FileID exiting_from_id) override; +- void FileSkipped(const clang::FileEntry& file, const clang::Token &filename, ++ void FileSkipped(const clang::FileEntryRef& file, const clang::Token &filename, + clang::SrcMgr::CharacteristicKind file_type) override; + // FileChanged is actually a multi-plexer for 4 different callbacks. + void FileChanged_EnterFile(clang::SourceLocation file_beginning); diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template index a33d07095f4..18ad1b8896d 100644 --- a/srcpkgs/include-what-you-use/template +++ b/srcpkgs/include-what-you-use/template @@ -1,7 +1,7 @@ # Template file for 'include-what-you-use' pkgname=include-what-you-use version=0.13 -revision=1 +revision=2 wrksrc="${pkgname}" build_style=cmake configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "