pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/creduce Fix for API changes in Clang 3.9.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bb13074027cf
branches:  trunk
changeset: 355026:bb13074027cf
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Fri Nov 18 18:20:05 2016 +0000

description:
Fix for API changes in Clang 3.9.

diffstat:

 devel/creduce/Makefile                                              |   4 +-
 devel/creduce/distinfo                                              |   8 +-
 devel/creduce/patches/patch-clang__delta_EmptyStructToInt.cpp       |  13 ++
 devel/creduce/patches/patch-clang__delta_RemoveBaseClass.cpp        |  22 +++
 devel/creduce/patches/patch-clang__delta_RemoveUnusedOuterClass.cpp |  13 ++
 devel/creduce/patches/patch-clang__delta_RewriteUtils.cpp           |  22 +++
 devel/creduce/patches/patch-clang__delta_SimplifyStruct.cpp         |  13 ++
 devel/creduce/patches/patch-clang__delta_TransformationManager.cpp  |  60 ++++++++++
 8 files changed, 153 insertions(+), 2 deletions(-)

diffs (204 lines):

diff -r a96dd3198d2c -r bb13074027cf devel/creduce/Makefile
--- a/devel/creduce/Makefile    Fri Nov 18 16:58:21 2016 +0000
+++ b/devel/creduce/Makefile    Fri Nov 18 18:20:05 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2016/11/14 20:56:10 ryoon Exp $
+# $NetBSD: Makefile,v 1.3 2016/11/18 18:20:05 joerg Exp $
 
 DISTNAME=      creduce-2.5.0
 PKGREVISION=   1
@@ -22,6 +22,8 @@
 DEPENDS+=      p5-Sys-CPU-[0-9]*:../../sysutils/p5-Sys-CPU
 DEPENDS+=      p5-Regexp-Common-[0-9]*:../../textproc/p5-Regexp-Common
 
+TEST_TARGET=   check
+
 .include "../../mk/bsd.prefs.mk"
 
 CXXFLAGS+=     -std=c++11
diff -r a96dd3198d2c -r bb13074027cf devel/creduce/distinfo
--- a/devel/creduce/distinfo    Fri Nov 18 16:58:21 2016 +0000
+++ b/devel/creduce/distinfo    Fri Nov 18 18:20:05 2016 +0000
@@ -1,8 +1,14 @@
-$NetBSD: distinfo,v 1.1 2016/11/02 00:15:43 joerg Exp $
+$NetBSD: distinfo,v 1.2 2016/11/18 18:20:05 joerg Exp $
 
 SHA1 (creduce-2.5.0.tar.gz) = 3b0400bf9163ff707d9a046b501b75a233f73533
 RMD160 (creduce-2.5.0.tar.gz) = c7166d53c8e57455fabcdbbab82304de7395e05b
 SHA512 (creduce-2.5.0.tar.gz) = 5292381ddf5e2b061bcfb1a3f52cd25cab3ab5985faade7c779c41be19b5cf7309fbcfff1428f026bfcee5da7c6f898b0b8fa48d03ef83acd64000c3ece2189d
 Size (creduce-2.5.0.tar.gz) = 742516 bytes
+SHA1 (patch-clang__delta_EmptyStructToInt.cpp) = eec767e9180572cf3dd038e0f1dfd6ccdc172d3e
 SHA1 (patch-clang__delta_Makefile.am) = f8c9201b12b07ff6499f40bba49c37ac1ee67739
 SHA1 (patch-clang__delta_Makefile.in) = 49b005fe89225f785bbe41fb5e0b4a3027121a79
