diff options
author | wiz <wiz@pkgsrc.org> | 2021-07-14 09:08:48 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2021-07-14 09:08:48 +0000 |
commit | 0899eca0a100c5c7aa8a81436eb4ed182b9004d7 (patch) | |
tree | 8a7c89558812b2e50336a6b589dbc86145c3077b /devel/creduce | |
parent | b236b998cb43858b79cc942ac91a72cabac0337c (diff) | |
download | pkgsrc-0899eca0a100c5c7aa8a81436eb4ed182b9004d7.tar.gz |
creduce: fix build with llvm-12
From https://github.com/csmith-project/creduce/tree/llvm-12.0-dev
Diffstat (limited to 'devel/creduce')
9 files changed, 123 insertions, 75 deletions
diff --git a/devel/creduce/Makefile b/devel/creduce/Makefile index 26feae151a7..eae8ce57512 100644 --- a/devel/creduce/Makefile +++ b/devel/creduce/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.16 2021/05/24 19:49:54 wiz Exp $ +# $NetBSD: Makefile,v 1.17 2021/07/14 09:08:48 wiz Exp $ DISTNAME= creduce-2.10.0 -PKGREVISION= 7 +PKGREVISION= 8 CATEGORIES= devel MASTER_SITES= https://embed.cs.utah.edu/creduce/ diff --git a/devel/creduce/distinfo b/devel/creduce/distinfo index 3c7d84d5f97..8c640378e82 100644 --- a/devel/creduce/distinfo +++ b/devel/creduce/distinfo @@ -1,9 +1,11 @@ -$NetBSD: distinfo,v 1.8 2020/04/20 16:33:51 adam Exp $ +$NetBSD: distinfo,v 1.9 2021/07/14 09:08:48 wiz Exp $ SHA1 (creduce-2.10.0.tar.gz) = 77c3dafb2446133ca2f2aeae34b2e4b79de5231d RMD160 (creduce-2.10.0.tar.gz) = 183be95aec282812724ec66204952ad33dbc923b SHA512 (creduce-2.10.0.tar.gz) = f2f2cc498cbf78331ea62e533579c84042ddc1ad8eb146adeae6b3a833e0ea4bb26a4ab5f1f61a30500a5a0c9c89cc1d4e4c8547aa9e4a14d3b5d744aeb4f6a7 Size (creduce-2.10.0.tar.gz) = 779318 bytes -SHA1 (patch-clang__delta_Makefile.am) = 6eac9443bb954c9fb54a922d6da909cf0a45d25d -SHA1 (patch-clang__delta_Makefile.in) = c650aab0534268a67615d9360934534ea1d36b90 -SHA1 (patch-clang__delta_TransformationManager.cpp) = 40171540ed976c14ec3a9d249e8e8ed96d3e8a88 +SHA1 (patch-clang__delta_CommonRenameClassRewriteVisitor.h) = 66527a9c3e0bf8ff778c9a57eb20cda596223300 +SHA1 (patch-clang__delta_RemoveNamespace.cpp) = 82eb6a625a27edfac93d5727c5dde7d1382d68bb +SHA1 (patch-clang__delta_RewriteUtils.cpp) = 56b8f4d19189019c4dcc83b315a1cfd2ff459955 +SHA1 (patch-clang__delta_Transformation.cpp) = b04a80569552639c529251dc450defefbd8f2e93 +SHA1 (patch-clang__delta_TransformationManager.cpp) = 322e64726dc0301832824caf228da6faf8bb6ae8 diff --git a/devel/creduce/patches/patch-clang__delta_CommonRenameClassRewriteVisitor.h b/devel/creduce/patches/patch-clang__delta_CommonRenameClassRewriteVisitor.h new file mode 100644 index 00000000000..5bd719a0f82 --- /dev/null +++ b/devel/creduce/patches/patch-clang__delta_CommonRenameClassRewriteVisitor.h @@ -0,0 +1,24 @@ +$NetBSD: patch-clang__delta_CommonRenameClassRewriteVisitor.h,v 1.1 2021/07/14 09:08:49 wiz Exp $ + +Build fix for llvm 12.0.1 from https://github.com/csmith-project/creduce/tree/llvm-12.0-dev + +--- clang_delta/CommonRenameClassRewriteVisitor.h.orig 2019-05-13 21:17:30.000000000 +0000 ++++ clang_delta/CommonRenameClassRewriteVisitor.h +@@ -98,7 +98,7 @@ bool CommonRenameClassRewriteVisitor<T>: + return true; + + IdentifierInfo *IdInfo = DeclName.getAsIdentifierInfo(); +- std::string IdName = IdInfo->getName(); ++ std::string IdName = IdInfo->getName().str(); + std::string Name; + if (getNewNameByName(IdName, Name)) { + SourceLocation LocStart = NameInfo.getBeginLoc(); +@@ -332,7 +332,7 @@ template<typename T> bool CommonRenameCl + TransAssert(DTST && "Bad DependentTemplateSpecializationType!"); + + const IdentifierInfo *IdInfo = DTST->getIdentifier(); +- std::string IdName = IdInfo->getName(); ++ std::string IdName = IdInfo->getName().str(); + std::string Name; + if (getNewNameByName(IdName, Name)) { + SourceLocation LocStart = DTSLoc.getTemplateNameLoc(); diff --git a/devel/creduce/patches/patch-clang__delta_Makefile.am b/devel/creduce/patches/patch-clang__delta_Makefile.am deleted file mode 100644 index ae85f160f11..00000000000 --- a/devel/creduce/patches/patch-clang__delta_Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -$NetBSD: patch-clang__delta_Makefile.am,v 1.2 2018/03/31 20:09:10 joerg Exp $ - ---- clang_delta/Makefile.am.orig 2017-05-18 16:42:08.000000000 +0000 -+++ clang_delta/Makefile.am -@@ -107,12 +107,9 @@ clang_delta_CXXFLAGS = \ - # libraries. So probably, we could move `LLVMLDFLAGS' back to the definition - # of `clang_delta_LDFLAGS'. I'll do that later. - clang_delta_LDADD = \ -- -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers \ -- -lclangStaticAnalyzerCore \ - -lclangFrontendTool -lclangFrontend -lclangDriver -lclangSerialization \ - -lclangCodeGen -lclangParse -lclangSema -lclangAnalysis \ - -lclangRewriteFrontend -lclangRewrite -lclangAST -lclangBasic -lclangEdit -lclangLex \ -- -lclangARCMigrate \ - $(LLVMLIBS) \ - $(CLANG_LDFLAGS) \ - $(LLVMLDFLAGS) diff --git a/devel/creduce/patches/patch-clang__delta_Makefile.in b/devel/creduce/patches/patch-clang__delta_Makefile.in deleted file mode 100644 index 607e1079fd9..00000000000 --- a/devel/creduce/patches/patch-clang__delta_Makefile.in +++ /dev/null @@ -1,17 +0,0 @@ -$NetBSD: patch-clang__delta_Makefile.in,v 1.2 2018/03/31 20:09:10 joerg Exp $ - ---- clang_delta/Makefile.in.orig 2017-05-18 16:42:08.000000000 +0000 -+++ clang_delta/Makefile.in -@@ -502,12 +502,9 @@ clang_delta_CXXFLAGS = \ - # libraries. So probably, we could move `LLVMLDFLAGS' back to the definition - # of `clang_delta_LDFLAGS'. I'll do that later. - clang_delta_LDADD = \ -- -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers \ -- -lclangStaticAnalyzerCore \ - -lclangFrontendTool -lclangFrontend -lclangDriver -lclangSerialization \ - -lclangCodeGen -lclangParse -lclangSema -lclangAnalysis \ - -lclangRewriteFrontend -lclangRewrite -lclangAST -lclangBasic -lclangEdit -lclangLex \ -- -lclangARCMigrate \ - $(LLVMLIBS) \ - $(CLANG_LDFLAGS) \ - $(LLVMLDFLAGS) diff --git a/devel/creduce/patches/patch-clang__delta_RemoveNamespace.cpp b/devel/creduce/patches/patch-clang__delta_RemoveNamespace.cpp new file mode 100644 index 00000000000..a2e6bf4e644 --- /dev/null +++ b/devel/creduce/patches/patch-clang__delta_RemoveNamespace.cpp @@ -0,0 +1,15 @@ +$NetBSD: patch-clang__delta_RemoveNamespace.cpp,v 1.1 2021/07/14 09:08:49 wiz Exp $ + +Build fix for llvm 12.0.1 from https://github.com/csmith-project/creduce/tree/llvm-12.0-dev + +--- clang_delta/RemoveNamespace.cpp.orig 2019-05-13 21:17:30.000000000 +0000 ++++ clang_delta/RemoveNamespace.cpp +@@ -458,7 +458,7 @@ bool RemoveNamespaceRewriteVisitor::Visi + TransAssert(DTST && "Bad DependentTemplateSpecializationType!"); + + const IdentifierInfo *IdInfo = DTST->getIdentifier(); +- std::string IdName = IdInfo->getName(); ++ std::string IdName = IdInfo->getName().str(); + std::string Name; + + // FIXME: diff --git a/devel/creduce/patches/patch-clang__delta_RewriteUtils.cpp b/devel/creduce/patches/patch-clang__delta_RewriteUtils.cpp new file mode 100644 index 00000000000..f2c17c85eb3 --- /dev/null +++ b/devel/creduce/patches/patch-clang__delta_RewriteUtils.cpp @@ -0,0 +1,26 @@ +$NetBSD: patch-clang__delta_RewriteUtils.cpp,v 1.3 2021/07/14 09:08:49 wiz Exp $ + +Build fix for llvm 12.0.1 from https://github.com/csmith-project/creduce/tree/llvm-12.0-dev + +--- clang_delta/RewriteUtils.cpp.orig 2019-05-13 21:17:30.000000000 +0000 ++++ clang_delta/RewriteUtils.cpp +@@ -718,8 +718,8 @@ std::string RewriteUtils::getStmtIndentS + StringRef MB = SrcManager->getBufferData(FID); + + unsigned lineNo = SrcManager->getLineNumber(FID, StartOffset) - 1; +- const SrcMgr::ContentCache * +- Content = SrcManager->getSLocEntry(FID).getFile().getContentCache(); ++ const SrcMgr::ContentCache *Content = ++ &SrcManager->getSLocEntry(FID).getFile().getContentCache(); + unsigned lineOffs = Content->SourceLineCache[lineNo]; + + // Find the whitespace at the start of the line. +@@ -730,7 +730,7 @@ std::string RewriteUtils::getStmtIndentS + ++I; + indentSpace = MB.substr(lineOffs, I-lineOffs); + +- return indentSpace; ++ return indentSpace.str(); + } + + bool RewriteUtils::addLocalVarToFunc(const std::string &VarStr, diff --git a/devel/creduce/patches/patch-clang__delta_Transformation.cpp b/devel/creduce/patches/patch-clang__delta_Transformation.cpp new file mode 100644 index 00000000000..e06f8c118d1 --- /dev/null +++ b/devel/creduce/patches/patch-clang__delta_Transformation.cpp @@ -0,0 +1,24 @@ +$NetBSD: patch-clang__delta_Transformation.cpp,v 1.1 2021/07/14 09:08:49 wiz Exp $ + +Build fix for llvm 12.0.1 from https://github.com/csmith-project/creduce/tree/llvm-12.0-dev + +--- clang_delta/Transformation.cpp.orig 2019-05-13 21:17:30.000000000 +0000 ++++ clang_delta/Transformation.cpp +@@ -106,7 +106,7 @@ void Transformation::outputTransformedSo + void Transformation::outputOriginalSource(llvm::raw_ostream &OutStream) + { + FileID MainFileID = SrcManager->getMainFileID(); +- const llvm::MemoryBuffer *MainBuf = SrcManager->getBuffer(MainFileID); ++ auto MainBuf = SrcManager->getBufferOrNone(MainFileID); + TransAssert(MainBuf && "Empty MainBuf!"); + OutStream << MainBuf->getBufferStart(); + OutStream.flush(); +@@ -357,7 +357,7 @@ unsigned int Transformation::getConstArr + llvm::SmallString<8> IntStr; + Result.toStringUnsigned(IntStr); + +- std::stringstream TmpSS(IntStr.str()); ++ std::stringstream TmpSS(IntStr.str().str()); + + if (!(TmpSS >> Sz)) { + TransAssert(0 && "Non-integer value!"); diff --git a/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp b/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp index 0fd3d928c2b..338dbe16484 100644 --- a/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp +++ b/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp @@ -1,46 +1,45 @@ -$NetBSD: patch-clang__delta_TransformationManager.cpp,v 1.6 2020/04/20 16:33:51 adam Exp $ +$NetBSD: patch-clang__delta_TransformationManager.cpp,v 1.7 2021/07/14 09:08:49 wiz Exp $ -Port to LLVM 10.0 -https://github.com/csmith-project/creduce/pull/204/ +Build fix for llvm 12.0.1 from https://github.com/csmith-project/creduce/tree/llvm-12.0-dev --- clang_delta/TransformationManager.cpp.orig 2019-05-13 21:17:30.000000000 +0000 +++ clang_delta/TransformationManager.cpp -@@ -16,6 +16,7 @@ +@@ -16,9 +16,12 @@ #include <sstream> +#include "clang/Basic/Builtins.h" #include "clang/Basic/Diagnostic.h" ++#include "clang/Basic/FileManager.h" #include "clang/Basic/TargetInfo.h" #include "clang/Lex/Preprocessor.h" -@@ -101,6 +102,7 @@ bool TransformationManager::initializeCo ++#include "clang/Lex/PreprocessorOptions.h" + #include "clang/Frontend/CompilerInstance.h" + #include "clang/Parse/ParseAST.h" + +@@ -101,16 +104,16 @@ bool TransformationManager::initializeCo CompilerInvocation &Invocation = ClangInstance->getInvocation(); InputKind IK = FrontendOptions::getInputKindForExtension( StringRef(SrcFileName).rsplit('.').second); -+#if LLVM_VERSION_MAJOR < 10 - if (IK.getLanguage() == InputKind::C) { - Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::C, T, PPOpts); - } -@@ -111,6 +113,18 @@ bool TransformationManager::initializeCo - Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::CXX, T, PPOpts); - } - else if(IK.getLanguage() == InputKind::OpenCL) { -+#else +- if (IK.getLanguage() == InputKind::C) { +- Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::C, T, PPOpts); + if (IK.getLanguage() == Language::C) { -+ Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind(Language::C), T, PPOpts); -+ } ++ Invocation.setLangDefaults(ClangInstance->getLangOpts(), Language::C, T, PPOpts.Includes); + } +- else if (IK.getLanguage() == InputKind::CXX) { + else if (IK.getLanguage() == Language::CXX) { -+ // ISSUE: it might cause some problems when building AST -+ // for a function which has a non-declared callee, e.g., -+ // It results an empty AST for the caller. -+ Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind(Language::CXX), T, PPOpts); -+ } + // ISSUE: it might cause some problems when building AST + // for a function which has a non-declared callee, e.g., + // It results an empty AST for the caller. +- Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::CXX, T, PPOpts); ++ Invocation.setLangDefaults(ClangInstance->getLangOpts(), Language::CXX, T, PPOpts.Includes); + } +- else if(IK.getLanguage() == InputKind::OpenCL) { + else if(IK.getLanguage() == Language::OpenCL) { -+#endif //Commandline parameters std::vector<const char*> Args; Args.push_back("-x"); -@@ -122,7 +136,7 @@ bool TransformationManager::initializeCo +@@ -122,7 +125,7 @@ bool TransformationManager::initializeCo ClangInstance->createFileManager(); if(CLCPath != NULL && ClangInstance->hasFileManager() && @@ -49,24 +48,16 @@ https://github.com/csmith-project/creduce/pull/204/ Args.push_back("-I"); Args.push_back(CLCPath); } -@@ -132,10 +146,19 @@ bool TransformationManager::initializeCo +@@ -132,10 +135,10 @@ bool TransformationManager::initializeCo Args.push_back("-fno-builtin"); CompilerInvocation::CreateFromArgs(Invocation, -+#if LLVM_VERSION_MAJOR >= 10 -+ Args, -+#else - &Args[0], &Args[0] + Args.size(), -+#endif +- &Args[0], &Args[0] + Args.size(), ++ ArrayRef<const char*>(&Args[0], &Args[0] + Args.size()), ClangInstance->getDiagnostics()); Invocation.setLangDefaults(ClangInstance->getLangOpts(), - InputKind::OpenCL, T, PPOpts); -+#if LLVM_VERSION_MAJOR >= 10 -+ InputKind(Language::OpenCL), -+#else -+ InputKind::OpenCL, -+#endif -+ T, PPOpts); ++ Language::OpenCL, T, PPOpts.Includes); } else { ErrorMsg = "Unsupported file type!"; |