Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/creduce/files/, dev-util/creduce/
Date: Thu, 04 Oct 2018 17:07:32
Message-Id: 1538672837.400e84dbd725778f242320820c530c7e3c322488.mgorny@gentoo
1 commit: 400e84dbd725778f242320820c530c7e3c322488
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 4 16:46:51 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 4 17:07:17 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=400e84db
7
8 dev-util/creduce: backport LLVM-7 support patch
9
10 Bug: https://bugs.gentoo.org/667556
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 .../creduce/creduce-2.8.0_pre20180411-r1.ebuild | 44 +++++++++++
14 dev-util/creduce/files/creduce-llvm-7.patch | 90 ++++++++++++++++++++++
15 2 files changed, 134 insertions(+)
16
17 diff --git a/dev-util/creduce/creduce-2.8.0_pre20180411-r1.ebuild b/dev-util/creduce/creduce-2.8.0_pre20180411-r1.ebuild
18 new file mode 100644
19 index 00000000000..fec31d8e891
20 --- /dev/null
21 +++ b/dev-util/creduce/creduce-2.8.0_pre20180411-r1.ebuild
22 @@ -0,0 +1,44 @@
23 +# Copyright 1999-2018 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI="6"
27 +
28 +: ${CMAKE_MAKEFILE_GENERATOR=ninja}
29 +inherit cmake-utils llvm
30 +
31 +EGIT_COMMIT="48e622ba74bc35c5a81299d3a34b9b14038d6a70"
32 +
33 +DESCRIPTION="C-Reduce - a plugin-based C program reducer"
34 +HOMEPAGE="https://embed.cs.utah.edu/creduce/"
35 +SRC_URI="https://github.com/csmith-project/${PN}/archive/${EGIT_COMMIT}.tar.gz -> ${PN}-${EGIT_COMMIT}.tar.gz"
36 +
37 +LICENSE="UoI-NCSA"
38 +SLOT="0"
39 +KEYWORDS="~amd64 ~x86"
40 +IUSE=""
41 +
42 +LLVM_MAX_SLOT=7
43 +
44 +COMMON_DEPEND="
45 + >=dev-lang/perl-5.10.0
46 + sys-devel/clang:${LLVM_MAX_SLOT}"
47 +RDEPEND="${COMMON_DEPEND}
48 + dev-perl/Benchmark-Timer
49 + dev-perl/Exporter-Lite
50 + dev-perl/File-Which
51 + dev-perl/Getopt-Tabular
52 + dev-perl/Regexp-Common
53 + dev-perl/Sys-CPU
54 + dev-util/astyle
55 + dev-util/indent"
56 +DEPEND="${COMMON_DEPEND}"
57 +
58 +S="${WORKDIR}/${PN}-${EGIT_COMMIT}"
59 +
60 +PATCHES=(
61 + "${FILESDIR}"/creduce-llvm-7.patch
62 +)
63 +
64 +llvm_check_deps() {
65 + has_version "sys-devel/clang:${LLVM_SLOT}"
66 +}
67
68 diff --git a/dev-util/creduce/files/creduce-llvm-7.patch b/dev-util/creduce/files/creduce-llvm-7.patch
69 new file mode 100644
70 index 00000000000..a005eebff2e
71 --- /dev/null
72 +++ b/dev-util/creduce/files/creduce-llvm-7.patch
73 @@ -0,0 +1,90 @@
74 +From c0d9c3a2ef763eb09f0a70b8ad86250598549487 Mon Sep 17 00:00:00 2001
75 +From: Yang Chen <chenyang@×××××××.edu>
76 +Date: Fri, 28 Sep 2018 00:39:22 -0700
77 +Subject: [PATCH] building with LLVM 7.0
78 +
79 +cope with some API changes for LLVM 7.0
80 +---
81 + clang_delta/ExpressionDetector.cpp | 20 +++++++++++---------
82 + clang_delta/RemoveUnusedEnumMember.cpp | 8 ++++----
83 + clang_delta/TransformationManager.cpp | 2 +-
84 + 3 files changed, 16 insertions(+), 14 deletions(-)
85 +
86 +diff --git a/clang_delta/ExpressionDetector.cpp b/clang_delta/ExpressionDetector.cpp
87 +index aa87873..dd77068 100644
88 +--- a/clang_delta/ExpressionDetector.cpp
89 ++++ b/clang_delta/ExpressionDetector.cpp
90 +@@ -64,7 +64,8 @@ public:
91 + StringRef FileName, bool IsAngled,
92 + CharSourceRange FilenameRange, const FileEntry *File,
93 + StringRef SearchPath, StringRef RelativePath,
94 +- const Module *Imported) override;
95 ++ const Module *Imported,
96 ++ SrcMgr::CharacteristicKind FileType) override;
97 +
98 + private:
99 + SourceManager &SrcManager;
100 +@@ -77,14 +78,15 @@ private:
101 + };
102 +
103 + void IncludesPPCallbacks::InclusionDirective(SourceLocation HashLoc,
104 +- const Token &/*IncludeTok*/,
105 +- StringRef FileName,
106 +- bool /*IsAngled*/,
107 +- CharSourceRange /*FilenameRange*/,
108 +- const FileEntry * /*File*/,
109 +- StringRef /*SearchPath*/,
110 +- StringRef /*RelativePath*/,
111 +- const Module * /*Imported*/)
112 ++ const Token &/*IncludeTok*/,
113 ++ StringRef FileName,
114 ++ bool /*IsAngled*/,
115 ++ CharSourceRange /*FilenameRange*/,
116 ++ const FileEntry * /*File*/,
117 ++ StringRef /*SearchPath*/,
118 ++ StringRef /*RelativePath*/,
119 ++ const Module * /*Imported*/,
120 ++ SrcMgr::CharacteristicKind /*FileType*/)
121 + {
122 + if (!SrcManager.isInMainFile(HashLoc))
123 + return;
124 +diff --git a/clang_delta/RemoveUnusedEnumMember.cpp b/clang_delta/RemoveUnusedEnumMember.cpp
125 +index 8bf8673..469db3f 100644
126 +--- a/clang_delta/RemoveUnusedEnumMember.cpp
127 ++++ b/clang_delta/RemoveUnusedEnumMember.cpp
128 +@@ -99,15 +99,15 @@ void RemoveUnusedEnumMember::removeEnumConstantDecl()
129 + {
130 + SourceLocation StartLoc = (*TheEnumIterator)->getLocStart();
131 + if (StartLoc.isMacroID()) {
132 +- std::pair<SourceLocation, SourceLocation> Locs =
133 ++ CharSourceRange CSRange =
134 + SrcManager->getExpansionRange(StartLoc);
135 +- StartLoc = Locs.first;
136 ++ StartLoc = CSRange.getBegin();
137 + }
138 + SourceLocation EndLoc = (*TheEnumIterator)->getLocEnd();
139 + if (EndLoc.isMacroID()) {
140 +- std::pair<SourceLocation, SourceLocation> Locs =
141 ++ CharSourceRange CSRange =
142 + SrcManager->getExpansionRange(EndLoc);
143 +- EndLoc = Locs.second;
144 ++ EndLoc = CSRange.getEnd();
145 + }
146 + SourceLocation CommaLoc = Lexer::findLocationAfterToken(
147 + EndLoc, tok::comma, *SrcManager, Context->getLangOpts(),
148 +diff --git a/clang_delta/TransformationManager.cpp b/clang_delta/TransformationManager.cpp
149 +index 89e9d72..1e56b90 100644
150 +--- a/clang_delta/TransformationManager.cpp
151 ++++ b/clang_delta/TransformationManager.cpp
152 +@@ -223,7 +223,7 @@ llvm::raw_ostream *TransformationManager::getOutStream()
153 +
154 + std::error_code EC;
155 + llvm::raw_fd_ostream *Out = new llvm::raw_fd_ostream(
156 +- OutputFileName, EC, llvm::sys::fs::F_RW);
157 ++ OutputFileName, EC, llvm::sys::fs::FA_Read | llvm::sys::fs::FA_Write);
158 + assert(!EC && "Cannot open output file!");
159 + return Out;
160 + }
161 +--
162 +2.19.0
163 +