+SHA1 (patch-clang__delta_RemoveBaseClass.cpp) = 1f075a0c271620d9130880afc4f8f774b10a3e8e
+SHA1 (patch-clang__delta_RemoveUnusedOuterClass.cpp) = 647a8950b650c6d786b2ef777716b5bf53e042e2
+SHA1 (patch-clang__delta_RewriteUtils.cpp) = 9ad7111dcf422eed58c7ebc676060e468057c373
+SHA1 (patch-clang__delta_SimplifyStruct.cpp) = 5447d61fef8e95cabb8e735e1b80487bbb866f24
+SHA1 (patch-clang__delta_TransformationManager.cpp) = a280d1eebeb21ea51ec38565230b700a87a66553
diff -r a96dd3198d2c -r bb13074027cf devel/creduce/patches/patch-clang__delta_EmptyStructToInt.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/creduce/patches/patch-clang__delta_EmptyStructToInt.cpp     Fri Nov 18 18:20:05 2016 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-clang__delta_EmptyStructToInt.cpp,v 1.1 2016/11/18 18:20:05 joerg Exp $
+
+--- clang_delta/EmptyStructToInt.cpp.orig      2016-11-17 01:42:53.000000000 +0000
++++ clang_delta/EmptyStructToInt.cpp
+@@ -351,7 +351,7 @@ void EmptyStructToInt::removeRecordDecls
+     if (SemiLoc.isInvalid()) {
+       if (!RD->isThisDeclarationADefinition())
+         return;
+-      SourceLocation RBLoc = RD->getRBraceLoc();
++      SourceLocation RBLoc = RD->getBraceRange().getEnd();
+       if (RBLoc.isInvalid())
+         return;
+       RewriteHelper->removeTextFromLeftAt(SourceRange(RBLoc, RBLoc),
diff -r a96dd3198d2c -r bb13074027cf devel/creduce/patches/patch-clang__delta_RemoveBaseClass.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/creduce/patches/patch-clang__delta_RemoveBaseClass.cpp      Fri Nov 18 18:20:05 2016 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-clang__delta_RemoveBaseClass.cpp,v 1.1 2016/11/18 18:20:05 joerg Exp $
+
+--- clang_delta/RemoveBaseClass.cpp.orig       2016-11-17 01:45:06.000000000 +0000
++++ clang_delta/RemoveBaseClass.cpp
+@@ -209,7 +209,7 @@ void RemoveBaseClass::copyBaseClassDecls
+     return;
+   SourceLocation StartLoc = 
+     RewriteHelper->getLocationAfter(TheBaseClass->getLocation(), '{');
+-  SourceLocation EndLoc = TheBaseClass->getRBraceLoc();
++  SourceLocation EndLoc = TheBaseClass->getBraceRange().getEnd();
+   TransAssert(EndLoc.isValid() && "Invalid RBraceLoc!");
+   EndLoc = EndLoc.getLocWithOffset(-1);
+ 
+@@ -217,7 +217,7 @@ void RemoveBaseClass::copyBaseClassDecls
+     TheRewriter.getRewrittenText(SourceRange(StartLoc, EndLoc));
+ 
+   TransAssert(!DeclsStr.empty() && "Empty DeclsStr!");
+-  SourceLocation InsertLoc = TheDerivedClass->getRBraceLoc();
++  SourceLocation InsertLoc = TheDerivedClass->getBraceRange().getEnd();
+   TheRewriter.InsertTextBefore(InsertLoc, DeclsStr);
+ }
+ 
diff -r a96dd3198d2c -r bb13074027cf devel/creduce/patches/patch-clang__delta_RemoveUnusedOuterClass.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/creduce/patches/patch-clang__delta_RemoveUnusedOuterClass.cpp       Fri Nov 18 18:20:05 2016 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-clang__delta_RemoveUnusedOuterClass.cpp,v 1.1 2016/11/18 18:20:05 joerg Exp $
+
+--- clang_delta/RemoveUnusedOuterClass.cpp.orig        2016-11-17 01:53:49.000000000 +0000
++++ clang_delta/RemoveUnusedOuterClass.cpp
+@@ -140,7 +140,7 @@ void RemoveUnusedOuterClass::removeOuter
+     TheRewriter.RemoveText(AS->getSourceRange());
+   }
+   
+-  LocStart = TheCXXRDDef->getRBraceLoc();
++  LocStart = TheCXXRDDef->getBraceRange().getEnd();
+   LocEnd = RewriteHelper->getLocationUntil(LocStart, ';');
+   if (LocStart.isInvalid() || LocEnd.isInvalid())
+     return;
diff -r a96dd3198d2c -r bb13074027cf devel/creduce/patches/patch-clang__delta_RewriteUtils.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/creduce/patches/patch-clang__delta_RewriteUtils.cpp Fri Nov 18 18:20:05 2016 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-clang__delta_RewriteUtils.cpp,v 1.1 2016/11/18 18:20:05 joerg Exp $
+
+--- clang_delta/RewriteUtils.cpp.orig  2016-11-17 01:55:03.000000000 +0000
++++ clang_delta/RewriteUtils.cpp
+@@ -1701,7 +1701,7 @@ bool RewriteUtils::removeClassDecls(cons
+     SourceRange Range = (*I)->getSourceRange();
+     SourceLocation LocEnd;
+     if ((*I)->isThisDeclarationADefinition()) {
+-      LocEnd = (*I)->getRBraceLoc();
++      LocEnd = (*I)->getBraceRange().getEnd();
+       if (LocEnd.isValid())
+         LocEnd = getLocationUntil(LocEnd, ';');
+       else
+@@ -1726,7 +1726,7 @@ bool RewriteUtils::removeClassTemplateDe
+     SourceRange Range = (*I)->getSourceRange();
+     SourceLocation LocEnd;
+     if (CXXRD->isThisDeclarationADefinition()) {
+-      LocEnd = CXXRD->getRBraceLoc();
++      LocEnd = CXXRD->getBraceRange().getEnd();
+       LocEnd = getLocationUntil(LocEnd, ';');
+     }
+     else {
diff -r a96dd3198d2c -r bb13074027cf devel/creduce/patches/patch-clang__delta_SimplifyStruct.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/creduce/patches/patch-clang__delta_SimplifyStruct.cpp       Fri Nov 18 18:20:05 2016 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-clang__delta_SimplifyStruct.cpp,v 1.1 2016/11/18 18:20:05 joerg Exp $
+
+--- clang_delta/SimplifyStruct.cpp.orig        2016-11-17 01:56:34.000000000 +0000
++++ clang_delta/SimplifyStruct.cpp
+@@ -173,7 +173,7 @@ bool SimplifyStructRewriteVisitor::Visit
+ 
+   SourceLocation LBLoc =
+     ConsumerInstance->RewriteHelper->getLocationUntil(RD->getLocation(), '{');
+-  SourceLocation RBLoc = RD->getRBraceLoc();
++  SourceLocation RBLoc = RD->getBraceRange().getEnd();
+   ConsumerInstance->TheRewriter.RemoveText(SourceRange(LBLoc, RBLoc));
+   return true;
+ }
diff -r a96dd3198d2c -r bb13074027cf 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        Fri Nov 18 18:20:05 2016 +0000
@@ -0,0 +1,60 @@
+$NetBSD: patch-clang__delta_TransformationManager.cpp,v 1.1 2016/11/18 18:20:05 joerg Exp $
+
+--- clang_delta/TransformationManager.cpp.orig 2016-11-17 01:58:56.000000000 +0000
++++ clang_delta/TransformationManager.cpp
+@@ -82,6 +82,16 @@ bool TransformationManager::initializeCo
+ 
+   ClangInstance = new CompilerInstance();
+   assert(ClangInstance);
++
++  TargetOptions &TargetOpts = ClangInstance->getTargetOpts();
++  PreprocessorOptions &PPOpts = ClangInstance->getPreprocessorOpts();
++
++  if (const char *env = getenv("CREDUCE_TARGET_TRIPLE")) {
++    TargetOpts.Triple = std::string(env);
++  } else {
++    TargetOpts.Triple = LLVM_DEFAULT_TARGET_TRIPLE;
++  }
++  llvm::Triple Triple(TargetOpts.Triple);
+   
+   ClangInstance->createDiagnostics();
+ 
+@@ -89,13 +99,13 @@ bool TransformationManager::initializeCo
+   InputKind IK = FrontendOptions::getInputKindForExtension(
+         StringRef(SrcFileName).rsplit('.').second);
+   if ((IK == IK_C) || (IK == IK_PreprocessedC)) {
+-    Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_C);
++    Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_C, Triple, PPOpts);
+   }
+   else if ((IK == IK_CXX) || (IK == IK_PreprocessedCXX)) {
+     // 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(), IK_CXX);
++    Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_CXX, Triple, PPOpts);
+   }
+   else if(IK == IK_OpenCL) {
+     //Commandline parameters
+@@ -121,21 +131,13 @@ bool TransformationManager::initializeCo
+     CompilerInvocation::CreateFromArgs(Invocation,
+                                        &Args[0], &Args[0] + Args.size(),
+                                        ClangInstance->getDiagnostics());
+-    Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_OpenCL);
++    Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_OpenCL, Triple, PPOpts);
+   }
+   else {
+     ErrorMsg = "Unsupported file type!";
+     return false;
+   }
+ 
+-  TargetOptions &TargetOpts = ClangInstance->getTargetOpts();
+-
+-  if (const char *env = getenv("CREDUCE_TARGET_TRIPLE")) {
+-    TargetOpts.Triple = std::string(env);
+-  } else {
+-    TargetOpts.Triple = LLVM_DEFAULT_TARGET_TRIPLE;
+-  }
+-
+   TargetInfo *Target = 
+     TargetInfo::CreateTargetInfo(ClangInstance->getDiagnostics(),
+                                  ClangInstance->getInvocation().TargetOpts);



Home | Main Index | Thread Index | Old Index