pkgsrc-Changes archive

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

CVS commit: pkgsrc/devel/creduce



Module Name:    pkgsrc
Committed By:   wiz
Date:           Wed Jul 14 09:08:49 UTC 2021

Modified Files:
        pkgsrc/devel/creduce: Makefile distinfo
        pkgsrc/devel/creduce/patches:
            patch-clang__delta_TransformationManager.cpp
Added Files:
        pkgsrc/devel/creduce/patches:
            patch-clang__delta_CommonRenameClassRewriteVisitor.h
            patch-clang__delta_RemoveNamespace.cpp
            patch-clang__delta_RewriteUtils.cpp
            patch-clang__delta_Transformation.cpp
Removed Files:
        pkgsrc/devel/creduce/patches: patch-clang__delta_Makefile.am
            patch-clang__delta_Makefile.in

Log Message:
creduce: fix build with llvm-12

>From https://github.com/csmith-project/creduce/tree/llvm-12.0-dev


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 pkgsrc/devel/creduce/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/devel/creduce/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/devel/creduce/patches/patch-clang__delta_CommonRenameClassRewriteVisitor.h \
    pkgsrc/devel/creduce/patches/patch-clang__delta_RemoveNamespace.cpp \
    pkgsrc/devel/creduce/patches/patch-clang__delta_Transformation.cpp
cvs rdiff -u -r1.2 -r0 \
    pkgsrc/devel/creduce/patches/patch-clang__delta_Makefile.am \
    pkgsrc/devel/creduce/patches/patch-clang__delta_Makefile.in
cvs rdiff -u -r0 -r1.3 \
    pkgsrc/devel/creduce/patches/patch-clang__delta_RewriteUtils.cpp
cvs rdiff -u -r1.6 -r1.7 \
    pkgsrc/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/creduce/Makefile
diff -u pkgsrc/devel/creduce/Makefile:1.16 pkgsrc/devel/creduce/Makefile:1.17
--- pkgsrc/devel/creduce/Makefile:1.16  Mon May 24 19:49:54 2021
+++ pkgsrc/devel/creduce/Makefile       Wed Jul 14 09:08:48 2021
@@ -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/
 

Index: pkgsrc/devel/creduce/distinfo
diff -u pkgsrc/devel/creduce/distinfo:1.8 pkgsrc/devel/creduce/distinfo:1.9
--- pkgsrc/devel/creduce/distinfo:1.8   Mon Apr 20 16:33:51 2020
+++ pkgsrc/devel/creduce/distinfo       Wed Jul 14 09:08:48 2021
@@ -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

Index: pkgsrc/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp
diff -u pkgsrc/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp:1.6 pkgsrc/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp:1.7
--- pkgsrc/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp:1.6       Mon Apr 20 16:33:51 2020
+++ pkgsrc/devel/creduce/patches/patch-clang__delta_TransformationManager.cpp   Wed Jul 14 09:08:49 2021
@@ -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/creduc
          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!";

Added files:

Index: pkgsrc/devel/creduce/patches/patch-clang__delta_CommonRenameClassRewriteVisitor.h
diff -u /dev/null pkgsrc/devel/creduce/patches/patch-clang__delta_CommonRenameClassRewriteVisitor.h:1.1
--- /dev/null   Wed Jul 14 09:08:49 2021
+++ pkgsrc/devel/creduce/patches/patch-clang__delta_CommonRenameClassRewriteVisitor.h   Wed Jul 14 09:08:49 2021
@@ -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();
Index: pkgsrc/devel/creduce/patches/patch-clang__delta_RemoveNamespace.cpp
diff -u /dev/null pkgsrc/devel/creduce/patches/patch-clang__delta_RemoveNamespace.cpp:1.1
--- /dev/null   Wed Jul 14 09:08:49 2021
+++ pkgsrc/devel/creduce/patches/patch-clang__delta_RemoveNamespace.cpp Wed Jul 14 09:08:49 2021
@@ -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:
Index: pkgsrc/devel/creduce/patches/patch-clang__delta_Transformation.cpp
diff -u /dev/null pkgsrc/devel/creduce/patches/patch-clang__delta_Transformation.cpp:1.1
--- /dev/null   Wed Jul 14 09:08:49 2021
+++ pkgsrc/devel/creduce/patches/patch-clang__delta_Transformation.cpp  Wed Jul 14 09:08:49 2021
@@ -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!");

Index: pkgsrc/devel/creduce/patches/patch-clang__delta_RewriteUtils.cpp
diff -u /dev/null pkgsrc/devel/creduce/patches/patch-clang__delta_RewriteUtils.cpp:1.3
--- /dev/null   Wed Jul 14 09:08:49 2021
+++ pkgsrc/devel/creduce/patches/patch-clang__delta_RewriteUtils.cpp    Wed Jul 14 09:08:49 2021
@@ -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,



Home | Main Index | Thread Index | Old Index