[128644] trunk/dports/lang/llvm-3.5
jeremyhu at macports.org
jeremyhu at macports.org
Mon Nov 24 15:01:56 PST 2014
Revision: 128644
https://trac.macports.org/changeset/128644
Author: jeremyhu at macports.org
Date: 2014-11-24 15:01:56 -0800 (Mon, 24 Nov 2014)
Log Message:
-----------
clang-3.5: Pull in some upstream changes for C++ fixes (#45998)
Modified Paths:
--------------
trunk/dports/lang/llvm-3.5/Portfile
Added Paths:
-----------
trunk/dports/lang/llvm-3.5/files/0001-PR21536-Fix-a-corner-case-where-we-d-get-confused-by.patch
trunk/dports/lang/llvm-3.5/files/0002-PR19372-Keep-checking-template-arguments-after-we-se.patch
Modified: trunk/dports/lang/llvm-3.5/Portfile
===================================================================
--- trunk/dports/lang/llvm-3.5/Portfile 2014-11-24 22:58:52 UTC (rev 128643)
+++ trunk/dports/lang/llvm-3.5/Portfile 2014-11-24 23:01:56 UTC (rev 128644)
@@ -50,32 +50,32 @@
depends_lib port:llvm-${llvm_version} port:libffi port:python27
depends_run port:clang_select port:ld64
- depends_extract bin:svn:subversion
+ #depends_extract bin:svn:subversion
depends_build port:cctools
- depends_skip_archcheck-append cctools ld64 subversion
+ depends_skip_archcheck-append cctools ld64
default_variants +analyzer
}
-fetch.type svn
-svn.revision 216817
+#fetch.type svn
+#svn.revision 216817
-set compiler_rt_rev ${svn.revision}
-set libcxx_rev ${svn.revision}
-set clang-modernize_rev ${svn.revision}
-version ${llvm_version}-r${svn.revision}
+#set compiler_rt_rev ${svn.revision}
+#set libcxx_rev ${svn.revision}
+#set clang-modernize_rev ${svn.revision}
+#version ${llvm_version}-r${svn.revision}
#worksrcdir trunk
#svn.url https://llvm.org/svn/llvm-project/llvm/trunk
-worksrcdir release_${llvm_version_no_dot}
-svn.url https://llvm.org/svn/llvm-project/llvm/branches/release_${llvm_version_no_dot}
-default_variants-append +assertions
+#worksrcdir release_${llvm_version_no_dot}
+#svn.url https://llvm.org/svn/llvm-project/llvm/branches/release_${llvm_version_no_dot}
+#default_variants-append +assertions
-#version ${llvm_version}
-#epoch 1
-#master_sites http://llvm.org/releases/${version}
-#extract.suffix .tar.gz
-#distfiles llvm-${version}.src${extract.suffix}
-#worksrcdir llvm-${version}
+version ${llvm_version}.0
+epoch 1
+master_sites http://llvm.org/releases/${version}
+extract.suffix .tar.xz
+distfiles llvm-${version}.src${extract.suffix}
+worksrcdir llvm-${version}.src
if {${distfiles} != ""} {
if {${subport} == "llvm-${llvm_version}"} {
@@ -83,16 +83,37 @@
distfiles-append polly-${version}.src${extract.suffix}
}
} elseif {${subport} == "clang-${llvm_version}"} {
- distfiles-append clang-${version}.src${extract.suffix} compiler-rt-${version}.src${extract.suffix} libcxx-${version}.src${extract.suffix} clang-tools-extra-${version}.src${extract.suffix}
+ distfiles-append cfe-${version}.src${extract.suffix} compiler-rt-${version}.src${extract.suffix} libcxx-${version}.src${extract.suffix} clang-tools-extra-${version}.src${extract.suffix}
}
}
+checksums llvm-3.5.0.src.tar.xz \
+ rmd160 a50dc4e5a63c7bd38c48bf5ce766ebbb6f47e272 \
+ sha256 28e199f368ef0a4666708f31c7991ad3bcc3a578342b0306526dd35f07595c03 \
+ polly-3.5.0.src.tar.xz \
+ rmd160 eb90c130b6ef364a9bc0ff0b86aac9cf8634a019 \
+ sha256 f1f6aaaa375d522cc92cd922f3562bfdabf87269a520398479089374dad75a65 \
+ cfe-3.5.0.src.tar.xz \
+ rmd160 695592b5ef12ed602a4dd78f2dc2681058ca8253 \
+ sha256 fc80992e004b06f6c7afb612de1cdaa9ac9d25811c55f94fcf7331d9b81cdb8b \
+ compiler-rt-3.5.0.src.tar.xz \
+ rmd160 58aacb0b299721afb53cbd6c3fc9dc542b5b94be \
+ sha256 a4b3e655832bf8d9a357ea2c771db347237460e131988cbb96cda40ff39a8136 \
+ libcxx-3.5.0.src.tar.xz \
+ rmd160 ced5e8f98ba32ad792e77e5977b527d2e3388aa2 \
+ sha256 8045da845a63e50c201939eda8290d45e5752a9385d4d626214300d4a4d0b1c0 \
+ clang-tools-extra-3.5.0.src.tar.xz \
+ rmd160 28c64aacabae5d37f0ab32ddfe96d451e540e554 \
+ sha256 2981beb378afb5aa5c50ed017720a42a33e77e902c7086ad2d412ef4fa931f69
+
patchfiles install_target.patch
patch.pre_args -p1
if {${subport} == "clang-${llvm_version}"} {
patchfiles-append scan-build-PR-35006.patch \
+ 0001-PR21536-Fix-a-corner-case-where-we-d-get-confused-by.patch \
+ 0002-PR19372-Keep-checking-template-arguments-after-we-se.patch \
0001-Comment-out-SL-cctools-workaround.patch \
clang-format.patch \
clang-modernize.patch \
@@ -216,7 +237,7 @@
} elseif {${worksrcdir} == "release_${llvm_version_no_dot}" } {
system "cd ${worksrcpath}/tools && svn co -r ${svn.revision} http://llvm.org/svn/llvm-project/polly/branches/release_${llvm_version_no_dot} polly"
} else {
- file rename ${workpath}/polly-${llvm_version} ${worksrcpath}/tools/polly
+ file rename ${workpath}/polly-${version}.src ${worksrcpath}/tools/polly
}
}
} elseif {${subport} == "clang-${llvm_version}"} {
@@ -231,10 +252,10 @@
system "cd ${worksrcpath}/projects && svn co -r ${libcxx_rev} http://llvm.org/svn/llvm-project/libcxx/branches/release_${llvm_version_no_dot} libcxx"
system "cd ${worksrcpath}/tools/clang/tools && svn co -r ${clang-modernize_rev} http://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_${llvm_version_no_dot} extra"
} else {
- file rename ${workpath}/clang-${llvm_version} ${worksrcpath}/tools/clang
- file rename ${workpath}/compiler-rt-${llvm_version} ${worksrcpath}/projects/compiler-rt
- file rename ${workpath}/libcxx-${llvm_version} ${worksrcpath}/projects/libcxx
- file rename ${workpath}/clang-tools-extra-${llvm_version} ${worksrcpath}/tools/clang/tools/extra
+ file rename ${workpath}/cfe-${version}.src ${worksrcpath}/tools/clang
+ file rename ${workpath}/compiler-rt-${version}.src ${worksrcpath}/projects/compiler-rt
+ file rename ${workpath}/libcxx-${version}.src ${worksrcpath}/projects/libcxx
+ file rename ${workpath}/clang-tools-extra-${version}.src ${worksrcpath}/tools/clang/tools/extra
}
}
}
Added: trunk/dports/lang/llvm-3.5/files/0001-PR21536-Fix-a-corner-case-where-we-d-get-confused-by.patch
===================================================================
--- trunk/dports/lang/llvm-3.5/files/0001-PR21536-Fix-a-corner-case-where-we-d-get-confused-by.patch (rev 0)
+++ trunk/dports/lang/llvm-3.5/files/0001-PR21536-Fix-a-corner-case-where-we-d-get-confused-by.patch 2014-11-24 23:01:56 UTC (rev 128644)
@@ -0,0 +1,61 @@
+From f27355c10ce84f000530fbc5a22449047a095efc Mon Sep 17 00:00:00 2001
+From: Richard Smith <richard-llvm at metafoo.co.uk>
+Date: Wed, 12 Nov 2014 01:43:45 +0000
+Subject: [PATCH 1/2] PR21536: Fix a corner case where we'd get confused by a
+ pack expanding into the penultimate parameter of a template parameter list,
+ where the last parameter is itself a pack, and build a bogus empty final pack
+ argument.
+
+git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221748 91177308-0d34-0410-b5e6-96231b3b80d8
+(cherry picked from commit b6ff5628bec83cb58cdb9724584eeaf0a51fe81b)
+---
+ lib/Sema/SemaTemplate.cpp | 2 +-
+ test/SemaTemplate/deduction.cpp | 18 +++++++++++++++++-
+ 2 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
+index 63581a4..5596a01 100644
+--- a/tools/clang/lib/Sema/SemaTemplate.cpp
++++ b/tools/clang/lib/Sema/SemaTemplate.cpp
+@@ -3746,7 +3746,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
+ }
+
+ // Push the argument pack onto the list of converted arguments.
+- if (InFinalParameterPack) {
++ if (InFinalParameterPack && !ArgumentPack.empty()) {
+ Converted.push_back(
+ TemplateArgument::CreatePackCopy(Context,
+ ArgumentPack.data(),
+diff --git a/test/SemaTemplate/deduction.cpp b/test/SemaTemplate/deduction.cpp
+index aecb5ee..c089573 100644
+--- a/tools/clang/test/SemaTemplate/deduction.cpp
++++ b/tools/clang/test/SemaTemplate/deduction.cpp
+@@ -1,4 +1,4 @@
+-// RUN: %clang_cc1 -fsyntax-only -verify %s
++// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+
+ // Template argument deduction with template template parameters.
+ template<typename T, template<T> class A>
+@@ -162,3 +162,19 @@ namespace test14 {
+ foo(a);
+ }
+ }
++
++namespace PR21536 {
++ template<typename ...T> struct X;
++ template<typename A, typename ...B> struct S {
++ static_assert(sizeof...(B) == 1, "");
++ void f() {
++ using T = A;
++ using T = int;
++
++ using U = X<B...>;
++ using U = X<int>;
++ }
++ };
++ template<typename ...T> void f(S<T...>);
++ void g() { f(S<int, int>()); }
++}
+--
+2.1.3
+
Added: trunk/dports/lang/llvm-3.5/files/0002-PR19372-Keep-checking-template-arguments-after-we-se.patch
===================================================================
--- trunk/dports/lang/llvm-3.5/files/0002-PR19372-Keep-checking-template-arguments-after-we-se.patch (rev 0)
+++ trunk/dports/lang/llvm-3.5/files/0002-PR19372-Keep-checking-template-arguments-after-we-se.patch 2014-11-24 23:01:56 UTC (rev 128644)
@@ -0,0 +1,109 @@
+From 0019dadd93e1e38476b9c115470409c7f9fc3899 Mon Sep 17 00:00:00 2001
+From: Richard Smith <richard-llvm at metafoo.co.uk>
+Date: Wed, 12 Nov 2014 23:38:38 +0000
+Subject: [PATCH 2/2] PR19372: Keep checking template arguments after we see an
+ argument pack expansion into a parameter pack; we know that we're still
+ filling in that parameter's arguments. Previously, if we hit this case for an
+ alias template, we'd try to substitute using non-canonical template
+ arguments.
+
+git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221832 91177308-0d34-0410-b5e6-96231b3b80d8
+(cherry picked from commit 4e0b4321c8311bb0bf3dea530405960dbca97a9d)
+---
+ lib/Sema/SemaTemplate.cpp | 39 +++++++++++----------------------------
+ test/SemaTemplate/deduction.cpp | 14 ++++++++++++++
+ 2 files changed, 25 insertions(+), 28 deletions(-)
+
+diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
+index 5596a01..7e8f0b7 100644
+--- a/tools/clang/lib/Sema/SemaTemplate.cpp
++++ b/tools/clang/lib/Sema/SemaTemplate.cpp
+@@ -3692,12 +3692,12 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
+ ArgumentPack.size(), Converted))
+ return true;
+
+- if (TemplateArgs[ArgIdx].getArgument().isPackExpansion() &&
+- isa<TypeAliasTemplateDecl>(Template) &&
+- !(Param + 1 == ParamEnd && (*Param)->isTemplateParameterPack() &&
+- !getExpandedPackSize(*Param))) {
++ bool PackExpansionIntoNonPack =
++ TemplateArgs[ArgIdx].getArgument().isPackExpansion() &&
++ (!(*Param)->isTemplateParameterPack() || getExpandedPackSize(*Param));
++ if (PackExpansionIntoNonPack && isa<TypeAliasTemplateDecl>(Template)) {
+ // Core issue 1430: we have a pack expansion as an argument to an
+- // alias template, and it's not part of a final parameter pack. This
++ // alias template, and it's not part of a parameter pack. This
+ // can't be canonicalized, so reject it now.
+ Diag(TemplateArgs[ArgIdx].getLocation(),
+ diag::err_alias_template_expansion_into_fixed_list)
+@@ -3720,16 +3720,11 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
+ ++Param;
+ }
+
+- // If we just saw a pack expansion, then directly convert the remaining
+- // arguments, because we don't know what parameters they'll match up
+- // with.
+- if (TemplateArgs[ArgIdx-1].getArgument().isPackExpansion()) {
+- bool InFinalParameterPack = Param != ParamEnd &&
+- Param + 1 == ParamEnd &&
+- (*Param)->isTemplateParameterPack() &&
+- !getExpandedPackSize(*Param);
+-
+- if (!InFinalParameterPack && !ArgumentPack.empty()) {
++ // If we just saw a pack expansion into a non-pack, then directly convert
++ // the remaining arguments, because we don't know what parameters they'll
++ // match up with.
++ if (PackExpansionIntoNonPack) {
++ if (!ArgumentPack.empty()) {
+ // If we were part way through filling in an expanded parameter pack,
+ // fall back to just producing individual arguments.
+ Converted.insert(Converted.end(),
+@@ -3738,22 +3733,10 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
+ }
+
+ while (ArgIdx < NumArgs) {
+- if (InFinalParameterPack)
+- ArgumentPack.push_back(TemplateArgs[ArgIdx].getArgument());
+- else
+- Converted.push_back(TemplateArgs[ArgIdx].getArgument());
++ Converted.push_back(TemplateArgs[ArgIdx].getArgument());
+ ++ArgIdx;
+ }
+
+- // Push the argument pack onto the list of converted arguments.
+- if (InFinalParameterPack && !ArgumentPack.empty()) {
+- Converted.push_back(
+- TemplateArgument::CreatePackCopy(Context,
+- ArgumentPack.data(),
+- ArgumentPack.size()));
+- ArgumentPack.clear();
+- }
+-
+ return false;
+ }
+
+diff --git a/test/SemaTemplate/deduction.cpp b/test/SemaTemplate/deduction.cpp
+index c089573..e942289 100644
+--- a/tools/clang/test/SemaTemplate/deduction.cpp
++++ b/tools/clang/test/SemaTemplate/deduction.cpp
+@@ -178,3 +178,17 @@ namespace PR21536 {
+ template<typename ...T> void f(S<T...>);
+ void g() { f(S<int, int>()); }
+ }
++
++namespace PR19372 {
++ template <template<typename...> class C, typename ...Us> struct BindBack {
++ template <typename ...Ts> using apply = C<Ts..., Us...>;
++ };
++ template <typename, typename...> struct Y;
++ template <typename ...Ts> using Z = Y<Ts...>;
++
++ using T = BindBack<Z, int>::apply<>;
++ using T = Z<int>;
++
++ using U = BindBack<Z, int, int>::apply<char>;
++ using U = Z<char, int, int>;
++}
+--
+2.1.3
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20141124/fb2563a9/attachment.html>
More information about the macports-changes
mailing list