Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/creduce creduce: port to LLVM 10



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3cac9d2edc19
branches:  trunk
changeset: 429475:3cac9d2edc19
user:      adam <adam%pkgsrc.org@localhost>
date:      Mon Apr 20 16:33:51 2020 +0000

description:
creduce: port to LLVM 10

diffstat:

 devel/creduce/Makefile                                             |   6 +-
 devel/creduce/distinfo                                             |   3 +-
 devel/creduce/patches/patch-clang__delta_TransformationManager.cpp |  72 ++++++++++
 3 files changed, 77 insertions(+), 4 deletions(-)

diffs (112 lines):

diff -r 83d145b1a0f9 -r 3cac9d2edc19 devel/creduce/Makefile
--- a/devel/creduce/Makefile    Mon Apr 20 14:48:39 2020 +0000
+++ b/devel/creduce/Makefile    Mon Apr 20 16:33:51 2020 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.10 2019/08/11 13:18:40 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2020/04/20 16:33:51 adam Exp $
 
 DISTNAME=      creduce-2.10.0
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    devel
 MASTER_SITES=  https://embed.cs.utah.edu/creduce/
 
@@ -17,7 +17,7 @@
 DEPENDS+=      p5-Sys-CPU-[0-9]*:../../sysutils/p5-Sys-CPU
 DEPENDS+=      p5-Regexp-Common-[0-9]*:../../textproc/p5-Regexp-Common
 
-USE_LANGUAGES= c c++11
+USE_LANGUAGES= c c++14
 USE_TOOLS+=    flex perl:run gmake
 GNU_CONFIGURE= yes
 TEST_TARGET=   check
diff -r 83d145b1a0f9 -r 3cac9d2edc19 devel/creduce/distinfo
--- a/devel/creduce/distinfo    Mon Apr 20 14:48:39 2020 +0000
+++ b/devel/creduce/distinfo    Mon Apr 20 16:33:51 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2019/06/02 09:07:39 adam Exp $
+$NetBSD: distinfo,v 1.8 2020/04/20 16:33:51 adam Exp $
 
 SHA1 (creduce-2.10.0.tar.gz) = 77c3dafb2446133ca2f2aeae34b2e4b79de5231d
 RMD160 (creduce-2.10.0.tar.gz) = 183be95aec282812724ec66204952ad33dbc923b
@@ -6,3 +6,4 @@
 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
diff -r 83d145b1a0f9 -r 3cac9d2edc19 devel/creduce/patches/patch-clang__delta_TransformationManager.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp        Mon Apr 20 16:33:51 2020 +0000
@@ -0,0 +1,72 @@
+$NetBSD: patch-clang__delta_TransformationManager.cpp,v 1.6 2020/04/20 16:33:51 adam Exp $
+
+Port to LLVM 10.0
+https://github.com/csmith-project/creduce/pull/204/
+
+--- clang_delta/TransformationManager.cpp.orig 2019-05-13 21:17:30.000000000 +0000
++++ clang_delta/TransformationManager.cpp
+@@ -16,6 +16,7 @@
+ 
+ #include <sstream>
+ 
++#include "clang/Basic/Builtins.h"
+ #include "clang/Basic/Diagnostic.h"
+ #include "clang/Basic/TargetInfo.h"
+ #include "clang/Lex/Preprocessor.h"
+@@ -101,6 +102,7 @@ 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() == Language::C) {
++    Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind(Language::C), T, PPOpts);
++  }
++  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);
++  }
++  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
+     ClangInstance->createFileManager();
+ 
+     if(CLCPath != NULL && ClangInstance->hasFileManager() &&
+-       ClangInstance->getFileManager().getDirectory(CLCPath, false) != NULL) {
++       ClangInstance->getFileManager().getDirectory(CLCPath, false)) {
+         Args.push_back("-I");
+         Args.push_back(CLCPath);
+     }
+@@ -132,10 +146,19 @@ 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
+                                        ClangInstance->getDiagnostics());
+     Invocation.setLangDefaults(ClangInstance->getLangOpts(),
+-                               InputKind::OpenCL, T, PPOpts);
++#if LLVM_VERSION_MAJOR >= 10
++                               InputKind(Language::OpenCL),
++#else
++                               InputKind::OpenCL,
++#endif
++                             T, PPOpts);
+   }
+   else {
+     ErrorMsg = "Unsupported file type!";



Home | Main Index | Thread Index | Old Index