Skip to content

Commit

Permalink
creduce: Update to 2.10.0.r110.g31e855e
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Nov 13, 2024
1 parent 33d946b commit e05f0b6
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 5 deletions.
97 changes: 97 additions & 0 deletions mingw-w64-creduce/0001-llvm19.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
--- creduce/clang_delta/ExpressionDetector.cpp 2024-11-13 22:04:35.755591600 +0100
+++ creduce/clang_delta/ExpressionDetector.cpp 2024-11-13 22:01:03.336578100 +0100
@@ -64,7 +64,8 @@
StringRef FileName, bool IsAngled,
CharSourceRange FilenameRange, OptionalFileEntryRef File,
StringRef SearchPath, StringRef RelativePath,
- const Module *Imported,
+ const Module *SuggestedModule,
+ bool ModuleImported,
SrcMgr::CharacteristicKind FileType) override;

private:
@@ -85,7 +86,8 @@
OptionalFileEntryRef /*File*/,
StringRef /*SearchPath*/,
StringRef /*RelativePath*/,
- const Module * /*Imported*/,
+ const Module * /*SuggestedModule*/,
+ bool /*ModuleImported*/,
SrcMgr::CharacteristicKind /*FileType*/)
{
if (!SrcManager.isInMainFile(HashLoc))
@@ -118,7 +120,7 @@
const VarDecl *VD = dyn_cast<VarDecl>(DRE->getDecl());
if (!VD)
return true;
- if (VD->getName().startswith(Prefix))
+ if (VD->getName().starts_with(Prefix))
TmpVars.push_back(VD);
return true;
}
@@ -363,7 +365,7 @@
{
if (!VD)
return;
- if (!VD->getName().startswith(TmpVarNamePrefix))
+ if (!VD->getName().starts_with(TmpVarNamePrefix))
return;
if (const Expr *E = VD->getInit())
ProcessedExprs[VD] = E->IgnoreParenImpCasts();
@@ -374,9 +376,9 @@
StringRef Name = ND->getName();
// We don't want to repeatly replace temporary variables
// __creduce_expr_tmp_xxx, __creduce_printed_yy and __creduce_checked_zzz.
- return Name.startswith(TmpVarNamePrefix) ||
- Name.startswith(PrintedVarNamePrefix) ||
- Name.startswith(CheckedVarNamePrefix);
+ return Name.starts_with(TmpVarNamePrefix) ||
+ Name.starts_with(PrintedVarNamePrefix) ||
+ Name.starts_with(CheckedVarNamePrefix);
}

// Reference: IdenticalExprChecker.cpp from Clang
@@ -524,8 +526,8 @@
if (const DeclRefExpr *SubE =
dyn_cast<DeclRefExpr>(UO->getSubExpr()->IgnoreParenCasts())) {
StringRef SubEName = SubE->getDecl()->getName();
- if (SubEName.startswith(PrintedVarNamePrefix) ||
- SubEName.startswith(CheckedVarNamePrefix))
+ if (SubEName.starts_with(PrintedVarNamePrefix) ||
+ SubEName.starts_with(CheckedVarNamePrefix))
return false;
}
}
@@ -541,7 +543,7 @@
bool IsLit = SC == Stmt::IntegerLiteralClass ||
SC == Stmt::FloatingLiteralClass;
if (IsLit && DRE &&
- DRE->getDecl()->getName().startswith(TmpVarNamePrefix) &&
+ DRE->getDecl()->getName().starts_with(TmpVarNamePrefix) &&
S->getStmtClass() == Stmt::IfStmtClass) {
return false;
}
diff -Nur creduce/clang_delta/RemoveNamespace.cpp creduce/clang_delta/RemoveNamespace.cpp
--- creduce/clang_delta/RemoveNamespace.cpp 2024-11-13 22:04:35.771339900 +0100
+++ creduce/clang_delta/RemoveNamespace.cpp 2024-11-13 21:55:02.235178400 +0100
@@ -944,7 +944,7 @@
TransAssert(IdInfo && "Invalid IdentifierInfo!");
NewName += IdInfo->getName();
// Make sure we have valid suffix for user literals
- if (IsUserLiteral && IdInfo->getName().startswith("_")) {
+ if (IsUserLiteral && IdInfo->getName().starts_with("_")) {
NewName = "_" + NewName;
}
NamedDeclToNewName[ND] = NewName;
diff -Nur creduce/clang_delta/RenameCXXMethod.cpp creduce/clang_delta/RenameCXXMethod.cpp
--- creduce/clang_delta/RenameCXXMethod.cpp 2024-11-13 22:04:35.787084600 +0100
+++ creduce/clang_delta/RenameCXXMethod.cpp 2024-11-13 22:03:22.949186100 +0100
@@ -426,7 +426,7 @@
{
size_t PrefixLen = MethodNamePrefix.length();
StringRef NamePrefix = Name.substr(0, PrefixLen);
- if (!NamePrefix.equals(MethodNamePrefix))
+ if (NamePrefix != MethodNamePrefix)
return false;
llvm::APInt Num;
return !Name.drop_front(PrefixLen).getAsInteger(10, Num);
19 changes: 14 additions & 5 deletions mingw-w64-creduce/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ _realname=creduce
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-${_realname}-git")
pkgver=2.10.0.r107.g98baa64
pkgrel=3
_commit=98baa64699aedb943520f175a5e731582df2806f
pkgver=2.10.0.r110.g31e855e
pkgrel=1
_commit=31e855e290970cba0286e5032971509c0e7c0a80
pkgdesc="A C program reducer (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64')
Expand All @@ -24,14 +24,23 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-clang"
"git")
source=(${_realname}::git+https://github.com/csmith-project/creduce#commit=${_commit})
sha256sums=('SKIP')
source=(${_realname}::git+https://github.com/csmith-project/creduce#commit=${_commit}
"0001-llvm19.patch")
sha256sums=('94887099adcc2e98dc829fb2c00b587aa8693346951bfca7674fd9086925b9e8'
'67fd2736c16699d4e0e35c13c247c4c59ee9c0ce7c3f75403956aec0ab0f04eb')

pkgver() {
cd "${srcdir}/${_realname}"
git describe --long ${_commit} | sed 's/creduce-//g;s/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
}

prepare() {
cd "${srcdir}/${_realname}"

# https://github.com/csmith-project/creduce/issues/276
patch -Np1 -i "${srcdir}/0001-llvm19.patch"
}

build() {
mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM}

Expand Down

0 comments on commit e05f0b6

Please sign in to comment.