[libcxx] r304425 - Creating release candidate rc2 from release_401 branch

2017-06-01 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Jun  1 11:29:42 2017
New Revision: 304425

URL: http://llvm.org/viewvc/llvm-project?rev=304425&view=rev
Log:
Creating release candidate rc2 from release_401 branch

Added:
libcxx/tags/RELEASE_401/rc2/   (props changed)
  - copied from r304424, libcxx/branches/release_40/

Propchange: libcxx/tags/RELEASE_401/rc2/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jun  1 11:29:42 2017
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:292013,292091,292607,292990,293154,293197,293581,294133,294142,294431


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r304426 - Creating release candidate rc2 from release_401 branch

2017-06-01 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Jun  1 11:29:45 2017
New Revision: 304426

URL: http://llvm.org/viewvc/llvm-project?rev=304426&view=rev
Log:
Creating release candidate rc2 from release_401 branch

Added:
libcxxabi/tags/RELEASE_401/rc2/   (props changed)
  - copied from r304425, libcxxabi/branches/release_40/

Propchange: libcxxabi/tags/RELEASE_401/rc2/
--
svn:mergeinfo = /libcxxabi/trunk:292135,292418,292638


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r304432 - Creating release candidate rc2 from release_401 branch

2017-06-01 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Jun  1 11:30:02 2017
New Revision: 304432

URL: http://llvm.org/viewvc/llvm-project?rev=304432&view=rev
Log:
Creating release candidate rc2 from release_401 branch

Added:
libunwind/tags/RELEASE_401/rc2/   (props changed)
  - copied from r304431, libunwind/branches/release_40/

Propchange: libunwind/tags/RELEASE_401/rc2/
--
svn:mergeinfo = /libunwind/trunk:292723,296358-296359


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r305352 - Creating release candidate rc3 from release_401 branch

2017-06-13 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Jun 13 20:04:51 2017
New Revision: 305352

URL: http://llvm.org/viewvc/llvm-project?rev=305352&view=rev
Log:
Creating release candidate rc3 from release_401 branch

Added:
libcxx/tags/RELEASE_401/rc3/   (props changed)
  - copied from r305351, libcxx/branches/release_40/

Propchange: libcxx/tags/RELEASE_401/rc3/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Jun 13 20:04:51 2017
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:292013,292091,292607,292990,293154,293197,293581,294133,294142,294431


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r305359 - Creating release candidate rc3 from release_401 branch

2017-06-13 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Jun 13 20:05:11 2017
New Revision: 305359

URL: http://llvm.org/viewvc/llvm-project?rev=305359&view=rev
Log:
Creating release candidate rc3 from release_401 branch

Added:
libunwind/tags/RELEASE_401/rc3/   (props changed)
  - copied from r305358, libunwind/branches/release_40/

Propchange: libunwind/tags/RELEASE_401/rc3/
--
svn:mergeinfo = /libunwind/trunk:292723,296358-296359


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r305353 - Creating release candidate rc3 from release_401 branch

2017-06-13 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Jun 13 20:04:54 2017
New Revision: 305353

URL: http://llvm.org/viewvc/llvm-project?rev=305353&view=rev
Log:
Creating release candidate rc3 from release_401 branch

Added:
libcxxabi/tags/RELEASE_401/rc3/   (props changed)
  - copied from r305352, libcxxabi/branches/release_40/

Propchange: libcxxabi/tags/RELEASE_401/rc3/
--
svn:mergeinfo = /libcxxabi/trunk:292135,292418,292638


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r305829 - Creating release candidate final from release_401 branch

2017-06-20 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Jun 20 14:29:48 2017
New Revision: 305829

URL: http://llvm.org/viewvc/llvm-project?rev=305829&view=rev
Log:
Creating release candidate final from release_401 branch

Added:
libcxx/tags/RELEASE_401/final/   (props changed)
  - copied from r305828, libcxx/branches/release_40/

Propchange: libcxx/tags/RELEASE_401/final/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Jun 20 14:29:48 2017
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:292013,292091,292607,292990,293154,293197,293581,294133,294142,294431


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r305830 - Creating release candidate final from release_401 branch

2017-06-20 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Jun 20 14:29:53 2017
New Revision: 305830

URL: http://llvm.org/viewvc/llvm-project?rev=305830&view=rev
Log:
Creating release candidate final from release_401 branch

Added:
libcxxabi/tags/RELEASE_401/final/   (props changed)
  - copied from r305829, libcxxabi/branches/release_40/

Propchange: libcxxabi/tags/RELEASE_401/final/
--
svn:mergeinfo = /libcxxabi/trunk:292135,292418,292638


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r305836 - Creating release candidate final from release_401 branch

2017-06-20 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Jun 20 14:30:24 2017
New Revision: 305836

URL: http://llvm.org/viewvc/llvm-project?rev=305836&view=rev
Log:
Creating release candidate final from release_401 branch

Added:
libunwind/tags/RELEASE_401/final/   (props changed)
  - copied from r305835, libunwind/branches/release_40/

Propchange: libunwind/tags/RELEASE_401/final/
--
svn:mergeinfo = /libunwind/trunk:292723,296358-296359


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r320873 - Creating release candidate final from release_501 branch

2017-12-15 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Dec 15 14:17:48 2017
New Revision: 320873

URL: http://llvm.org/viewvc/llvm-project?rev=320873&view=rev
Log:
Creating release candidate final from release_501 branch

Added:
libcxx/tags/RELEASE_501/final/   (props changed)
  - copied from r320872, libcxx/branches/release_50/

Propchange: libcxx/tags/RELEASE_501/final/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Dec 15 14:17:48 2017
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:309296,309307,309474,309838,309851,309917,309920


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r320874 - Creating release candidate final from release_501 branch

2017-12-15 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Dec 15 14:18:28 2017
New Revision: 320874

URL: http://llvm.org/viewvc/llvm-project?rev=320874&view=rev
Log:
Creating release candidate final from release_501 branch

Added:
libcxxabi/tags/RELEASE_501/final/
  - copied from r320873, libcxxabi/branches/release_50/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r320880 - Creating release candidate final from release_501 branch

2017-12-15 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Dec 15 14:19:37 2017
New Revision: 320880

URL: http://llvm.org/viewvc/llvm-project?rev=320880&view=rev
Log:
Creating release candidate final from release_501 branch

Added:
libunwind/tags/RELEASE_501/final/   (props changed)
  - copied from r320879, libunwind/branches/release_50/

Propchange: libunwind/tags/RELEASE_501/final/
--
svn:mergeinfo = /libunwind/trunk:308871,309147


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r327099 - PR36645: Go looking for an appropriate array bound when constant-evaluating a

2018-03-08 Thread Tom Stellard via cfe-commits
On 03/08/2018 06:03 PM, Richard Smith wrote:
> Might be a good candidate for Clang 6.0.1.
> 

Merge request created: https://llvm.org/PR36655

-Tom

> On 8 March 2018 at 18:00, Richard Smith via cfe-commits 
> mailto:cfe-commits@lists.llvm.org>> wrote:
> 
> Author: rsmith
> Date: Thu Mar  8 18:00:01 2018
> New Revision: 327099
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=327099&view=rev 
> 
> Log:
> PR36645: Go looking for an appropriate array bound when 
> constant-evaluating a
> name of an array object.
> 
> Modified:
> cfe/trunk/lib/AST/ExprConstant.cpp
> cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp
> 
> Modified: cfe/trunk/lib/AST/ExprConstant.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=327099&r1=327098&r2=327099&view=diff
>  
> 
> 
> ==
> --- cfe/trunk/lib/AST/ExprConstant.cpp (original)
> +++ cfe/trunk/lib/AST/ExprConstant.cpp Thu Mar  8 18:00:01 2018
> @@ -63,14 +63,22 @@ namespace {
> 
>static QualType getType(APValue::LValueBase B) {
>  if (!B) return QualType();
> -if (const ValueDecl *D = B.dyn_cast())
> +if (const ValueDecl *D = B.dyn_cast()) {
>// FIXME: It's unclear where we're supposed to take the type from, 
> and
> -  // this actually matters for arrays of unknown bound. Using the 
> type of
> -  // the most recent declaration isn't clearly correct in general. 
> Eg:
> +  // this actually matters for arrays of unknown bound. Eg:
>//
>// extern int arr[]; void f() { extern int arr[3]; };
>// constexpr int *p = &arr[1]; // valid?
> -  return cast(D->getMostRecentDecl())->getType();
> +  //
> +  // For now, we take the array bound from the most recent 
> declaration.
> +  for (auto *Redecl = cast(D->getMostRecentDecl()); 
> Redecl;
> +   Redecl = cast_or_null(Redecl->getPreviousDecl())) {
> +QualType T = Redecl->getType();
> +if (!T->isIncompleteArrayType())
> +  return T;
> +  }
> +  return D->getType();
> +}
> 
>  const Expr *Base = B.get();
> 
> 
> Modified: cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp?rev=327099&r1=327098&r2=327099&view=diff
>  
> 
> 
> ==
> --- cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp (original)
> +++ cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp Thu Mar  8 
> 18:00:01 2018
> @@ -629,6 +629,10 @@ namespace ArrayOfUnknownBound {
> 
>extern const int carr[]; // expected-note {{here}}
>constexpr int n = carr[0]; // expected-error {{constant}} 
> expected-note {{non-constexpr variable}}
> +
> +  constexpr int local_extern[] = {1, 2, 3};
> +  void f() { extern const int local_extern[]; }
> +  static_assert(local_extern[1] == 2, "");
>  }
> 
>  namespace DependentValues {
> 
> 
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org 
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits 
> 
> 
> 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r333910 - Merging r333467:

2018-06-04 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun  4 08:49:27 2018
New Revision: 333910

URL: http://llvm.org/viewvc/llvm-project?rev=333910&view=rev
Log:
Merging r333467:


r333467 | marshall | 2018-05-29 15:25:42 -0700 (Tue, 29 May 2018) | 1 line

Fix embarrasing typo in uncaught_exceptions. Update tests to really test this. 
Thanks to Peter Klotz for calling my attention to this.


Modified:
libcxx/branches/release_60/src/support/runtime/exception_libcxxabi.ipp

libcxx/branches/release_60/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp

Modified: libcxx/branches/release_60/src/support/runtime/exception_libcxxabi.ipp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/branches/release_60/src/support/runtime/exception_libcxxabi.ipp?rev=333910&r1=333909&r2=333910&view=diff
==
--- libcxx/branches/release_60/src/support/runtime/exception_libcxxabi.ipp 
(original)
+++ libcxx/branches/release_60/src/support/runtime/exception_libcxxabi.ipp Mon 
Jun  4 08:49:27 2018
@@ -18,7 +18,7 @@ bool uncaught_exception() _NOEXCEPT { re
 
 int uncaught_exceptions() _NOEXCEPT
 {
-# if _LIBCPPABI_VERSION > 1101
+# if _LIBCPPABI_VERSION > 1001
 return __cxa_uncaught_exceptions();
 # else
 return __cxa_uncaught_exception() ? 1 : 0;

Modified: 
libcxx/branches/release_60/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/branches/release_60/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp?rev=333910&r1=333909&r2=333910&view=diff
==
--- 
libcxx/branches/release_60/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
 (original)
+++ 
libcxx/branches/release_60/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
 Mon Jun  4 08:49:27 2018
@@ -15,40 +15,48 @@
 // XFAIL: availability=macosx10.9
 // XFAIL: availability=macosx10.10
 // XFAIL: availability=macosx10.11
+// XFAIL: with_system_cxx_lib=macosx10.12
+// XFAIL: with_system_cxx_lib=macosx10.13
 
 // test uncaught_exceptions
 
 #include 
 #include 
 
-struct A
-{
-~A()
-{
-assert(std::uncaught_exceptions() > 0);
-}
-};
+struct Uncaught {
+Uncaught(int depth) : d_(depth) {}
+~Uncaught() { assert(std::uncaught_exceptions() == d_); }
+int d_;
+};
 
-struct B
-{
-B()
-{
-// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475
-assert(std::uncaught_exceptions() == 0);
+struct Outer {
+Outer(int depth) : d_(depth) {}
+~Outer() {
+try {
+assert(std::uncaught_exceptions() == d_);
+Uncaught u(d_+1);
+throw 2;
 }
+catch (int) {}
+}
+int d_;
 };
 
-int main()
-{
-try
+int main () {
+assert(std::uncaught_exceptions() == 0);
 {
-A a;
-assert(std::uncaught_exceptions() == 0);
-throw B();
+Outer o(0);
 }
-catch (...)
+
+assert(std::uncaught_exceptions() == 0);
 {
-assert(std::uncaught_exception() == 0);
+try {
+Outer o(1);
+throw 1;
+}
+catch (int) {
+assert(std::uncaught_exceptions() == 0);
+}   
 }
 assert(std::uncaught_exceptions() == 0);
 }


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r333922 - Creating release candidate rc2 from release_601 branch

2018-06-04 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun  4 08:54:00 2018
New Revision: 333922

URL: http://llvm.org/viewvc/llvm-project?rev=333922&view=rev
Log:
Creating release candidate rc2 from release_601 branch

Added:
libunwind/tags/RELEASE_601/rc2/
  - copied from r333921, libunwind/branches/release_60/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r333915 - Creating release candidate rc2 from release_601 branch

2018-06-04 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun  4 08:53:28 2018
New Revision: 333915

URL: http://llvm.org/viewvc/llvm-project?rev=333915&view=rev
Log:
Creating release candidate rc2 from release_601 branch

Added:
libcxx/tags/RELEASE_601/rc2/   (props changed)
  - copied from r333914, libcxx/branches/release_60/

Propchange: libcxx/tags/RELEASE_601/rc2/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Mon Jun  4 08:53:28 2018
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:321963,324153,324855,325147


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r333916 - Creating release candidate rc2 from release_601 branch

2018-06-04 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun  4 08:53:32 2018
New Revision: 333916

URL: http://llvm.org/viewvc/llvm-project?rev=333916&view=rev
Log:
Creating release candidate rc2 from release_601 branch

Added:
libcxxabi/tags/RELEASE_601/rc2/
  - copied from r333915, libcxxabi/branches/release_60/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r334621 - Merging r323390:

2018-06-13 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Jun 13 09:57:18 2018
New Revision: 334621

URL: http://llvm.org/viewvc/llvm-project?rev=334621&view=rev
Log:
Merging r323390:


r323390 | ericwf | 2018-01-24 16:02:48 -0800 (Wed, 24 Jan 2018) | 9 lines

Fix PR35564 - std::list splice/erase incorrectly throw in debug mode.

There was a bug in the implementation of splice where the container
sizes were updated before decrementing one of the iterators. Afterwards,
the result of decrementing the iterator was flagged as UB by the debug
implementation because the container was reported to be empty.

This patch fixes that bug by delaying the updating of the container
sizes until after the iterators have been correctly constructed.


Modified:
libcxx/branches/release_60/include/list

libcxx/branches/release_60/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp

Modified: libcxx/branches/release_60/include/list
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/branches/release_60/include/list?rev=334621&r1=334620&r2=334621&view=diff
==
--- libcxx/branches/release_60/include/list (original)
+++ libcxx/branches/release_60/include/list Wed Jun 13 09:57:18 2018
@@ -2058,15 +2058,15 @@ list<_Tp, _Alloc>::splice(const_iterator
 #endif
 if (__f != __l)
 {
+__link_pointer __first = __f.__ptr_;
+--__l;
+__link_pointer __last = __l.__ptr_;
 if (this != &__c)
 {
-size_type __s = _VSTD::distance(__f, __l);
+size_type __s = _VSTD::distance(__f, __l) + 1;
 __c.__sz() -= __s;
 base::__sz() += __s;
 }
-__link_pointer __first = __f.__ptr_;
---__l;
-__link_pointer __last = __l.__ptr_;
 base::__unlink_nodes(__first, __last);
 __link_nodes(__p.__ptr_, __first, __last);
 #if _LIBCPP_DEBUG_LEVEL >= 2

Modified: 
libcxx/branches/release_60/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/branches/release_60/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp?rev=334621&r1=334620&r2=334621&view=diff
==
--- 
libcxx/branches/release_60/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
 (original)
+++ 
libcxx/branches/release_60/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
 Wed Jun 13 09:57:18 2018
@@ -42,6 +42,7 @@ public:
 Base::run();
 try {
   FrontOnEmptyContainer();
+
   if constexpr (CT != CT_ForwardList) {
 AssignInvalidates();
 BackOnEmptyContainer();
@@ -50,6 +51,8 @@ public:
 InsertIterIterIter();
 EmplaceIterValue();
 EraseIterIter();
+  } else {
+SpliceFirstElemAfter();
   }
   if constexpr (CT == CT_Vector || CT == CT_Deque || CT == CT_List) {
 PopBack();
@@ -57,12 +60,66 @@ public:
   if constexpr (CT == CT_List || CT == CT_Deque) {
 PopFront(); // FIXME: Run with forward list as well
   }
+  if constexpr (CT == CT_List || CT == CT_ForwardList) {
+RemoveFirstElem();
+  }
+  if constexpr (CT == CT_List) {
+SpliceFirstElem();
+  }
 } catch (...) {
   assert(false && "uncaught debug exception");
 }
   }
 
 private:
+  static void RemoveFirstElem() {
+// See llvm.org/PR35564
+CHECKPOINT("remove()");
+{
+  Container C = makeContainer(1);
+  auto FirstVal = *(C.begin());
+  C.remove(FirstVal);
+  assert(C.empty());
+}
+{
+  Container C = {1, 1, 1, 1};
+  auto FirstVal = *(C.begin());
+  C.remove(FirstVal);
+  assert(C.empty());
+}
+  }
+
+  static void SpliceFirstElem() {
+// See llvm.org/PR35564
+CHECKPOINT("splice()");
+{
+  Container C = makeContainer(1);
+  Container C2;
+  C2.splice(C2.end(), C, C.begin(), ++C.begin());
+}
+{
+  Container C = makeContainer(1);
+  Container C2;
+  C2.splice(C2.end(), C, C.begin());
+}
+  }
+
+
+  static void SpliceFirstElemAfter() {
+// See llvm.org/PR35564
+CHECKPOINT("splice()");
+{
+  Container C = makeContainer(1);
+  Container C2;
+  C2.splice_after(C2.begin(), C, C.begin(), ++C.begin());
+}
+{
+  Container C = makeContainer(1);
+  Container C2;
+  C2.splice_after(C2.begin(), C, C.begin());
+}
+  }
+
   static void AssignInvalidates() {
 CHECKPOINT("assign(Size, Value)");
 Container C(allocator_type{});


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r334791 - Creating release candidate rc3 from release_601 branch

2018-06-14 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Jun 14 22:05:12 2018
New Revision: 334791

URL: http://llvm.org/viewvc/llvm-project?rev=334791&view=rev
Log:
Creating release candidate rc3 from release_601 branch

Added:
libcxx/tags/RELEASE_601/rc3/   (props changed)
  - copied from r334790, libcxx/branches/release_60/

Propchange: libcxx/tags/RELEASE_601/rc3/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jun 14 22:05:12 2018
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:321963,324153,324855,325147


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r334792 - Creating release candidate rc3 from release_601 branch

2018-06-14 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Jun 14 22:05:16 2018
New Revision: 334792

URL: http://llvm.org/viewvc/llvm-project?rev=334792&view=rev
Log:
Creating release candidate rc3 from release_601 branch

Added:
libcxxabi/tags/RELEASE_601/rc3/
  - copied from r334791, libcxxabi/branches/release_60/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r334798 - Creating release candidate rc3 from release_601 branch

2018-06-14 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Jun 14 22:05:43 2018
New Revision: 334798

URL: http://llvm.org/viewvc/llvm-project?rev=334798&view=rev
Log:
Creating release candidate rc3 from release_601 branch

Added:
libunwind/tags/RELEASE_601/rc3/
  - copied from r334797, libunwind/branches/release_60/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r345947 - Creating release candidate rc1 from release_701 branch

2018-11-01 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Nov  1 20:02:31 2018
New Revision: 345947

URL: http://llvm.org/viewvc/llvm-project?rev=345947&view=rev
Log:
Creating release candidate rc1 from release_701 branch

Added:
libunwind/tags/RELEASE_701/rc1/   (props changed)
  - copied from r345946, libunwind/branches/release_70/

Propchange: libunwind/tags/RELEASE_701/rc1/
--
svn:mergeinfo = /libunwind/trunk:339217


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r345946 - Creating release directory for release_701.

2018-11-01 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Nov  1 20:02:29 2018
New Revision: 345946

URL: http://llvm.org/viewvc/llvm-project?rev=345946&view=rev
Log:
Creating release directory for release_701.

Added:
libunwind/tags/RELEASE_701/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r346022 - Creating release candidate rc2 from release_701 branch

2018-11-02 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Nov  2 11:09:42 2018
New Revision: 346022

URL: http://llvm.org/viewvc/llvm-project?rev=346022&view=rev
Log:
Creating release candidate rc2 from release_701 branch

Added:
libunwind/tags/RELEASE_701/rc2/   (props changed)
  - copied from r346021, libunwind/branches/release_70/

Propchange: libunwind/tags/RELEASE_701/rc2/
--
svn:mergeinfo = /libunwind/trunk:339217


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r346731 - CMake: Replace open-coded find_package

2018-11-12 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Nov 12 19:16:45 2018
New Revision: 346731

URL: http://llvm.org/viewvc/llvm-project?rev=346731&view=rev
Log:
CMake: Replace open-coded find_package

Reviewers: beanz, mgorny

Reviewed By: mgorny

Subscribers: cfe-commits, chapuni, llvm-commits

Differential Revision: https://reviews.llvm.org/D32577

Modified:
cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=346731&r1=346730&r2=346731&view=diff
==
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Mon Nov 12 19:16:45 2018
@@ -68,13 +68,8 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
 NO_DEFAULT_PATH)
 
-  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
-  if(EXISTS ${LLVMCONFIG_FILE})
-list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
-include(${LLVMCONFIG_FILE})
-  else()
-message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
-  endif()
+  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
+  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
 
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r346732 - CMake: Deprecate using llvm-config to detect llvm installation

2018-11-12 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Nov 12 19:42:46 2018
New Revision: 346732

URL: http://llvm.org/viewvc/llvm-project?rev=346732&view=rev
Log:
CMake: Deprecate using llvm-config to detect llvm installation

Summary:
clang currently uses llvm-config to determine the installation paths
for llvm's headers and binaries.  clang is also using LLVM's cmake
files to determine other information about the LLVM build, like
LLVM_LIBDIR_SUFFIX, LLVM_VERSION_*, etc.  Since the installation
paths are also available via the cmake files, we can simplify the code
by only relying on information from cmake about the LLVM install and
dropping the use of llvm-config altogether.

In addition to simplifying the code, the cmake files have more
accurate information about the llvm installation paths.  llvm-config
assumes that the lib, bin, and cmake directories are always located
in the same place relative to the path of the llvm-config executable.
This can be wrong if a user decides to install headers, binaries
or libraries to a non-standard location: e.g. static libraries
installed to /usr/lib/llvm6.0/

This patch takes the first step towards dropping llvm-config by
removing the automatic detection of llvm-config (users can still
manually supply a path to llvm-config by passing
-DLLVM_CONFIG=/usr/bin/llvm-config to cmake) and adding a
deprecation warning when users try to use this option.

Reviewers: chandlerc, beanz, mgorny, chapuni

Subscribers: mehdi_amini, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D51714

Modified:
cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=346732&r1=346731&r2=346732&view=diff
==
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Mon Nov 12 19:42:46 2018
@@ -11,9 +11,14 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
 
   # Rely on llvm-config.
   set(CONFIG_OUTPUT)
-  find_program(LLVM_CONFIG "llvm-config")
   if(LLVM_CONFIG)
+set (LLVM_CONFIG_FOUND 1)
 message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
+message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
+  deprecated.  The installed cmake files should be used \
+  instead.  CMake should be able to detect your LLVM install \
+  automatically, but you can also use LLVM_DIR to specify \
+  the path containing LLVMConfig.cmake.")
 set(CONFIG_COMMAND ${LLVM_CONFIG}
   "--assertion-mode"
   "--bindir"
@@ -36,17 +41,20 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   message(STATUS "${CONFIG_COMMAND_STR}")
   message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
 endif()
-  else()
-message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
+
+list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
+list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
+list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
+list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
+list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
+list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
+list(GET CONFIG_OUTPUT 6 LLVM_CONFIG_CMAKE_PATH)
+
+# Normalize LLVM_CMAKE_PATH. --cmakedir might contain backslashes.
+# CMake assumes slashes as PATH.
+file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_PATH)
   endif()
 
-  list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
-  list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
-  list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
-  list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
-  list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
-  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
-  list(GET CONFIG_OUTPUT 6 LLVM_CONFIG_CMAKE_PATH)
 
   if(NOT MSVC_IDE)
 set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
@@ -55,22 +63,29 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
 mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
   endif()
 
+  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
+  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
+
+  # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
+  # LLVM_CONFIG.
+  if (NOT LLVM_CONFIG_FOUND)
+# Pull values from LLVMConfig.cmake.  We can drop this once the llvm-config
+# path is removed.
+set(TOOLS_BINARY_DIR ${LLVM_TOOLS_BINARY_DIR})
+set(LIBRARY_DIR ${LLVM_LIBRARY_DIR})
+set(INCLUDE_DIR ${LLVM_INCLUDE_DIR})
+set(LLVM_OBJ_DIR ${LLVM_BINARY_DIR})
+  endif()
+
   set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
   set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
   set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
   set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
   set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
 
-  # Normalize LLVM_CMAKE_PATH. --cmakedir might contain backslashes.
-  # CMake assumes slashes as PATH.
-  file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_PATH)
-
   find_program(LLVM_TABLEGEN_EXE

Re: r341697 - warn_stdlibcxx_not_found: suggest '-stdlib=libc++' instead of '-std'

2018-11-19 Thread Tom Stellard via cfe-commits
On 11/17/2018 06:48 PM, Shoaib Meenai wrote:
> Could we merge this into 7.0.1? It's a trivial typo fix, and the error 
> message could otherwise be confusing to users (someone brought this up in IRC 
> a few hours ago).
> 

Sure, I've opened a tracking bug and will make sure it gets merged:
https://bugs.llvm.org/show_bug.cgi?id=39708

-Tom
>  
> 
> *From: *cfe-commits  on behalf of Alex 
> Lorenz via cfe-commits 
> *Reply-To: *Alex Lorenz 
> *Date: *Friday, September 7, 2018 at 12:01 PM
> *To: *"cfe-commits@lists.llvm.org" 
> *Subject: *r341697 - warn_stdlibcxx_not_found: suggest '-stdlib=libc++' 
> instead of '-std'
> 
>  
> 
> Author: arphaman
> 
> Date: Fri Sep  7 11:59:45 2018
> 
> New Revision: 341697
> 
>  
> 
> URL: 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D341697-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=IqJdIRn5MxFdIr2LEpZYhRLQTay50tZijNg6klhhdRA&s=MYePhuYEkBYd5aK7fqamBrBRJJGtvC-BPPojLInHah8&e=
> 
> Log:
> 
> warn_stdlibcxx_not_found: suggest '-stdlib=libc++' instead of '-std'
> 
>  
> 
> Addresses first post-commit feedback for r335081 from Nico
> 
>  
> 
> Modified:
> 
> cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
> 
> cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp
> 
>  
> 
> Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
> 
> URL: 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_include_clang_Basic_DiagnosticFrontendKinds.td-3Frev-3D341697-26r1-3D341696-26r2-3D341697-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=IqJdIRn5MxFdIr2LEpZYhRLQTay50tZijNg6klhhdRA&s=ZQcIenU2yQH3SmDrAhdXm2VKI10aP3_5IoBH-72HxYA&e=
> 
> ==
> 
> --- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)
> 
> +++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Fri Sep  7 
> 11:59:45 2018
> 
> @@ -238,7 +238,7 @@ def warn_option_invalid_ocl_version : Wa
> 
>"OpenCL version %0 does not support the option '%1'">, InGroup;
> 
> def warn_stdlibcxx_not_found : Warning<
> 
> -  "include path for stdlibc++ headers not found; pass '-std=libc++' on the "
> 
> +  "include path for stdlibc++ headers not found; pass '-stdlib=libc++' on 
> the "
> 
>"command line to use the libc++ standard library instead">,
> 
>InGroup>;
> 
> }
> 
>  
> 
> Modified: cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp
> 
> URL: 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_test_Frontend_warning-2Dstdlibcxx-2Ddarwin.cpp-3Frev-3D341697-26r1-3D341696-26r2-3D341697-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=IqJdIRn5MxFdIr2LEpZYhRLQTay50tZijNg6klhhdRA&s=YR_ENMKZ9M1ESvYMVXN6PlRtSZ8bXMsfvYf8QaBm5X4&e=
> 
> ==
> 
> --- cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp (original)
> 
> +++ cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp Fri Sep  7 11:59:45 
> 2018
> 
> @@ -1,5 +1,5 @@
> 
> // RUN: %clang -cc1 -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist %s 
> 2>&1 | FileCheck %s
> 
> // RUN: %clang -cc1 -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist 
> -stdlib=libc++ %s -verify
> 
> -// CHECK: include path for stdlibc++ headers not found; pass '-std=libc++' 
> on the command line to use the libc++ standard library instead
> 
> +// CHECK: include path for stdlibc++ headers not found; pass 
> '-stdlib=libc++' on the command line to use the libc++ standard library 
> instead
> 
> // expected-no-diagnostics
> 
>  
> 
>  
> 
> ___
> 
> cfe-commits mailing list
> 
> cfe-commits@lists.llvm.org 
> 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Dcommits&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=IqJdIRn5MxFdIr2LEpZYhRLQTay50tZijNg6klhhdRA&s=Q8IVygsR4GuCJTOTCl7xRLj0JSxkuoS-q2HhesuNe4U&e=
> 
>  
> 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r341697 - warn_stdlibcxx_not_found: suggest '-stdlib=libc++' instead of '-std'

2018-11-19 Thread Tom Stellard via cfe-commits
On 11/17/2018 08:28 PM, Richard Smith wrote:
> Procedurally, we shouldn't be making other changes at the same time as a 
> backport, but I'd sure like to see "stdlibc++" replaced with the correct 
> "libstdc++" (on trunk and branch).
> 

When this gets fixes in trunk, let me know I can merge it to the branch.

-Tom
> On Sat, 17 Nov 2018, 19:00 Arthur O'Dwyer via cfe-commits 
> mailto:cfe-commits@lists.llvm.org> wrote:
> 
> Peanut gallery says: I think the one remaining instance of `-std=libc++` 
> in the tests should be fixed at the same time.
> 
> –Arthur
> 
> On Sat, Nov 17, 2018 at 9:52 PM Richard Smith via cfe-commits 
> mailto:cfe-commits@lists.llvm.org>> wrote:
> 
> Good idea, this LG for a patch release.
> 
> On Sat, 17 Nov 2018, 18:48 Shoaib Meenai via cfe-commits 
> mailto:cfe-commits@lists.llvm.org> wrote:
> 
> Could we merge this into 7.0.1? It's a trivial typo fix, and the 
> error message could otherwise be confusing to users (someone brought this up 
> in IRC a few hours ago).
> 
> __ __
> 
> *From: *cfe-commits  > on behalf of Alex Lorenz via 
> cfe-commits mailto:cfe-commits@lists.llvm.org>>
> *Reply-To: *Alex Lorenz  >
> *Date: *Friday, September 7, 2018 at 12:01 PM
> *To: *"cfe-commits@lists.llvm.org 
> "  >
> *Subject: *r341697 - warn_stdlibcxx_not_found: suggest 
> '-stdlib=libc++' instead of '-std'
> 
> __ __
> 
> Author: arphaman
> 
> Date: Fri Sep  7 11:59:45 2018
> 
> New Revision: 341697
> 
> __ __
> 
> URL: 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D341697-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=IqJdIRn5MxFdIr2LEpZYhRLQTay50tZijNg6klhhdRA&s=MYePhuYEkBYd5aK7fqamBrBRJJGtvC-BPPojLInHah8&e=
> 
> Log:
> 
> warn_stdlibcxx_not_found: suggest '-stdlib=libc++' instead of 
> '-std'
> 
> __ __
> 
> Addresses first post-commit feedback for r335081 from Nico
> 
> __ __
> 
> Modified:
> 
> cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
> 
> cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp
> 
> __ __
> 
> Modified: 
> cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
> 
> URL: 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_include_clang_Basic_DiagnosticFrontendKinds.td-3Frev-3D341697-26r1-3D341696-26r2-3D341697-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=IqJdIRn5MxFdIr2LEpZYhRLQTay50tZijNg6klhhdRA&s=ZQcIenU2yQH3SmDrAhdXm2VKI10aP3_5IoBH-72HxYA&e=
> 
> 
> ==
> 
> --- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td 
> (original)
> 
> +++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Fri 
> Sep  7 11:59:45 2018
> 
> @@ -238,7 +238,7 @@ def warn_option_invalid_ocl_version : Wa
> 
>"OpenCL version %0 does not support the option '%1'">, 
> InGroup;
> 
> def warn_stdlibcxx_not_found : Warning<
> 
> -  "include path for stdlibc++ headers not found; pass 
> '-std=libc++' on the "
> 
> +  "include path for stdlibc++ headers not found; pass 
> '-stdlib=libc++' on the "
> 
>"command line to use the libc++ standard library instead">,
> 
>InGroup>;
> 
> }
> 
> __ __
> 
> Modified: cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp
> 
> URL: 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_test_Frontend_warning-2Dstdlibcxx-2Ddarwin.cpp-3Frev-3D341697-26r1-3D341696-26r2-3D341697-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=IqJdIRn5MxFdIr2LEpZYhRLQTay50tZijNg6klhhdRA&s=YR_ENMKZ9M1ESvYMVXN6PlRtSZ8bXMsfvYf8QaBm5X4&e=
> 
> 
> ==
> 
> --- cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp 
> (original)
> 
> +++ cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp Fri Sep  
> 7 11:59:45 2018
> 
> @@ -1,5 +1,5 @@
> 
> // RUN: %clang -cc1 -triple arm64-apple-ios6.0.0 -isysroot 
> %S/doesnotexist %s 2>&1 | FileCheck %s
> 
> // RUN: %clang -cc1 -triple arm64-apple-ios6.0.0 -isysroot 
> %S/doesnotexist -stdlib=libc++ %s -verify
> 
> -// CHECK: inclu

Re: r338941 - [constexpr] Support for constant evaluation of __builtin_memcpy and

2018-11-26 Thread Tom Stellard via cfe-commits
On 11/21/2018 03:32 PM, Shoaib Meenai wrote:
> If it's not too late, could we have this as part of 7.0.1? (You'll also need 
> to cherry-pick the initial reversion in r338602.) 7.0 hits assertion failures 
> for pretty basic memcpy cases on windows-msvc targets, and this patch fixes 
> that.
> 

I've created a bug to track this request: PR39791.

-Tom
> % cat /tmp/reduced.c
> void *memcpy(void *, const void *, __SIZE_TYPE__);
> void f(int i) {
>   struct { int i } s;
>   memcpy((char *)&s.i, &i, sizeof(i));
> }
> 
> % clang -cc1 -triple x86_64-windows-msvc -emit-llvm -fms-compatibility -o 
> /dev/null /tmp/reduced.c
> llvm::SmallVectorTemplateCommon::const_reference 
> llvm::SmallVectorTemplateCommon void>::back() const [T = clang::APValue::LValuePathEntry]: Assertion 
> `!empty()' failed.
> 
> On Fri, Aug 3, 2018 at 5:57 PM Richard Smith via cfe-commits 
> mailto:cfe-commits@lists.llvm.org>> wrote:
> 
> Author: rsmith
> Date: Fri Aug  3 17:57:17 2018
> New Revision: 338941
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=338941&view=rev
> Log:
> [constexpr] Support for constant evaluation of __builtin_memcpy and
> __builtin_memmove (in non-type-punning cases).
> 
> This is intended to permit libc++ to make std::copy etc constexpr
> without sacrificing the optimization that uses memcpy on
> trivially-copyable types.
> 
> __builtin_strcpy and __builtin_wcscpy are not handled by this change.
> They'd be straightforward to add, but we haven't encountered a need for
> them just yet.
> 
> This reinstates r338455, reverted in r338602, with a fix to avoid trying
> to constant-evaluate a memcpy call if either pointer operand has an
> invalid designator.
> 
> Modified:
> cfe/trunk/include/clang/Basic/Builtins.def
> cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
> cfe/trunk/lib/AST/ExprConstant.cpp
> cfe/trunk/test/CodeGen/builtin-memfns.c
> cfe/trunk/test/SemaCXX/constexpr-string.cpp
> 
> Modified: cfe/trunk/include/clang/Basic/Builtins.def
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?rev=338941&r1=338940&r2=338941&view=diff
> 
> ==
> --- cfe/trunk/include/clang/Basic/Builtins.def (original)
> +++ cfe/trunk/include/clang/Basic/Builtins.def Fri Aug  3 17:57:17 2018
> @@ -471,6 +471,8 @@ BUILTIN(__builtin_wcslen, "zwC*", "nF")
>  BUILTIN(__builtin_wcsncmp, "iwC*wC*z", "nF")
>  BUILTIN(__builtin_wmemchr, "w*wC*wz", "nF")
>  BUILTIN(__builtin_wmemcmp, "iwC*wC*z", "nF")
> +BUILTIN(__builtin_wmemcpy, "w*w*wC*z", "nF")
> +BUILTIN(__builtin_wmemmove, "w*w*wC*z", "nF")
>  BUILTIN(__builtin_return_address, "v*IUi", "n")
>  BUILTIN(__builtin_extract_return_addr, "v*v*", "n")
>  BUILTIN(__builtin_frame_address, "v*IUi", "n")
> @@ -908,6 +910,8 @@ LIBBUILTIN(wcslen,  "zwC*", "f", "wc
>  LIBBUILTIN(wcsncmp, "iwC*wC*z", "f", "wchar.h", ALL_LANGUAGES)
>  LIBBUILTIN(wmemchr, "w*wC*wz",  "f", "wchar.h", ALL_LANGUAGES)
>  LIBBUILTIN(wmemcmp, "iwC*wC*z", "f", "wchar.h", ALL_LANGUAGES)
> +LIBBUILTIN(wmemcpy, "w*w*wC*z", "f", "wchar.h", ALL_LANGUAGES)
> +LIBBUILTIN(wmemmove,"w*w*wC*z", "f", "wchar.h", ALL_LANGUAGES)
> 
>  // C99
>  // In some systems setjmp is a macro that expands to _setjmp. We undefine
> 
> Modified: cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td?rev=338941&r1=338940&r2=338941&view=diff
> 
> ==
> --- cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td Fri Aug  3 
> 17:57:17 2018
> @@ -163,6 +163,20 @@ def note_constexpr_unsupported_unsized_a
>  def note_constexpr_unsized_array_indexed : Note<
>"indexing of array without known bound is not allowed "
>"in a constant expression">;
> +def note_constexpr_memcpy_type_pun : Note<
> +  "cannot constant evaluate '%select{memcpy|memmove}0' from object of "
> +  "type %1 to object of type %2">;
> +def note_constexpr_memcpy_nontrivial : Note<
> +  "cannot constant evaluate '%select{memcpy|memmove}0' between objects 
> of "
> +  "non-trivially-copyable type %1">;
> +def note_constexpr_memcpy_overlap : Note<
> +  "'%select{memcpy|wmemcpy}0' between overlapping memory regions">;
> +def note_constexpr_memcpy_unsupported : Note<
> +  "'%select{%select{memcpy|wmemcpy}1|%select{memmove|wmemmove}1}0' "
> +  "not supported: %select{"
> +  "size to copy (%4) is not a multiple of size of element type %3 (%5)|"
> +  "source is not a contiguous array of at least %4 elements of type %3|"
> +  "destination is not a contiguous array o

[libunwind] r348699 - Creating release candidate rc3 from release_701 branch

2018-12-07 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Dec  7 21:19:40 2018
New Revision: 348699

URL: http://llvm.org/viewvc/llvm-project?rev=348699&view=rev
Log:
Creating release candidate rc3 from release_701 branch

Added:
libunwind/tags/RELEASE_701/rc3/   (props changed)
  - copied from r348698, libunwind/branches/release_70/

Propchange: libunwind/tags/RELEASE_701/rc3/
--
svn:mergeinfo = /libunwind/trunk:339217


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r355253 - lib/Header: Simplify CMakeLists.txt

2019-03-01 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Mar  1 16:50:13 2019
New Revision: 355253

URL: http://llvm.org/viewvc/llvm-project?rev=355253&view=rev
Log:
lib/Header: Simplify CMakeLists.txt

Summary:
Replace cut and pasted code with cmake macros and reduce the number of
install commands.  This fixes an issue where the headers were being
installed twice.

This clean up should also make future modifications easier, like
adding a cmake option to install header files into a custom resource
directory.

Reviewers: chandlerc, smeenai, mgorny, beanz, phosek

Reviewed By: smeenai

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58537

Modified:
cfe/trunk/lib/Headers/CMakeLists.txt

Modified: cfe/trunk/lib/Headers/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/CMakeLists.txt?rev=355253&r1=355252&r2=355253&view=diff
==
--- cfe/trunk/lib/Headers/CMakeLists.txt (original)
+++ cfe/trunk/lib/Headers/CMakeLists.txt Fri Mar  1 16:50:13 2019
@@ -123,60 +123,51 @@ set(cuda_wrapper_files
 )
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
-
-# Generate arm_neon.h
-clang_tablegen(arm_neon.h -gen-arm-neon
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
-# Generate arm_fp16.h
-clang_tablegen(arm_fp16.h -gen-arm-fp16
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_fp16.td)
-
 set(out_files)
-foreach( f ${files} ${cuda_wrapper_files} )
-  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
-  set( dst ${output_dir}/${f} )
+
+function(copy_header_to_output_dir src_dir file)
+  set(src ${src_dir}/${file})
+  set(dst ${output_dir}/${file})
   add_custom_command(OUTPUT ${dst}
 DEPENDS ${src}
 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
-COMMENT "Copying clang's ${f}...")
+COMMENT "Copying clang's ${file}...")
   list(APPEND out_files ${dst})
+  set(out_files ${out_files} PARENT_SCOPE)
+endfunction(copy_header_to_output_dir)
+
+function(clang_generate_header td_option td_file out_file)
+  clang_tablegen(${out_file} ${td_option}
+  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
+  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/${td_file})
+
+  copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
+  set(out_files ${out_files} PARENT_SCOPE)
+endfunction(clang_generate_header)
+
+
+# Copy header files from the source directory to the build directory
+foreach( f ${files} ${cuda_wrapper_files} )
+  copy_header_to_output_dir(${CMAKE_CURRENT_SOURCE_DIR} ${f})
 endforeach( f )
 
-add_custom_command(OUTPUT ${output_dir}/arm_neon.h
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-  COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h ${output_dir}/arm_neon.h
-  COMMENT "Copying clang's arm_neon.h...")
-list(APPEND out_files ${output_dir}/arm_neon.h)
-add_custom_command(OUTPUT ${output_dir}/arm_fp16.h
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h
-  COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h ${output_dir}/arm_fp16.h
-  COMMENT "Copying clang's arm_fp16.h...")
-list(APPEND out_files ${output_dir}/arm_fp16.h)
+# Generate header files and copy them to the build directory
+# Generate arm_neon.h
+clang_generate_header(-gen-arm-neon arm_neon.td arm_neon.h)
+# Generate arm_fp16.h
+clang_generate_header(-gen-arm-fp16 arm_fp16.td arm_fp16.h)
 
 add_custom_target(clang-headers ALL DEPENDS ${out_files})
 set_target_properties(clang-headers PROPERTIES
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-install(
-  FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
-install(
-  FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
 
 install(
-  FILES ${cuda_wrapper_files}
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION 
lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers)
+  DIRECTORY ${output_dir}
+  DESTINATION ${header_install_dir}
+  COMPONENT clang-headers)
 
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-headers


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r356708 - Bump version to 8.0.1

2019-03-21 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Mar 21 13:32:00 2019
New Revision: 356708

URL: http://llvm.org/viewvc/llvm-project?rev=356708&view=rev
Log:
Bump version to 8.0.1

Modified:
libunwind/branches/release_80/CMakeLists.txt

Modified: libunwind/branches/release_80/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/branches/release_80/CMakeLists.txt?rev=356708&r1=356707&r2=356708&view=diff
==
--- libunwind/branches/release_80/CMakeLists.txt (original)
+++ libunwind/branches/release_80/CMakeLists.txt Thu Mar 21 13:32:00 2019
@@ -81,7 +81,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   endif()
 
   set(PACKAGE_NAME libunwind)
-  set(PACKAGE_VERSION 8.0.0)
+  set(PACKAGE_VERSION 8.0.1)
   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
   set(PACKAGE_BUGREPORT "llvm-b...@lists.llvm.org")
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r356991 - Creating release candidate rc1 from release_710 branch

2019-03-26 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Mar 26 06:01:15 2019
New Revision: 356991

URL: http://llvm.org/viewvc/llvm-project?rev=356991&view=rev
Log:
Creating release candidate rc1 from release_710 branch

Added:
libunwind/tags/RELEASE_710/
libunwind/tags/RELEASE_710/rc1/
  - copied from r356990, libunwind/branches/release_70/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r358002 - Add support for detection of devtoolset-8

2019-04-09 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Apr  9 06:26:10 2019
New Revision: 358002

URL: http://llvm.org/viewvc/llvm-project?rev=358002&view=rev
Log:
Add support for detection of devtoolset-8

Summary:
The current llvm/clang et al. project can be built with the latest developer 
toolset (devtoolset-8) on RHEL, which provides GCC 8.2.1.
However, the result compiler will not identify this toolset itself when 
compiling programs, which is of course not desirable.

After the patch - which simply adds the name of the developer toolset to the 
existing list - it gets identified and selected, as shown below:

[bamboo@bamboo llvm-project]$ clang -v
clang version 9.0.0 (https://github.com/llvm/llvm-project.git 
e5ac385fb1ffa4bd3875ea6a4d24efdbd7814572)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/bamboo/llvm/bin
Found candidate GCC installation: 
/opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.2.1
Found candidate GCC installation: 
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7
Found candidate GCC installation: 
/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Selected GCC installation: 
/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

Patch By: Radu-Adrian Popescu

Reviewers: tstellar, fedor.sergeev

Reviewed By: tstellar

Subscribers: jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59987

Modified:
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=358002&r1=358001&r2=358002&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Tue Apr  9 06:26:10 2019
@@ -1875,6 +1875,7 @@ void Generic_GCC::GCCInstallationDetecto
   // Non-Solaris is much simpler - most systems just go with "/usr".
   if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
 // Yet, still look for RHEL devtoolsets.
+Prefixes.push_back("/opt/rh/devtoolset-8/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-7/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-4/root/usr");


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r358242 - Creating release candidate final from release_710 branch

2019-04-11 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Apr 11 16:41:27 2019
New Revision: 358242

URL: http://llvm.org/viewvc/llvm-project?rev=358242&view=rev
Log:
Creating release candidate final from release_710 branch

Added:
libunwind/tags/RELEASE_710/final/
  - copied from r358241, libunwind/branches/release_70/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r359257 - lib/Header: Fix Visual Studio builds

2019-04-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Apr 25 18:18:59 2019
New Revision: 359257

URL: http://llvm.org/viewvc/llvm-project?rev=359257&view=rev
Log:
lib/Header: Fix Visual Studio builds

Summary:
This is a follow up to r355253, which inadvertently broke Visual
Studio builds by trying to copy files from CMAKE_CFG_INTDIR.

See https://reviews.llvm.org/D58537#inline-532492

Reviewers: smeenai, vzakhari, phosek

Reviewed By: smeenai

Subscribers: mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61054

Modified:
cfe/trunk/lib/Headers/CMakeLists.txt

Modified: cfe/trunk/lib/Headers/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/CMakeLists.txt?rev=359257&r1=359256&r2=359257&view=diff
==
--- cfe/trunk/lib/Headers/CMakeLists.txt (original)
+++ cfe/trunk/lib/Headers/CMakeLists.txt Thu Apr 25 18:18:59 2019
@@ -126,7 +126,7 @@ set(ppc_wrapper_files
   ppc_wrappers/mmintrin.h
 )
 
-set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
+set(output_dir 
${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 set(out_files)
 
 function(copy_header_to_output_dir src_dir file)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r359258 - Revert lib/Header: Fix Visual Studio builds

2019-04-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Apr 25 18:43:59 2019
New Revision: 359258

URL: http://llvm.org/viewvc/llvm-project?rev=359258&view=rev
Log:
Revert lib/Header: Fix Visual Studio builds

This reverts r359257 (git commit 00d9789509a4c573a48f60893b95314a119edd42)

This broke check-clang.

Modified:
cfe/trunk/lib/Headers/CMakeLists.txt

Modified: cfe/trunk/lib/Headers/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/CMakeLists.txt?rev=359258&r1=359257&r2=359258&view=diff
==
--- cfe/trunk/lib/Headers/CMakeLists.txt (original)
+++ cfe/trunk/lib/Headers/CMakeLists.txt Thu Apr 25 18:43:59 2019
@@ -126,7 +126,7 @@ set(ppc_wrapper_files
   ppc_wrappers/mmintrin.h
 )
 
-set(output_dir 
${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
 set(out_files)
 
 function(copy_header_to_output_dir src_dir file)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r359654 - lib/Header: Fix Visual Studio builds try #2

2019-04-30 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Apr 30 23:18:03 2019
New Revision: 359654

URL: http://llvm.org/viewvc/llvm-project?rev=359654&view=rev
Log:
lib/Header: Fix Visual Studio builds try #2

Summary:
This is a follow up to r355253 and a better fix than the first attempt
which was r359257.

We can't install anything from ${CMAKE_CFG_INTDIR}, because this value
is only defined at build time, but we still must make sure to copy the
headers into ${CMAKE_CFG_INTDIR}/lib/clang/$VERSION/include, because the lit
tests look for headers there.  So for this fix we revert to the
old behavior of copying the headers to 
${CMAKE_CFG_INTDIR}/lib/clang/$VERSION/include
during the build and then installing them from the source tree.

Reviewers: smeenai, vzakhari, phosek

Reviewed By: smeenai, vzakhari

Subscribers: mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61220

Modified:
cfe/trunk/lib/Headers/CMakeLists.txt

Modified: cfe/trunk/lib/Headers/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/CMakeLists.txt?rev=359654&r1=359653&r2=359654&view=diff
==
--- cfe/trunk/lib/Headers/CMakeLists.txt (original)
+++ cfe/trunk/lib/Headers/CMakeLists.txt Tue Apr 30 23:18:03 2019
@@ -128,6 +128,7 @@ set(ppc_wrapper_files
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
 set(out_files)
+set(generated_files)
 
 function(copy_header_to_output_dir src_dir file)
   set(src ${src_dir}/${file})
@@ -147,6 +148,8 @@ function(clang_generate_header td_option
 
   copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
   set(out_files ${out_files} PARENT_SCOPE)
+  list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
+  set(generated_files ${generated_files} PARENT_SCOPE)
 endfunction(clang_generate_header)
 
 
@@ -166,13 +169,23 @@ set_target_properties(clang-resource-hea
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 
 install(
-  DIRECTORY ${output_dir}
+  FILES ${files} ${generated_files}
   DESTINATION ${header_install_dir}
   COMPONENT clang-resource-headers)
 
+install(
+  FILES ${cuda_wrapper_files}
+  DESTINATION ${header_install_dir}/cuda_wrappers
+  COMPONENT clang-resource-headers)
+
+install(
+  FILES ${ppc_wrapper_files}
+  DESTINATION ${header_install_dir}/ppc_wrappers
+  COMPONENT clang-resource-headers)
+
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-resource-headers
DEPENDS clang-resource-headers


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r354417 - CMake: Fix stand-alone clang builds since r353268

2019-02-19 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Feb 19 17:11:05 2019
New Revision: 354417

URL: http://llvm.org/viewvc/llvm-project?rev=354417&view=rev
Log:
CMake: Fix stand-alone clang builds since r353268

Summary:
Handle the case where LLVM_MAIN_SRC_DIR is not set and also use
LLVM_CMAKE_DIR for locating installed cmake files rather than
LLVM_CMAKE_PATH.

Reviewers: phosek, andrewrk, smeenai

Reviewed By: phosek, andrewrk, smeenai

Subscribers: mgorny, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D58204

Modified:
cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=354417&r1=354416&r2=354417&view=diff
==
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Tue Feb 19 17:11:05 2019
@@ -75,6 +75,11 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
 set(LIBRARY_DIR ${LLVM_LIBRARY_DIR})
 set(INCLUDE_DIR ${LLVM_INCLUDE_DIR})
 set(LLVM_OBJ_DIR ${LLVM_BINARY_DIR})
+# The LLVM_CMAKE_PATH variable is set when doing non-standalone builds and
+# used in this project, so we need to make sure we set this value.
+# FIXME: LLVM_CMAKE_DIR comes from LLVMConfig.cmake.  We should rename
+# LLVM_CMAKE_PATH to LLVM_CMAKE_DIR throughout the project.
+set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR})
   endif()
 
   set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r363030 - Merging r360862:

2019-06-10 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun 10 20:47:50 2019
New Revision: 363030

URL: http://llvm.org/viewvc/llvm-project?rev=363030&view=rev
Log:
Merging r360862:


r360862 | mstorsjo | 2019-05-15 23:49:20 -0700 (Wed, 15 May 2019) | 12 lines

[PPC] Fix 32-bit build of libunwind

Clang integrated assembler was unable to build libunwind PPC32 assembly code,
present in functions used to save/restore register context.

This change consists in replacing the assembly style used in libunwind source,
to one that is compatible with both Clang integrated assembler as well as
GNU assembler.

Patch by Leandro Lupori!

Differential Revision: https://reviews.llvm.org/D61792


Modified:
libunwind/branches/release_80/src/UnwindRegistersRestore.S
libunwind/branches/release_80/src/UnwindRegistersSave.S
libunwind/branches/release_80/src/assembly.h

Modified: libunwind/branches/release_80/src/UnwindRegistersRestore.S
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/branches/release_80/src/UnwindRegistersRestore.S?rev=363030&r1=363029&r2=363030&view=diff
==
--- libunwind/branches/release_80/src/UnwindRegistersRestore.S (original)
+++ libunwind/branches/release_80/src/UnwindRegistersRestore.S Mon Jun 10 
20:47:50 2019
@@ -396,119 +396,119 @@ Lnovec:
 #elif defined(__ppc__)
 
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
-;
-; void libunwind::Registers_ppc::jumpto()
-;
-; On entry:
-;  thread_state pointer is in r3
-;
-
-  ; restore integral registerrs
-  ; skip r0 for now
-  ; skip r1 for now
-  lwz r2, 16(r3)
-  ; skip r3 for now
-  ; skip r4 for now
-  ; skip r5 for now
-  lwz r6, 32(r3)
-  lwz r7, 36(r3)
-  lwz r8, 40(r3)
-  lwz r9, 44(r3)
-  lwzr10, 48(r3)
-  lwzr11, 52(r3)
-  lwzr12, 56(r3)
-  lwzr13, 60(r3)
-  lwzr14, 64(r3)
-  lwzr15, 68(r3)
-  lwzr16, 72(r3)
-  lwzr17, 76(r3)
-  lwzr18, 80(r3)
-  lwzr19, 84(r3)
-  lwzr20, 88(r3)
-  lwzr21, 92(r3)
-  lwzr22, 96(r3)
-  lwzr23,100(r3)
-  lwzr24,104(r3)
-  lwzr25,108(r3)
-  lwzr26,112(r3)
-  lwzr27,116(r3)
-  lwzr28,120(r3)
-  lwzr29,124(r3)
-  lwzr30,128(r3)
-  lwzr31,132(r3)
-
-  ; restore float registers
-  lfdf0, 160(r3)
-  lfdf1, 168(r3)
-  lfdf2, 176(r3)
-  lfdf3, 184(r3)
-  lfdf4, 192(r3)
-  lfdf5, 200(r3)
-  lfdf6, 208(r3)
-  lfdf7, 216(r3)
-  lfdf8, 224(r3)
-  lfdf9, 232(r3)
-  lfdf10,240(r3)
-  lfdf11,248(r3)
-  lfdf12,256(r3)
-  lfdf13,264(r3)
-  lfdf14,272(r3)
-  lfdf15,280(r3)
-  lfdf16,288(r3)
-  lfdf17,296(r3)
-  lfdf18,304(r3)
-  lfdf19,312(r3)
-  lfdf20,320(r3)
-  lfdf21,328(r3)
-  lfdf22,336(r3)
-  lfdf23,344(r3)
-  lfdf24,352(r3)
-  lfdf25,360(r3)
-  lfdf26,368(r3)
-  lfdf27,376(r3)
-  lfdf28,384(r3)
-  lfdf29,392(r3)
-  lfdf30,400(r3)
-  lfdf31,408(r3)
-
-  ; restore vector registers if any are in use
-  lwzr5,156(r3)  ; test VRsave
-  cmpwi  r5,0
-  beqLnovec
-
-  subi  r4,r1,16
-  rlwinm  r4,r4,0,0,27  ; mask low 4-bits
-  ; r4 is now a 16-byte aligned pointer into the red zone
-  ; the _vectorRegisters may not be 16-byte aligned so copy via red zone temp 
buffer
-
+//
+// void libunwind::Registers_ppc::jumpto()
+//
+// On entry:
+//  thread_state pointer is in r3
+//
+
+  // restore integral registerrs
+  // skip r0 for now
+  // skip r1 for now
+  lwz %r2,  16(%r3)
+  // skip r3 for now
+  // skip r4 for now
+  // skip r5 for now
+  lwz %r6,  32(%r3)
+  lwz %r7,  36(%r3)
+  lwz %r8,  40(%r3)
+  lwz %r9,  44(%r3)
+  lwz %r10, 48(%r3)
+  lwz %r11, 52(%r3)
+  lwz %r12, 56(%r3)
+  lwz %r13, 60(%r3)
+  lwz %r14, 64(%r3)
+  lwz %r15, 68(%r3)
+  lwz %r16, 72(%r3)
+  lwz %r17, 76(%r3)
+  lwz %r18, 80(%r3)
+  lwz %r19, 84(%r3)
+  lwz %r20, 88(%r3)
+  lwz %r21, 92(%r3)
+  lwz %r22, 96(%r3)
+  lwz %r23,100(%r3)
+  lwz %r24,104(%r3)
+  lwz %r25,108(%r3)
+  lwz %r26,112(%r3)
+  lwz %r27,116(%r3)
+  lwz %r28,120(%r3)
+  lwz %r29,124(%r3)
+  lwz %r30,128(%r3)
+  lwz %r31,132(%r3)
+
+  // restore float registers
+  lfd %f0, 160(%r3)
+  lfd %f1, 168(%r3)
+  lfd %f2, 176(%r3)
+  lfd %f3, 184(%r3)
+  lfd %f4, 192(%r3)
+  lfd %f5, 200(%r3)
+  lfd %f6, 208(%r3)
+  lfd %f7, 216(%r3)
+  lfd %f8, 224(%r3)
+  lfd %f9, 232(%r3)
+  lfd %f10,240(%r3)
+  lfd %f11,248(%r3)
+  lfd %f12,256(%r3)
+  lfd %f13,264(%r3)
+  lfd %f14,272(%r3)
+  lfd %f15,280(%r3)
+  lfd %f16,288(%r3)
+  lfd %f17,296(%r3)
+  lfd %f18,304(%r3)
+  lfd %f19,312(%r3)
+  lfd %f20,320(%r3)
+  lfd %f21,328(%r3)
+  lfd %f22,336(%

[libunwind] r363031 - Creating release candidate rc2 from release_801 branch

2019-06-10 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun 10 21:00:01 2019
New Revision: 363031

URL: http://llvm.org/viewvc/llvm-project?rev=363031&view=rev
Log:
Creating release candidate rc2 from release_801 branch

Added:
libunwind/tags/RELEASE_801/rc2/
  - copied from r363030, libunwind/branches/release_80/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r363031 - Creating release candidate rc2 from release_801 branch

2019-06-10 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun 10 21:00:01 2019
New Revision: 363031

URL: http://llvm.org/viewvc/llvm-project?rev=363031&view=rev
Log:
Creating release candidate rc2 from release_801 branch

Added:
libclc/tags/RELEASE_801/rc2/
  - copied from r363030, libclc/branches/release_80/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r365902 - cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros

2019-07-12 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Jul 12 07:40:18 2019
New Revision: 365902

URL: http://llvm.org/viewvc/llvm-project?rev=365902&view=rev
Log:
cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros

Summary:
This will simplify the macros by allowing us to remove the hard-coded
list of libraries that should be installed when
LLVM_INSTALL_TOOLCHAIN_ONLY is enabled.

Reviewers: beanz, smeenai

Reviewed By: beanz

Subscribers: aheejin, mehdi_amini, mgorny, steven_wu, dexonsmith, cfe-commits, 
llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D64580

Modified:
cfe/trunk/cmake/modules/AddClang.cmake
cfe/trunk/tools/libclang/CMakeLists.txt

Modified: cfe/trunk/cmake/modules/AddClang.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/AddClang.cmake?rev=365902&r1=365901&r2=365902&view=diff
==
--- cfe/trunk/cmake/modules/AddClang.cmake (original)
+++ cfe/trunk/cmake/modules/AddClang.cmake Fri Jul 12 07:40:18 2019
@@ -44,7 +44,7 @@ endmacro()
 
 macro(add_clang_library name)
   cmake_parse_arguments(ARG
-"SHARED"
+"SHARED;INSTALL_WITH_TOOLCHAIN"
 ""
 "ADDITIONAL_HEADERS"
 ${ARGN})
@@ -97,7 +97,7 @@ macro(add_clang_library name)
   if(TARGET ${name})
 target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS})
 
-if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
+if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
   set(export_to_clangtargets)
   if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
   "clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR

Modified: cfe/trunk/tools/libclang/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CMakeLists.txt?rev=365902&r1=365901&r2=365902&view=diff
==
--- cfe/trunk/tools/libclang/CMakeLists.txt (original)
+++ cfe/trunk/tools/libclang/CMakeLists.txt Fri Jul 12 07:40:18 2019
@@ -94,7 +94,7 @@ if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHE
 remove_definitions("-D_XOPEN_SOURCE=700")
 endif()
 
-add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC}
+add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC} 
INSTALL_WITH_TOOLCHAIN
   OUTPUT_NAME ${output_name}
   ${SOURCES}
   DEPENDS clang-resource-headers


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r365905 - cmake: Fix install of libclang-cpp.so when LLVM_INSTALL_TOOLCHAIN_ONLY=ON

2019-07-12 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Jul 12 08:11:28 2019
New Revision: 365905

URL: http://llvm.org/viewvc/llvm-project?rev=365905&view=rev
Log:
cmake: Fix install of libclang-cpp.so when LLVM_INSTALL_TOOLCHAIN_ONLY=ON

Summary:
If CLANG_LINK_CLANG_DYLIB is also enabled, then this library needs to be
installed.

Fixes PR42575.

Reviewers: beanz, smeenai

Subscribers: mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64582

Conflicts:
clang/tools/clang-shlib/CMakeLists.txt

Modified:
cfe/trunk/tools/clang-shlib/CMakeLists.txt

Modified: cfe/trunk/tools/clang-shlib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-shlib/CMakeLists.txt?rev=365905&r1=365904&r2=365905&view=diff
==
--- cfe/trunk/tools/clang-shlib/CMakeLists.txt (original)
+++ cfe/trunk/tools/clang-shlib/CMakeLists.txt Fri Jul 12 08:11:28 2019
@@ -38,8 +38,13 @@ foreach (lib ${clang_libs})
   list(APPEND _DEPS ${lib})
 endforeach ()
 
+if (CLANG_LINK_CLANG_DYLIB)
+  set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
+endif()
+
 add_clang_library(clang-cpp
   SHARED
+  ${INSTALL_WITH_TOOLCHAIN}
   clang-shlib.cpp
   ${_OBJECTS}
   LINK_LIBS


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r366143 - [OpenCL] Make TableGen'd builtin tables and helper functions static

2019-07-15 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jul 15 15:34:19 2019
New Revision: 366143

URL: http://llvm.org/viewvc/llvm-project?rev=366143&view=rev
Log:
[OpenCL] Make TableGen'd builtin tables and helper functions static

Reviewers: Pierre, Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64608

Modified:
cfe/trunk/lib/Sema/SemaLookup.cpp
cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp

Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=366143&r1=366142&r2=366143&view=diff
==
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Mon Jul 15 15:34:19 2019
@@ -688,7 +688,7 @@ static void InsertOCLBuiltinDeclarations
  unsigned Len) {
 
   for (unsigned i = 0; i < Len; ++i) {
-OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
+const OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
 ASTContext &Context = S.Context;
 
 // Ignore this BIF if the version is incorrect.

Modified: cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp?rev=366143&r1=366142&r2=366143&view=diff
==
--- cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp Mon Jul 15 15:34:19 
2019
@@ -207,7 +207,7 @@ void BuiltinNameEmitter::GetOverloads()
 }
 
 void BuiltinNameEmitter::EmitSignatureTable() {
-  OS << "OpenCLType OpenCLSignature[] = {\n";
+  OS << "static const OpenCLType OpenCLSignature[] = {\n";
   for (auto &P : SignatureSet) {
 OS << "// " << P.second << "\n";
 for (Record *R : P.first) {
@@ -222,7 +222,7 @@ void BuiltinNameEmitter::EmitSignatureTa
 }
 
 void BuiltinNameEmitter::EmitBuiltinTable() {
-  OS << "OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
+  OS << "static const OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
   for (auto &i : OverloadInfo) {
 StringRef Name = i.first;
 OS << "// " << Name << "\n";
@@ -255,7 +255,7 @@ void BuiltinNameEmitter::EmitStringMatch
   OS << R"(
 // Return 0 if name is not a recognized OpenCL builtin, or an index
 // into a table of declarations if it is an OpenCL builtin.
-std::pair isOpenCLBuiltin(llvm::StringRef name) {
+static std::pair isOpenCLBuiltin(llvm::StringRef name) {
 
 )";
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r366581 - Creating release candidate final from release_801 branch

2019-07-19 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Jul 19 07:14:12 2019
New Revision: 366581

URL: http://llvm.org/viewvc/llvm-project?rev=366581&view=rev
Log:
Creating release candidate final from release_801 branch

Added:
libclc/tags/RELEASE_801/final/
  - copied from r366580, libclc/branches/release_80/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r366581 - Creating release candidate final from release_801 branch

2019-07-19 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Jul 19 07:14:12 2019
New Revision: 366581

URL: http://llvm.org/viewvc/llvm-project?rev=366581&view=rev
Log:
Creating release candidate final from release_801 branch

Added:
libunwind/tags/RELEASE_801/final/
  - copied from r366580, libunwind/branches/release_80/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r364217 - Merging r360861:

2019-06-24 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun 24 11:40:58 2019
New Revision: 364217

URL: http://llvm.org/viewvc/llvm-project?rev=364217&view=rev
Log:
Merging r360861:


r360861 | mstorsjo | 2019-05-15 23:49:13 -0700 (Wed, 15 May 2019) | 13 lines

[PPC64][libunwind] Fix r2 not properly restored

This change makes each unwind step inspect the instruction at the
return address and, if needed, read r2 from its saved location and
modify the context appropriately.

The unwind logic is able to handle both ELFv1 and ELFv2 stacks.

Reported by Bug 41050

Patch by Leandro Lupori!

Differential Revision: https://reviews.llvm.org/D59694


Modified:
libunwind/branches/release_80/src/DwarfInstructions.hpp
libunwind/branches/release_80/src/assembly.h
libunwind/branches/release_80/test/lit.cfg

Modified: libunwind/branches/release_80/src/DwarfInstructions.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/branches/release_80/src/DwarfInstructions.hpp?rev=364217&r1=364216&r2=364217&view=diff
==
--- libunwind/branches/release_80/src/DwarfInstructions.hpp (original)
+++ libunwind/branches/release_80/src/DwarfInstructions.hpp Mon Jun 24 11:40:58 
2019
@@ -234,6 +234,31 @@ int DwarfInstructions::stepWithDwa
   }
 #endif
 
+#if defined(_LIBUNWIND_TARGET_PPC64)
+#define PPC64_ELFV1_R2_LOAD_INST_ENCODING 0xe8410028u // ld r2,40(r1)
+#define PPC64_ELFV1_R2_OFFSET 40
+#define PPC64_ELFV2_R2_LOAD_INST_ENCODING 0xe8410018u // ld r2,24(r1)
+#define PPC64_ELFV2_R2_OFFSET 24
+  // If the instruction at return address is a TOC (r2) restore,
+  // then r2 was saved and needs to be restored.
+  // ELFv2 ABI specifies that the TOC Pointer must be saved at SP + 24,
+  // while in ELFv1 ABI it is saved at SP + 40.
+  if (R::getArch() == REGISTERS_PPC64 && returnAddress != 0) {
+pint_t sp = newRegisters.getRegister(UNW_REG_SP);
+pint_t r2 = 0;
+switch (addressSpace.get32(returnAddress)) {
+case PPC64_ELFV1_R2_LOAD_INST_ENCODING:
+  r2 = addressSpace.get64(sp + PPC64_ELFV1_R2_OFFSET);
+  break;
+case PPC64_ELFV2_R2_LOAD_INST_ENCODING:
+  r2 = addressSpace.get64(sp + PPC64_ELFV2_R2_OFFSET);
+  break;
+}
+if (r2)
+  newRegisters.setRegister(UNW_PPC64_R2, r2);
+  }
+#endif
+
   // Return address is address after call site instruction, so setting IP 
to
   // that does simualates a return.
   newRegisters.setIP(returnAddress);

Modified: libunwind/branches/release_80/src/assembly.h
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/branches/release_80/src/assembly.h?rev=364217&r1=364216&r2=364217&view=diff
==
--- libunwind/branches/release_80/src/assembly.h (original)
+++ libunwind/branches/release_80/src/assembly.h Mon Jun 24 11:40:58 2019
@@ -35,6 +35,20 @@
 #define SEPARATOR ;
 #endif
 
+#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
+#define PPC64_OPD1 .section .opd,"aw",@progbits SEPARATOR
+#define PPC64_OPD2 SEPARATOR \
+  .p2align 3 SEPARATOR \
+  .quad .Lfunc_begin0 SEPARATOR \
+  .quad .TOC.@tocbase SEPARATOR \
+  .quad 0 SEPARATOR \
+  .text SEPARATOR \
+.Lfunc_begin0:
+#else
+#define PPC64_OPD1
+#define PPC64_OPD2
+#endif
+
 #define GLUE2(a, b) a ## b
 #define GLUE(a, b) GLUE2(a, b)
 #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
@@ -95,7 +109,9 @@
   .globl SYMBOL_NAME(name) SEPARATOR  \
   EXPORT_SYMBOL(name) SEPARATOR   \
   SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
-  SYMBOL_NAME(name):
+  PPC64_OPD1  \
+  SYMBOL_NAME(name):  \
+  PPC64_OPD2
 
 #define DEFINE_LIBUNWIND_PRIVATE_FUNCTION(name)   \
   .globl SYMBOL_NAME(name) SEPARATOR  \

Modified: libunwind/branches/release_80/test/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/branches/release_80/test/lit.cfg?rev=364217&r1=364216&r2=364217&view=diff
==
--- libunwind/branches/release_80/test/lit.cfg (original)
+++ libunwind/branches/release_80/test/lit.cfg Mon Jun 24 11:40:58 2019
@@ -23,6 +23,9 @@ config.suffixes = ['.cpp', '.s']
 # test_source_root: The root path where tests are located.
 config.test_source_root = os.path.dirname(__file__)
 
+# needed to test libunwind with code that throws exceptions
+config.enable_exceptions = True
+
 # Infer the libcxx_test_source_root for configuration import.
 # If libcxx_source_root isn't specified in the config, assume that the libcxx
 # and libunwind source directories are sibling directories.


___

[libclc] r364604 - Creating release candidate rc3 from release_801 branch

2019-06-27 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Jun 27 15:33:04 2019
New Revision: 364604

URL: http://llvm.org/viewvc/llvm-project?rev=364604&view=rev
Log:
Creating release candidate rc3 from release_801 branch

Added:
libclc/tags/RELEASE_801/rc3/
  - copied from r364603, libclc/branches/release_80/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r364604 - Creating release candidate rc3 from release_801 branch

2019-06-27 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Jun 27 15:33:04 2019
New Revision: 364604

URL: http://llvm.org/viewvc/llvm-project?rev=364604&view=rev
Log:
Creating release candidate rc3 from release_801 branch

Added:
libunwind/tags/RELEASE_801/rc3/
  - copied from r364603, libunwind/branches/release_80/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r365092 - cmake: Add CLANG_LINK_CLANG_DYLIB option

2019-07-03 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Jul  3 15:45:55 2019
New Revision: 365092

URL: http://llvm.org/viewvc/llvm-project?rev=365092&view=rev
Log:
cmake: Add CLANG_LINK_CLANG_DYLIB option

Summary:
Setting CLANG_LINK_CLANG_DYLIB=ON causes clang tools to link against
libclang_shared.so instead of the individual component libraries.

Reviewers: mgorny, beanz, smeenai, phosek, sylvestre.ledru

Subscribers: arphaman, cfe-commits, llvm-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63503

Modified:
cfe/trunk/CMakeLists.txt
cfe/trunk/cmake/modules/AddClang.cmake
cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt
cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
cfe/trunk/examples/clang-interpreter/CMakeLists.txt
cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
cfe/trunk/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
cfe/trunk/tools/arcmt-test/CMakeLists.txt
cfe/trunk/tools/clang-check/CMakeLists.txt
cfe/trunk/tools/clang-diff/CMakeLists.txt
cfe/trunk/tools/clang-extdef-mapping/CMakeLists.txt
cfe/trunk/tools/clang-format/CMakeLists.txt
cfe/trunk/tools/clang-import-test/CMakeLists.txt
cfe/trunk/tools/clang-offload-bundler/CMakeLists.txt
cfe/trunk/tools/clang-refactor/CMakeLists.txt
cfe/trunk/tools/clang-rename/CMakeLists.txt
cfe/trunk/tools/clang-scan-deps/CMakeLists.txt
cfe/trunk/tools/diagtool/CMakeLists.txt
cfe/trunk/tools/driver/CMakeLists.txt
cfe/trunk/unittests/AST/CMakeLists.txt
cfe/trunk/unittests/ASTMatchers/CMakeLists.txt
cfe/trunk/unittests/ASTMatchers/Dynamic/CMakeLists.txt
cfe/trunk/unittests/Analysis/CMakeLists.txt
cfe/trunk/unittests/Basic/CMakeLists.txt
cfe/trunk/unittests/CodeGen/CMakeLists.txt
cfe/trunk/unittests/CrossTU/CMakeLists.txt
cfe/trunk/unittests/Driver/CMakeLists.txt
cfe/trunk/unittests/Format/CMakeLists.txt
cfe/trunk/unittests/Frontend/CMakeLists.txt
cfe/trunk/unittests/Index/CMakeLists.txt
cfe/trunk/unittests/Lex/CMakeLists.txt
cfe/trunk/unittests/Rename/CMakeLists.txt
cfe/trunk/unittests/Rewrite/CMakeLists.txt
cfe/trunk/unittests/Sema/CMakeLists.txt
cfe/trunk/unittests/Serialization/CMakeLists.txt
cfe/trunk/unittests/StaticAnalyzer/CMakeLists.txt
cfe/trunk/unittests/Tooling/CMakeLists.txt
cfe/trunk/unittests/Tooling/Syntax/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=365092&r1=365091&r2=365092&view=diff
==
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Wed Jul  3 15:45:55 2019
@@ -323,6 +323,14 @@ set(CLANG_VENDOR_UTI "org.llvm.clang" CA
 set(CLANG_PYTHON_BINDINGS_VERSIONS "" CACHE STRING
 "Python versions to install libclang python bindings for")
 
+set(CLANG_LINK_CLANG_DYLIB ${LLVM_LINK_LLVM_DYLIB} CACHE BOOL
+"Link tools against libclang_shared.so")
+
+if (NOT LLVM_LINK_LLVM_DYLIB AND CLANG_LINK_CLANG_DYLIB)
+  message(FATAL_ERROR "Cannot set CLANG_LINK_CLANG_DYLIB=ON when "
+  "LLVM_LINK_LLVM_DYLIB=OFF")
+endif()
+
 # The libdir suffix must exactly match whatever LLVM's configuration used.
 set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}")
 

Modified: cfe/trunk/cmake/modules/AddClang.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/AddClang.cmake?rev=365092&r1=365091&r2=365092&view=diff
==
--- cfe/trunk/cmake/modules/AddClang.cmake (original)
+++ cfe/trunk/cmake/modules/AddClang.cmake Wed Jul  3 15:45:55 2019
@@ -172,3 +172,12 @@ macro(add_clang_symlink name dest)
   # Always generate install targets
   llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE)
 endmacro()
+
+function(clang_target_link_libraries target type)
+  if (CLANG_LINK_CLANG_DYLIB)
+target_link_libraries(${target} ${type} clang_shared)
+  else()
+target_link_libraries(${target} ${type} ${ARGN})
+  endif()
+
+endfunction()

Modified: cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt?rev=365092&r1=365091&r2=365092&view=diff
==
--- cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt (original)
+++ cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt Wed Jul  3 15:45:55 2019
@@ -1,11 +1,13 @@
 add_llvm_library(AnnotateFunctions MODULE AnnotateFunctions.cpp PLUGIN_TOOL 
clang)
 
 if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
-  target_link_libraries(AnnotateFunctions PRIVATE
+  set(LLVM_LINK_COMPONENTS
+Support
+  )
+  clang_target_link_libraries(AnnotateFunctions PRIVATE
 clangAST
 clangBasic
 clangFrontend
 clangLex
-LLVMSupport
 )
 endif()

Modified:

Re: [libunwind] r364217 - Merging r360861:

2019-07-08 Thread Tom Stellard via cfe-commits
On 07/08/2019 11:51 AM, Dimitry Andric wrote:
> On 24 Jun 2019, at 20:40, Tom Stellard via cfe-commits 
>  wrote:
>>
>> Author: tstellar
>> Date: Mon Jun 24 11:40:58 2019
>> New Revision: 364217
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=364217&view=rev
>> Log:
>> Merging r360861:
>>
>> 
>> r360861 | mstorsjo | 2019-05-15 23:49:13 -0700 (Wed, 15 May 2019) | 13 lines
>>
>> [PPC64][libunwind] Fix r2 not properly restored
> 
>> Modified: libunwind/branches/release_80/src/assembly.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/libunwind/branches/release_80/src/assembly.h?rev=364217&r1=364216&r2=364217&view=diff
>> ==
>> --- libunwind/branches/release_80/src/assembly.h (original)
>> +++ libunwind/branches/release_80/src/assembly.h Mon Jun 24 11:40:58 2019
>> @@ -35,6 +35,20 @@
>> #define SEPARATOR ;
>> #endif
>>
>> +#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
>> +#define PPC64_OPD1 .section .opd,"aw",@progbits SEPARATOR
>> +#define PPC64_OPD2 SEPARATOR \
>> +  .p2align 3 SEPARATOR \
>> +  .quad .Lfunc_begin0 SEPARATOR \
>> +  .quad .TOC.@tocbase SEPARATOR \
>> +  .quad 0 SEPARATOR \
>> +  .text SEPARATOR \
>> +.Lfunc_begin0:
>> +#else
>> +#define PPC64_OPD1
>> +#define PPC64_OPD2
>> +#endif
>> +
>> #define GLUE2(a, b) a ## b
>> #define GLUE(a, b) GLUE2(a, b)
>> #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
>> @@ -95,7 +109,9 @@
>>   .globl SYMBOL_NAME(name) SEPARATOR  \
>>   EXPORT_SYMBOL(name) SEPARATOR   \
>>   SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
>> -  SYMBOL_NAME(name):
>> +  PPC64_OPD1  \
>> +  SYMBOL_NAME(name):  \
>> +  PPC64_OPD2
>>
>> #define DEFINE_LIBUNWIND_PRIVATE_FUNCTION(name)   \
>>   .globl SYMBOL_NAME(name) SEPARATOR  \
>>
> 
> I think this merge missed that the DEFINE_LIBUNWIND_PRIVATE_FUNCTION
> macro went away in r357640 ("[libunwind] Export the unw_* symbols as
> weak symbols").
> 
> It looks like the PPC64_OPD1 and PPC64_OPD2 lines should also be added
> to the expansion of DEFINE_LIBUNWIND_PRIVATE_FUNCTION?
> 

Is someone else able to try to remerge and fix this up?  I don't have
a good way to test this.  If we can't get this resolved by Wednesday,
I am going to revert it, because it's the only thing blocking the release
at this point.

-Tom

> -Dimitry
> 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libunwind] r364217 - Merging r360861:

2019-07-09 Thread Tom Stellard via cfe-commits
On 07/09/2019 12:28 PM, Dimitry Andric wrote:
> On 9 Jul 2019, at 04:54, Tom Stellard  wrote:
>>
>> On 07/08/2019 11:51 AM, Dimitry Andric wrote:
>>> On 24 Jun 2019, at 20:40, Tom Stellard via cfe-commits 
>>>  wrote:
>>>>
>>>> Author: tstellar
>>>> Date: Mon Jun 24 11:40:58 2019
>>>> New Revision: 364217
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=364217&view=rev
>>>> Log:
>>>> Merging r360861:
>>>>
>>>> 
>>>> r360861 | mstorsjo | 2019-05-15 23:49:13 -0700 (Wed, 15 May 2019) | 13 
>>>> lines
>>>>
>>>> [PPC64][libunwind] Fix r2 not properly restored
>>> 
>>>> Modified: libunwind/branches/release_80/src/assembly.h
>>>> URL: 
>>>> http://llvm.org/viewvc/llvm-project/libunwind/branches/release_80/src/assembly.h?rev=364217&r1=364216&r2=364217&view=diff
>>>> ==
>>>> --- libunwind/branches/release_80/src/assembly.h (original)
>>>> +++ libunwind/branches/release_80/src/assembly.h Mon Jun 24 11:40:58 2019
>>>> @@ -35,6 +35,20 @@
>>>> #define SEPARATOR ;
>>>> #endif
>>>>
>>>> +#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
>>>> +#define PPC64_OPD1 .section .opd,"aw",@progbits SEPARATOR
>>>> +#define PPC64_OPD2 SEPARATOR \
>>>> +  .p2align 3 SEPARATOR \
>>>> +  .quad .Lfunc_begin0 SEPARATOR \
>>>> +  .quad .TOC.@tocbase SEPARATOR \
>>>> +  .quad 0 SEPARATOR \
>>>> +  .text SEPARATOR \
>>>> +.Lfunc_begin0:
>>>> +#else
>>>> +#define PPC64_OPD1
>>>> +#define PPC64_OPD2
>>>> +#endif
>>>> +
>>>> #define GLUE2(a, b) a ## b
>>>> #define GLUE(a, b) GLUE2(a, b)
>>>> #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
>>>> @@ -95,7 +109,9 @@
>>>>  .globl SYMBOL_NAME(name) SEPARATOR  \
>>>>  EXPORT_SYMBOL(name) SEPARATOR   \
>>>>  SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
>>>> -  SYMBOL_NAME(name):
>>>> +  PPC64_OPD1  \
>>>> +  SYMBOL_NAME(name):  \
>>>> +  PPC64_OPD2
>>>>
>>>> #define DEFINE_LIBUNWIND_PRIVATE_FUNCTION(name)   \
>>>>  .globl SYMBOL_NAME(name) SEPARATOR  \
>>>>
>>>
>>> I think this merge missed that the DEFINE_LIBUNWIND_PRIVATE_FUNCTION
>>> macro went away in r357640 ("[libunwind] Export the unw_* symbols as
>>> weak symbols").
>>>
>>> It looks like the PPC64_OPD1 and PPC64_OPD2 lines should also be added
>>> to the expansion of DEFINE_LIBUNWIND_PRIVATE_FUNCTION?
>>>
>>
>> Is someone else able to try to remerge and fix this up?  I don't have
>> a good way to test this.  If we can't get this resolved by Wednesday,
>> I am going to revert it, because it's the only thing blocking the release
>> at this point.
> 
> I reverted the merge in https://reviews.llvm.org/rL365539, and reapplied
> it with the additional lines in https://reviews.llvm.org/rL365542.  I
> hope you don't mind.
> 
> This is also going to end up in the next merge to FreeBSD's libunwind.
> 

Ok, thank you.

-Tom

> -Dimitry
> 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r365728 - Creating release candidate rc4 from release_801 branch

2019-07-10 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Jul 10 19:58:32 2019
New Revision: 365728

URL: http://llvm.org/viewvc/llvm-project?rev=365728&view=rev
Log:
Creating release candidate rc4 from release_801 branch

Added:
libunwind/tags/RELEASE_801/rc4/
  - copied from r365727, libunwind/branches/release_80/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r365728 - Creating release candidate rc4 from release_801 branch

2019-07-10 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Jul 10 19:58:32 2019
New Revision: 365728

URL: http://llvm.org/viewvc/llvm-project?rev=365728&view=rev
Log:
Creating release candidate rc4 from release_801 branch

Added:
libclc/tags/RELEASE_801/rc4/
  - copied from r365727, libclc/branches/release_80/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r360979 - Creating release candidate rc1 from release_801 branch

2019-05-16 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu May 16 19:26:13 2019
New Revision: 360979

URL: http://llvm.org/viewvc/llvm-project?rev=360979&view=rev
Log:
Creating release candidate rc1 from release_801 branch

Added:
libunwind/tags/RELEASE_801/
libunwind/tags/RELEASE_801/rc1/
  - copied from r360978, libunwind/branches/release_80/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r360979 - Creating release candidate rc1 from release_801 branch

2019-05-16 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu May 16 19:26:13 2019
New Revision: 360979

URL: http://llvm.org/viewvc/llvm-project?rev=360979&view=rev
Log:
Creating release candidate rc1 from release_801 branch

Added:
libclc/tags/RELEASE_801/
libclc/tags/RELEASE_801/rc1/
  - copied from r360978, libclc/branches/release_80/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r349249 - Creating release candidate final from release_701 branch

2018-12-14 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Dec 14 20:32:13 2018
New Revision: 349249

URL: http://llvm.org/viewvc/llvm-project?rev=349249&view=rev
Log:
Creating release candidate final from release_701 branch

Added:
libunwind/tags/RELEASE_701/final/   (props changed)
  - copied from r349248, libunwind/branches/release_70/

Propchange: libunwind/tags/RELEASE_701/final/
--
svn:mergeinfo = /libunwind/trunk:339217


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r349840 - cmake: Remove uses of add_llvm_loadable_module macro

2018-12-20 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Dec 20 14:04:36 2018
New Revision: 349840

URL: http://llvm.org/viewvc/llvm-project?rev=349840&view=rev
Log:
cmake: Remove uses of add_llvm_loadable_module macro

This was removed from llvm in r349839.

Modified:
cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt
cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
cfe/trunk/examples/analyzer-plugin/CMakeLists.txt

Modified: cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt?rev=349840&r1=349839&r2=349840&view=diff
==
--- cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt (original)
+++ cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt Thu Dec 20 14:04:36 2018
@@ -1,4 +1,4 @@
-add_llvm_loadable_module(AnnotateFunctions AnnotateFunctions.cpp PLUGIN_TOOL 
clang)
+add_llvm_library(AnnotateFunctions MODULE AnnotateFunctions.cpp PLUGIN_TOOL 
clang)
 
 if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
   target_link_libraries(AnnotateFunctions PRIVATE

Modified: cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt?rev=349840&r1=349839&r2=349840&view=diff
==
--- cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt (original)
+++ cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt Thu Dec 20 14:04:36 
2018
@@ -9,7 +9,7 @@ if( NOT MSVC ) # MSVC mangles symbols di
   endif()
 endif()
 
-add_llvm_loadable_module(PrintFunctionNames PrintFunctionNames.cpp PLUGIN_TOOL 
clang)
+add_llvm_library(PrintFunctionNames MODULE PrintFunctionNames.cpp PLUGIN_TOOL 
clang)
 
 if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
   target_link_libraries(PrintFunctionNames PRIVATE

Modified: cfe/trunk/examples/analyzer-plugin/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/analyzer-plugin/CMakeLists.txt?rev=349840&r1=349839&r2=349840&view=diff
==
--- cfe/trunk/examples/analyzer-plugin/CMakeLists.txt (original)
+++ cfe/trunk/examples/analyzer-plugin/CMakeLists.txt Thu Dec 20 14:04:36 2018
@@ -1,5 +1,5 @@
 set(LLVM_EXPORTED_SYMBOL_FILE 
${CMAKE_CURRENT_SOURCE_DIR}/SampleAnalyzerPlugin.exports)
-add_llvm_loadable_module(SampleAnalyzerPlugin MainCallChecker.cpp PLUGIN_TOOL 
clang)
+add_llvm_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp PLUGIN_TOOL 
clang)
 
 if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
   target_link_libraries(SampleAnalyzerPlugin PRIVATE


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r373275 - Fix Driver/modules.cpp test to work when build directory name contains '.s'

2019-09-30 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Sep 30 16:42:17 2019
New Revision: 373275

URL: http://llvm.org/viewvc/llvm-project?rev=373275&view=rev
Log:
Fix Driver/modules.cpp test to work when build directory name contains '.s'

Reviewers: dyung, rsmith, hansw

Subscribers: mati865, mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66176

Modified:
cfe/trunk/test/Driver/modules.cpp

Modified: cfe/trunk/test/Driver/modules.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/modules.cpp?rev=373275&r1=373274&r2=373275&view=diff
==
--- cfe/trunk/test/Driver/modules.cpp (original)
+++ cfe/trunk/test/Driver/modules.cpp Mon Sep 30 16:42:17 2019
@@ -15,7 +15,7 @@
 // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | 
FileCheck %s --check-prefix=CHECK-COMPILE
 //
 // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}}
-// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}
+// CHECK-COMPILE-SAME: -o {{.*}}module{{2*}}.pcm.o
 // CHECK-COMPILE-SAME: -x pcm
 // CHECK-COMPILE-SAME: {{.*}}.pcm
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r329854 - Driver: Add gcc search path for RHEL devtoolset-7

2018-04-11 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Apr 11 15:29:35 2018
New Revision: 329854

URL: http://llvm.org/viewvc/llvm-project?rev=329854&view=rev
Log:
Driver:  Add gcc search path for RHEL devtoolset-7

Reviewers: bruno

Reviewed By: bruno

Subscribers: bruno, cfe-commits

Differential Revision: https://reviews.llvm.org/D44130

Modified:
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=329854&r1=329853&r2=329854&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Wed Apr 11 15:29:35 2018
@@ -1785,6 +1785,7 @@ void Generic_GCC::GCCInstallationDetecto
   // Non-Solaris is much simpler - most systems just go with "/usr".
   if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
 // Yet, still look for RHEL devtoolsets.
+Prefixes.push_back("/opt/rh/devtoolset-7/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-4/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-3/root/usr");


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r330906 - Creating release directory for release_601.

2018-04-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Apr 25 21:20:20 2018
New Revision: 330906

URL: http://llvm.org/viewvc/llvm-project?rev=330906&view=rev
Log:
Creating release directory for release_601.

Added:
libcxx/tags/RELEASE_601/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r330909 - Creating release candidate rc1 from release_601 branch

2018-04-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Apr 25 21:20:31 2018
New Revision: 330909

URL: http://llvm.org/viewvc/llvm-project?rev=330909&view=rev
Log:
Creating release candidate rc1 from release_601 branch

Added:
libcxxabi/tags/RELEASE_601/rc1/
  - copied from r330908, libcxxabi/branches/release_60/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r330908 - Creating release directory for release_601.

2018-04-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Apr 25 21:20:28 2018
New Revision: 330908

URL: http://llvm.org/viewvc/llvm-project?rev=330908&view=rev
Log:
Creating release directory for release_601.

Added:
libcxxabi/tags/RELEASE_601/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r330907 - Creating release candidate rc1 from release_601 branch

2018-04-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Apr 25 21:20:26 2018
New Revision: 330907

URL: http://llvm.org/viewvc/llvm-project?rev=330907&view=rev
Log:
Creating release candidate rc1 from release_601 branch

Added:
libcxx/tags/RELEASE_601/rc1/   (props changed)
  - copied from r330906, libcxx/branches/release_60/

Propchange: libcxx/tags/RELEASE_601/rc1/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Apr 25 21:20:26 2018
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:321963,324153,324855,325147


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r330920 - Creating release directory for release_601.

2018-04-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Apr 25 21:21:02 2018
New Revision: 330920

URL: http://llvm.org/viewvc/llvm-project?rev=330920&view=rev
Log:
Creating release directory for release_601.

Added:
libunwind/tags/RELEASE_601/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r330921 - Creating release candidate rc1 from release_601 branch

2018-04-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Apr 25 21:21:05 2018
New Revision: 330921

URL: http://llvm.org/viewvc/llvm-project?rev=330921&view=rev
Log:
Creating release candidate rc1 from release_601 branch

Added:
libunwind/tags/RELEASE_601/rc1/
  - copied from r330920, libunwind/branches/release_60/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r331330 - Creating release candidate final from release_502 branch

2018-05-01 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue May  1 20:23:58 2018
New Revision: 331330

URL: http://llvm.org/viewvc/llvm-project?rev=331330&view=rev
Log:
Creating release candidate final from release_502 branch

Added:
libcxxabi/tags/RELEASE_502/final/
  - copied from r331329, libcxxabi/branches/release_50/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r331329 - Creating release candidate final from release_502 branch

2018-05-01 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue May  1 20:23:55 2018
New Revision: 331329

URL: http://llvm.org/viewvc/llvm-project?rev=331329&view=rev
Log:
Creating release candidate final from release_502 branch

Added:
libcxx/tags/RELEASE_502/final/   (props changed)
  - copied from r331328, libcxx/branches/release_50/

Propchange: libcxx/tags/RELEASE_502/final/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue May  1 20:23:55 2018
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:309296,309307,309474,309838,309851,309917,309920


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r331336 - Creating release candidate final from release_502 branch

2018-05-01 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue May  1 20:24:29 2018
New Revision: 331336

URL: http://llvm.org/viewvc/llvm-project?rev=331336&view=rev
Log:
Creating release candidate final from release_502 branch

Added:
libunwind/tags/RELEASE_502/final/   (props changed)
  - copied from r331335, libunwind/branches/release_50/

Propchange: libunwind/tags/RELEASE_502/final/
--
svn:mergeinfo = /libunwind/trunk:308871,309147


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r335533 - Creating release candidate final from release_601 branch

2018-06-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun 25 14:50:10 2018
New Revision: 335533

URL: http://llvm.org/viewvc/llvm-project?rev=335533&view=rev
Log:
Creating release candidate final from release_601 branch

Added:
libcxx/tags/RELEASE_601/final/   (props changed)
  - copied from r335532, libcxx/branches/release_60/

Propchange: libcxx/tags/RELEASE_601/final/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Mon Jun 25 14:50:10 2018
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:321963,324153,324855,325147


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r335534 - Creating release candidate final from release_601 branch

2018-06-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun 25 14:50:14 2018
New Revision: 335534

URL: http://llvm.org/viewvc/llvm-project?rev=335534&view=rev
Log:
Creating release candidate final from release_601 branch

Added:
libcxxabi/tags/RELEASE_601/final/
  - copied from r335533, libcxxabi/branches/release_60/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r335540 - Creating release candidate final from release_601 branch

2018-06-25 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Mon Jun 25 14:50:42 2018
New Revision: 335540

URL: http://llvm.org/viewvc/llvm-project?rev=335540&view=rev
Log:
Creating release candidate final from release_601 branch

Added:
libunwind/tags/RELEASE_601/final/
  - copied from r335539, libunwind/branches/release_60/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r336037 - Driver: Don't mix system tools with devtoolset tools on RHEL

2018-06-29 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Jun 29 19:55:54 2018
New Revision: 336037

URL: http://llvm.org/viewvc/llvm-project?rev=336037&view=rev
Log:
Driver: Don't mix system tools with devtoolset tools on RHEL

Summary:
On RHEL, devtoolset provides a more up-to-date toolchain than the base
install, and we want to make sure all the tools use are from the same
toolchain.

Reviewers: rsmith, bruno

Reviewed By: bruno

Subscribers: bruno, cfe-commits

Differential Revision: https://reviews.llvm.org/D34848

Modified:
cfe/trunk/lib/Driver/ToolChains/Linux.cpp
cfe/trunk/test/Driver/linux-ld.c

Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=336037&r1=336036&r2=336037&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Fri Jun 29 19:55:54 2018
@@ -238,6 +238,15 @@ Linux::Linux(const Driver &D, const llvm
 ExtraOpts.push_back("relro");
   }
 
+  if (GCCInstallation.getParentLibPath().find("opt/rh/devtoolset") !=
+  StringRef::npos)
+// With devtoolset on RHEL, we want to add a bin directory that is relative
+// to the detected gcc install, because if we are using devtoolset gcc then
+// we want to use other tools from devtoolset (e.g. ld) instead of the
+// standard system tools.
+PPaths.push_back(Twine(GCCInstallation.getParentLibPath() +
+ "/../bin").str());
+
   if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
 ExtraOpts.push_back("-X");
 

Modified: cfe/trunk/test/Driver/linux-ld.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=336037&r1=336036&r2=336037&view=diff
==
--- cfe/trunk/test/Driver/linux-ld.c (original)
+++ cfe/trunk/test/Driver/linux-ld.c Fri Jun 29 19:55:54 2018
@@ -1782,3 +1782,12 @@
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
 // CHECK-LD-GENTOO-X32: "-lc"
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: 
--gcc-toolchain="%S/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr" \
+// RUN: --sysroot=%S/Inputs/rhel_7_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LD-RHEL7-DTS %s
+// CHECK-LD-RHEL7-DTS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-LD-RHLE7-DTS: Selected GCC installation: 
[[GCC_INSTALL:[[SYSROOT]]/lib/gcc/x86_64-redhat-linux/7]]
+// CHECK-LD-RHEL7-DTS-NOT: /usr/bin/ld
+// CHECK-LD-RHLE7-DTS: [[GCC_INSTALL]/../../../bin/ld


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r336039 - Driver: Add an explicit target to testcase from r336037

2018-06-29 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Fri Jun 29 20:50:10 2018
New Revision: 336039

URL: http://llvm.org/viewvc/llvm-project?rev=336039&view=rev
Log:
Driver: Add an explicit target to testcase from r336037

Modified:
cfe/trunk/test/Driver/linux-ld.c

Modified: cfe/trunk/test/Driver/linux-ld.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=336039&r1=336038&r2=336039&view=diff
==
--- cfe/trunk/test/Driver/linux-ld.c (original)
+++ cfe/trunk/test/Driver/linux-ld.c Fri Jun 29 20:50:10 2018
@@ -1784,6 +1784,7 @@
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
 
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux-gnu \
 // RUN: 
--gcc-toolchain="%S/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr" \
 // RUN: --sysroot=%S/Inputs/rhel_7_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-LD-RHEL7-DTS %s


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r374218 - Bump version to 9.0.1

2019-10-09 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Oct  9 13:41:02 2019
New Revision: 374218

URL: http://llvm.org/viewvc/llvm-project?rev=374218&view=rev
Log:
Bump version to 9.0.1

Modified:
libunwind/branches/release_90/CMakeLists.txt

Modified: libunwind/branches/release_90/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/branches/release_90/CMakeLists.txt?rev=374218&r1=374217&r2=374218&view=diff
==
--- libunwind/branches/release_90/CMakeLists.txt (original)
+++ libunwind/branches/release_90/CMakeLists.txt Wed Oct  9 13:41:02 2019
@@ -83,7 +83,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   endif()
 
   set(PACKAGE_NAME libunwind)
-  set(PACKAGE_VERSION 9.0.0)
+  set(PACKAGE_VERSION 9.0.1)
   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
   set(PACKAGE_BUGREPORT "llvm-b...@lists.llvm.org")
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] d970ab6 - Driver: Accept multiple --config options if filenames are the same

2020-06-16 Thread Tom Stellard via cfe-commits

Author: Tom Stellard
Date: 2020-06-16T12:23:57-07:00
New Revision: d970ab63e22eb5918774953da6b99ac27e5832a0

URL: 
https://github.com/llvm/llvm-project/commit/d970ab63e22eb5918774953da6b99ac27e5832a0
DIFF: 
https://github.com/llvm/llvm-project/commit/d970ab63e22eb5918774953da6b99ac27e5832a0.diff

LOG: Driver: Accept multiple --config options if filenames are the same

Summary:
We're trying to use the --config options to pass distro specific
options for Fedora via the CFLAGS variable.  However, some projects
end up using the CFLAGS variable multiple times in their command line,
which leads to an error when --config is used.

This patch resolves this issue by allowing more than one --config option
on the command line as long as the file names are the same.

Reviewers: sepavloff, hfinkel

Reviewed By: sepavloff

Subscribers: cfe-commits, llvm-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81424

Added: 


Modified: 
clang/lib/Driver/Driver.cpp
clang/test/Driver/config-file.c

Removed: 




diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 3add665c1156..a8442d2cd0af 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -833,8 +833,12 @@ bool Driver::loadConfigFile() {
 std::vector ConfigFiles =
 CLOptions->getAllArgValues(options::OPT_config);
 if (ConfigFiles.size() > 1) {
-  Diag(diag::err_drv_duplicate_config);
-  return true;
+  if (!std::all_of(
+  ConfigFiles.begin(), ConfigFiles.end(),
+  [ConfigFiles](std::string s) { return s == ConfigFiles[0]; })) {
+Diag(diag::err_drv_duplicate_config);
+return true;
+  }
 }
 
 if (!ConfigFiles.empty()) {

diff  --git a/clang/test/Driver/config-file.c b/clang/test/Driver/config-file.c
index 04127d404f67..fde7260ecd73 100644
--- a/clang/test/Driver/config-file.c
+++ b/clang/test/Driver/config-file.c
@@ -71,3 +71,8 @@
 // RUN: %clang --config-system-dir=%S/Inputs/config 
--config-user-dir=%S/Inputs/config2 --config config-4 -S %s -o /dev/null -v 
2>&1 | FileCheck %s -check-prefix CHECK-PRECEDENCE
 // CHECK-PRECEDENCE: Configuration file: 
{{.*}}Inputs{{.}}config2{{.}}config-4.cfg
 // CHECK-PRECEDENCE: -Wall
+
+
+//--- Duplicate --config options are allowed if the value is the same
+// RUN: %clang --config-system-dir=%S/Inputs/config 
--config-user-dir=%S/Inputs/config2 --config config-4 --config config-4 -S %s 
-o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-SAME-CONFIG
+// CHECK-SAME-CONFIG: Configuration file: 
{{.*}}Inputs{{.}}config2{{.}}config-4.cfg



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 1d68a78 - [clang-shlib] Don't link with static clang libraries

2020-07-10 Thread Tom Stellard via cfe-commits

Author: Tom Stellard
Date: 2020-07-10T14:28:05-07:00
New Revision: 1d68a780b34e1f18f865d0754fce6c6177dc5d21

URL: 
https://github.com/llvm/llvm-project/commit/1d68a780b34e1f18f865d0754fce6c6177dc5d21
DIFF: 
https://github.com/llvm/llvm-project/commit/1d68a780b34e1f18f865d0754fce6c6177dc5d21.diff

LOG: [clang-shlib] Don't link with static clang libraries

Summary:
If we are building static libraries we don't need to link them into
clang-shlib, since clang-shlib already has all the individual object
files linked in.

Reviewers: smeenai

Reviewed By: smeenai

Subscribers: mgorny, cfe-commits, llvm-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82694

Added: 


Modified: 
clang/tools/clang-shlib/CMakeLists.txt

Removed: 




diff  --git a/clang/tools/clang-shlib/CMakeLists.txt 
b/clang/tools/clang-shlib/CMakeLists.txt
index 07ee0f0a9a92..5949223fc8e3 100644
--- a/clang/tools/clang-shlib/CMakeLists.txt
+++ b/clang/tools/clang-shlib/CMakeLists.txt
@@ -13,7 +13,12 @@ foreach (lib ${clang_libs})
   else()
 list(APPEND _OBJECTS $)
   endif()
-  list(APPEND _DEPS $)
+  if (BUILD_SHARED_LIBS)
+# If we are building static libraries, then we don't need to add the static
+# libraries as a depedency, because we are already linking against the
+# individual object files.
+list(APPEND _DEPS $)
+  endif()
 
   # clang libraries are redundant since we are linking all the individual
   # object files into libclang-cpp.so, so filter them out from _DEPS.



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] 174c41d - libclc: Pass system libraries to the linker after llvm libraries

2020-04-29 Thread Tom Stellard via cfe-commits

Author: Tom Stellard
Date: 2020-04-29T15:34:54-07:00
New Revision: 174c41defc63db4ac7594e00a5044672ff624a31

URL: 
https://github.com/llvm/llvm-project/commit/174c41defc63db4ac7594e00a5044672ff624a31
DIFF: 
https://github.com/llvm/llvm-project/commit/174c41defc63db4ac7594e00a5044672ff624a31.diff

LOG: libclc: Pass system libraries to the linker after llvm libraries

Summary:
The llvm libraries depend on the symbols in the system libaries, so
the system libraries need to be added after.

Reviewers: jvesely

Reviewed By: jvesely

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78535

Added: 


Modified: 
libclc/CMakeLists.txt

Removed: 




diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 7274f02f666b..7b981110f6fd 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -125,8 +125,8 @@ link_directories( ${LLVM_LIBDIR} )
 add_executable( prepare_builtins utils/prepare-builtins.cpp )
 target_compile_options( prepare_builtins PRIVATE ${LLVM_CXX_FLAGS} )
 target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
-target_link_libraries( prepare_builtins PRIVATE ${LLVM_SYSTEM_LIBS} )
 target_link_libraries( prepare_builtins PRIVATE ${LLVM_LIBS} )
+target_link_libraries( prepare_builtins PRIVATE ${LLVM_SYSTEM_LIBS} )
 
 # Setup arch devices
 set( r600--_devices cedar cypress barts cayman )



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] 3a7051d - libclc: Fix FP_ILOGBNAN definition

2020-08-17 Thread Tom Stellard via cfe-commits

Author: Boris Brezillon
Date: 2020-08-17T13:45:43-07:00
New Revision: 3a7051d9c28e3dd6da5048d91b74fad830728e93

URL: 
https://github.com/llvm/llvm-project/commit/3a7051d9c28e3dd6da5048d91b74fad830728e93
DIFF: 
https://github.com/llvm/llvm-project/commit/3a7051d9c28e3dd6da5048d91b74fad830728e93.diff

LOG: libclc: Fix FP_ILOGBNAN definition

Fix FP_ILOGBNAN definition to match the opencl-c-base.h one and
guarantee that FP_ILOGBNAN and FP_ILOGB0 are different. Doing that
implies fixing ilogb() implementation to return the right value.

Signed-off-by: Boris Brezillon 

Reviewed By: jvesely

Differential Revision: https://reviews.llvm.org/D83473

Added: 


Modified: 
libclc/generic/include/clc/float/definitions.h
libclc/generic/lib/math/ilogb.cl

Removed: 




diff  --git a/libclc/generic/include/clc/float/definitions.h 
b/libclc/generic/include/clc/float/definitions.h
index 43335a787403..62501230c92d 100644
--- a/libclc/generic/include/clc/float/definitions.h
+++ b/libclc/generic/include/clc/float/definitions.h
@@ -15,7 +15,7 @@
 #define FLT_EPSILON 0x1.0p-23f
 
 #define FP_ILOGB0 (-2147483647 - 1)
-#define FP_ILOGBNAN (-2147483647 - 1)
+#define FP_ILOGBNAN 2147483647
 
 #define M_E_F   0x1.5bf0a8p+1f
 #define M_LOG2E_F   0x1.715476p+0f

diff  --git a/libclc/generic/lib/math/ilogb.cl 
b/libclc/generic/lib/math/ilogb.cl
index 7ab7899e0c59..050239c9c1ff 100644
--- a/libclc/generic/lib/math/ilogb.cl
+++ b/libclc/generic/lib/math/ilogb.cl
@@ -31,7 +31,15 @@ _CLC_OVERLOAD _CLC_DEF int ilogb(float x) {
 int rs = -118 - (int) clz(ux & MANTBITS_SP32);
 int r = (int) (ax >> EXPSHIFTBITS_SP32) - EXPBIAS_SP32;
 r = ax < 0x0080U ? rs : r;
-r = ax > EXPBITS_SP32 | ax == 0 ? 0x8000 : r;
+r = ax == 0 ? FP_ILOGB0 : r;
+
+// We could merge those 2 tests and have:
+//
+//r = ax >= EXPBITS_SP32 ? 0x7fff : r
+//
+// since FP_ILOGBNAN is set to INT_MAX, but it's clearer this way and
+// FP_ILOGBNAN can change without requiring changes to ilogb() code.
+r = ax > EXPBITS_SP32 ? FP_ILOGBNAN : r;
 r = ax == EXPBITS_SP32 ? 0x7fff : r;
 return r;
 }
@@ -47,7 +55,15 @@ _CLC_OVERLOAD _CLC_DEF int ilogb(double x) {
 int r = (int) (ax >> EXPSHIFTBITS_DP64) - EXPBIAS_DP64;
 int rs = -1011 - (int) clz(ax & MANTBITS_DP64);
 r = ax < 0x0010UL ? rs : r;
-r = ax > 0x7ff0UL | ax == 0UL ? 0x8000 : r;
+r = ax == 0UL ? FP_ILOGB0 : r;
+
+// We could merge those 2 tests and have:
+//
+//r = ax >= 0x7ff0UL ? 0x7fff : r
+//
+// since FP_ILOGBNAN is set to INT_MAX, but it's clearer this way and
+// FP_ILOGBNAN can change without requiring changes to ilogb() code.
+r = ax > 0x7ff0UL ? FP_ILOGBNAN : r;
 r = ax == 0x7ff0UL ? 0x7fff : r;
 return r;
 }



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] 3d21fa5 - libclc: Make all built-ins overloadable

2020-08-17 Thread Tom Stellard via cfe-commits

Author: Daniel Stone
Date: 2020-08-17T13:55:48-07:00
New Revision: 3d21fa56f5f5afbbf16b35b199480af71e1189a3

URL: 
https://github.com/llvm/llvm-project/commit/3d21fa56f5f5afbbf16b35b199480af71e1189a3
DIFF: 
https://github.com/llvm/llvm-project/commit/3d21fa56f5f5afbbf16b35b199480af71e1189a3.diff

LOG: libclc: Make all built-ins overloadable

The SPIR spec states that all OpenCL built-in functions should be
overloadable and mangled, to ensure consistency.

Add the overload attribute to functions which were missing them:
work dimensions, memory barriers and fences, and events.

Reviewed By: tstellar, jenatali

Differential Revision: https://reviews.llvm.org/D82078

Added: 


Modified: 
libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl
libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl
libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
libclc/amdgcn/lib/mem_fence/fence.cl
libclc/amdgcn/lib/synchronization/barrier.cl
libclc/amdgcn/lib/workitem/get_global_offset.cl
libclc/amdgcn/lib/workitem/get_global_size.cl
libclc/amdgcn/lib/workitem/get_group_id.cl
libclc/amdgcn/lib/workitem/get_local_id.cl
libclc/amdgcn/lib/workitem/get_local_size.cl
libclc/amdgcn/lib/workitem/get_num_groups.cl
libclc/amdgcn/lib/workitem/get_work_dim.cl
libclc/generic/include/clc/async/wait_group_events.h
libclc/generic/include/clc/explicit_fence/explicit_memory_fence.h
libclc/generic/include/clc/synchronization/barrier.h
libclc/generic/include/clc/workitem/get_global_id.h
libclc/generic/include/clc/workitem/get_global_offset.h
libclc/generic/include/clc/workitem/get_global_size.h
libclc/generic/include/clc/workitem/get_group_id.h
libclc/generic/include/clc/workitem/get_local_id.h
libclc/generic/include/clc/workitem/get_local_size.h
libclc/generic/include/clc/workitem/get_num_groups.h
libclc/generic/include/clc/workitem/get_work_dim.h
libclc/generic/lib/async/wait_group_events.cl
libclc/generic/lib/workitem/get_global_id.cl
libclc/generic/lib/workitem/get_global_size.cl
libclc/ptx-nvidiacl/lib/mem_fence/fence.cl
libclc/ptx-nvidiacl/lib/synchronization/barrier.cl
libclc/ptx-nvidiacl/lib/workitem/get_global_id.cl
libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl
libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl
libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl
libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl
libclc/r600/lib/synchronization/barrier.cl
libclc/r600/lib/workitem/get_global_offset.cl
libclc/r600/lib/workitem/get_global_size.cl
libclc/r600/lib/workitem/get_group_id.cl
libclc/r600/lib/workitem/get_local_id.cl
libclc/r600/lib/workitem/get_local_size.cl
libclc/r600/lib/workitem/get_num_groups.cl
libclc/r600/lib/workitem/get_work_dim.cl

Removed: 




diff  --git a/libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl 
b/libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl
index 2f95f9916b2c..62bd2ba28352 100644
--- a/libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl
+++ b/libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl
@@ -15,10 +15,9 @@
 CONST_AS uchar * __clc_amdgcn_dispatch_ptr(void) 
__asm("llvm.amdgcn.dispatch.ptr");
 #endif
 
-_CLC_DEF size_t get_global_size(uint dim)
-{
-   CONST_AS uint * ptr = (CONST_AS uint *) __dispatch_ptr();
-   if (dim < 3)
-   return ptr[3 + dim];
-   return 1;
+_CLC_DEF _CLC_OVERLOAD size_t get_global_size(uint dim) {
+  CONST_AS uint *ptr = (CONST_AS uint *)__dispatch_ptr();
+  if (dim < 3)
+return ptr[3 + dim];
+  return 1;
 }

diff  --git a/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl 
b/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl
index 9f208d8aea77..9f09fd5a16ec 100644
--- a/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl
+++ b/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl
@@ -15,16 +15,15 @@
 CONST_AS char * __clc_amdgcn_dispatch_ptr(void) 
__asm("llvm.amdgcn.dispatch.ptr");
 #endif
 
-_CLC_DEF size_t get_local_size(uint dim)
-{
-   CONST_AS uint * ptr = (CONST_AS uint *) __dispatch_ptr();
-   switch (dim) {
-   case 0:
-   return ptr[1] & 0xu;
-   case 1:
-   return ptr[1] >> 16;
-   case 2:
-   return ptr[2] & 0xu;
-   }
-   return 1;
+_CLC_DEF _CLC_OVERLOAD size_t get_local_size(uint dim) {
+  CONST_AS uint *ptr = (CONST_AS uint *)__dispatch_ptr();
+  switch (dim) {
+  case 0:
+return ptr[1] & 0xu;
+  case 1:
+return ptr[1] >> 16;
+  case 2:
+return ptr[2] & 0xu;
+  }
+  return 1;
 }

diff  --git a/libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl 
b/libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
index 946b526fdb68..35dc22188521 100644
--- a/libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
+++ b/libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
@@ -1,7 +1,7 @@
 
 #include 
 
-_C

[libclc] c37145c - libclc: Add Mesa/SPIR-V target

2020-08-17 Thread Tom Stellard via cfe-commits

Author: Dave Airlie
Date: 2020-08-17T14:01:46-07:00
New Revision: c37145cab12168798a603e22af6b6bf6f606b705

URL: 
https://github.com/llvm/llvm-project/commit/c37145cab12168798a603e22af6b6bf6f606b705
DIFF: 
https://github.com/llvm/llvm-project/commit/c37145cab12168798a603e22af6b6bf6f606b705.diff

LOG: libclc: Add Mesa/SPIR-V target

Add targets to emit SPIR-V targeted to Mesa's OpenCL support, using
SPIR-V 1.1.

Substantially based on Dave Airlie's earlier work.

libclc: spirv: remove step/smoothstep apis not defined for SPIR-V

libclc: disable inlines for SPIR-V builds

Reviewed By: jvesely, tstellar, jenatali

Differential Revision: https://reviews.llvm.org/D77589

Added: 
libclc/spirv/lib/SOURCES
libclc/spirv/lib/subnormal_config.cl
libclc/spirv64/lib/SOURCES
libclc/spirv64/lib/subnormal_config.cl

Modified: 
libclc/CMakeLists.txt
libclc/generic/include/clc/clcfunc.h
libclc/generic/lib/common/smoothstep.cl
libclc/generic/lib/common/step.cl

Removed: 




diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index c12dc10fa45d..1a77a378e192 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -10,7 +10,9 @@ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
   generic/lib/SOURCES;
   ptx/lib/SOURCES;
   ptx-nvidiacl/lib/SOURCES;
-  r600/lib/SOURCES
+  r600/lib/SOURCES;
+  spirv/lib/SOURCES;
+  spirv64/lib/SOURCES
 )
 
 # List of all targets
@@ -22,6 +24,8 @@ set( LIBCLC_TARGETS_ALL
   nvptx64--
   nvptx--nvidiacl
   nvptx64--nvidiacl
+  spirv-mesa3d-
+  spirv64-mesa3d-
 )
 
 set( LIBCLC_MIN_LLVM "3.9.0" )
@@ -53,8 +57,6 @@ if( LIBCLC_TARGETS_TO_BUILD STREQUAL "all" )
set( LIBCLC_TARGETS_TO_BUILD ${LIBCLC_TARGETS_ALL} )
 endif()
 
-list( SORT LIBCLC_TARGETS_TO_BUILD )
-
 execute_process( COMMAND ${LLVM_CONFIG} "--system-libs"
OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE )
@@ -93,17 +95,27 @@ find_program( LLVM_CLANG clang PATHS ${LLVM_BINDIR} 
NO_DEFAULT_PATH )
 find_program( LLVM_AS llvm-as PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH )
 find_program( LLVM_LINK llvm-link PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH )
 find_program( LLVM_OPT opt PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH )
+find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH )
 
 # Print toolchain
 message( "clang: ${LLVM_CLANG}" )
 message( "llvm-as: ${LLVM_AS}" )
 message( "llvm-link: ${LLVM_LINK}" )
 message( "opt: ${LLVM_OPT}" )
+message( "llvm-spirv: ${LLVM_SPIRV}" )
 message( "" )
 if( NOT LLVM_CLANG OR NOT LLVM_OPT OR NOT LLVM_AS OR NOT LLVM_LINK )
message( FATAL_ERROR "toolchain incomplete!" )
 endif()
 
+list( SORT LIBCLC_TARGETS_TO_BUILD )
+
+if( "spirv-mesa3d-" IN_LIST LIBCLC_TARGETS_TO_BUILD OR "spirv64-mesa3d-" 
IN_LIST LIBCLC_TARGETS_TO_BUILD )
+   if( NOT LLVM_SPIRV )
+   message( FATAL_ERROR "SPIR-V targets requested, but spirv-tools 
is not installed" )
+   endif()
+endif()
+
 set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
 set( CMAKE_CLC_COMPILER ${LLVM_CLANG} )
 set( CMAKE_CLC_ARCHIVE ${LLVM_LINK} )
@@ -137,6 +149,8 @@ set( nvptx--_devices none )
 set( nvptx64--_devices none )
 set( nvptx--nvidiacl_devices none )
 set( nvptx64--nvidiacl_devices none )
+set( spirv-mesa3d-_devices none )
+set( spirv64-mesa3d-_devices none )
 
 # Setup aliases
 set( cedar_aliases palm sumo sumo2 redwood juniper )
@@ -187,9 +201,14 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
list( GET TRIPLE 1 VENDOR )
list( GET TRIPLE 2 OS )
 
-   set( dirs generic )
+   set( dirs )
+
+   if ( NOT ${ARCH} STREQUAL spirv AND NOT ${ARCH} STREQUAL spirv64 )
+   LIST( APPEND dirs generic )
+   endif()
+
if( ${ARCH} STREQUAL r600 OR ${ARCH} STREQUAL amdgcn )
-   set( dirs ${dirs} amdgpu )
+   list( APPEND dirs amdgpu )
endif()
 
#nvptx is special
@@ -215,10 +234,15 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 
# Add the generated convert.cl here to prevent adding
# the one listed in SOURCES
-   set( rel_files convert.cl )
-   set( objects convert.cl )
-   if( NOT ENABLE_RUNTIME_SUBNORMAL )
-   list( APPEND rel_files generic/lib/subnormal_use_default.ll )
+   if( NOT ${ARCH} STREQUAL "spirv" AND NOT ${ARCH} STREQUAL "spirv64" )
+   set( rel_files convert.cl )
+   set( objects convert.cl )
+   if( NOT ENABLE_RUNTIME_SUBNORMAL )
+   list( APPEND rel_files 
generic/lib/subnormal_use_default.ll )
+   endif()
+   else()
+   set( rel_files )
+   set( objects )
endif()
 
foreach( l ${source_list} )
@@ -242,7 +266,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 
foreach( d ${${t}_devices} )
# Some targets don't have a specific GPU to target
-   if( ${d} STREQUAL "none" )
+

[PATCH] D24813: Driver: Add a test for triple with opencl environment

2016-09-21 Thread Tom Stellard via cfe-commits
tstellarAMD created this revision.
tstellarAMD added a reviewer: Anastasia.
tstellarAMD added a subscriber: cfe-commits.
Herald added subscribers: yaxunl, nhaehnle, wdng.

https://reviews.llvm.org/D24813

Files:
  test/Driver/amdgpu-toolchain.c

Index: test/Driver/amdgpu-toolchain.c
===
--- test/Driver/amdgpu-toolchain.c
+++ test/Driver/amdgpu-toolchain.c
@@ -4,3 +4,6 @@
 
 // RUN: %clang -### -g -target amdgcn--amdhsa -mcpu=kaveri %s 2>&1 | FileCheck 
-check-prefix=DWARF_VER %s
 // DWARF_VER: "-dwarf-version=2"
+
+// RUN: %clang -### -target amdgcn--amdhsa-opencl %s 2>&1 | FileCheck 
--check-prefix=OPENCL-ENV %s
+// OPENCL-ENV: "-triple" "amdgcn--amdhsa-opencl"


Index: test/Driver/amdgpu-toolchain.c
===
--- test/Driver/amdgpu-toolchain.c
+++ test/Driver/amdgpu-toolchain.c
@@ -4,3 +4,6 @@
 
 // RUN: %clang -### -g -target amdgcn--amdhsa -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
 // DWARF_VER: "-dwarf-version=2"
+
+// RUN: %clang -### -target amdgcn--amdhsa-opencl %s 2>&1 | FileCheck --check-prefix=OPENCL-ENV %s
+// OPENCL-ENV: "-triple" "amdgcn--amdhsa-opencl"
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D24688: Introduce "hosted" module flag.

2016-09-21 Thread Tom Stellard via cfe-commits
tstellarAMD added a comment.

What does  "hosted mode" mean?


https://reviews.llvm.org/D24688



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D24513: [AMDGPU] Expose flat work group size, register and wave control attributes

2016-09-22 Thread Tom Stellard via cfe-commits
tstellarAMD accepted this revision.
tstellarAMD added a comment.

LGTM.


https://reviews.llvm.org/D24513



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25343: [OpenCL] Mark group functions as noduplicate in opencl-c.h

2016-10-11 Thread Tom Stellard via cfe-commits
tstellarAMD added a comment.

In https://reviews.llvm.org/D25343#565288, @Anastasia wrote:

> Do you have any code example where Clang/LLVM performs wrong optimizations 
> with respect to the control flow of SPMD execution?
>
> My understanding from the earlier discussion we have had: 
> https://www.mail-archive.com/cfe-commits@lists.llvm.org/msg22643.html that 
> noduplicate is essentially enough for the frontend to prevent erroneous 
> optimizations. Because in general compiler can't do much with unknown 
> function calls.


noduplicate is enough for correctness, but it prevents legal optimizations, 
like unrolling loops with barriers.  The convergent attribute was added 
specifically for these kinds of builtins, so we should be using it here instead 
of noduplicate.

> For LLVM intrinsics it is slightly different as I can deduce from this 
> discussion:http://lists.llvm.org/pipermail/llvm-dev/2015-May/085558.html . It 
> seems like by default it's assumed to be side effect free and can be 
> optimized in various ways.




https://reviews.llvm.org/D25343



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r318835 - Merging r312892:

2017-11-22 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Nov 22 06:45:26 2017
New Revision: 318835

URL: http://llvm.org/viewvc/llvm-project?rev=318835&view=rev
Log:
Merging r312892:


r312892 | ericwf | 2017-09-10 16:41:20 -0700 (Sun, 10 Sep 2017) | 10 lines

Fix PR34298 - Allow std::function with an incomplete return type.

This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated
the __invokable trait via the converting constructor `function(Tp)` [with Tp = 
std::function]
whenever the copy constructor or copy assignment operator
was required. This patch further constrains that constructor to short
circut before evaluating the troublesome SFINAE when `Tp` matches
std::function.

The original patch is from Alex Lorenz.


Modified:
libcxx/branches/release_50/include/functional
libcxx/branches/release_50/include/type_traits

libcxx/branches/release_50/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp

Modified: libcxx/branches/release_50/include/functional
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/branches/release_50/include/functional?rev=318835&r1=318834&r2=318835&view=diff
==
--- libcxx/branches/release_50/include/functional (original)
+++ libcxx/branches/release_50/include/functional Wed Nov 22 06:45:26 2017
@@ -1597,9 +1597,11 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(
   return reinterpret_cast<__base*>(p);
 }
 
-template ::value &&
-__invokable<_Fp&, _ArgTypes...>::value>
-struct __callable;
+template , function>::value>,
+__invokable<_Fp&, _ArgTypes...>
+>::value>
+struct __callable;
 template 
 struct __callable<_Fp, true>
 {
@@ -1612,6 +1614,9 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(
 {
 static const bool value = false;
 };
+
+  template 
+  using _EnableIfCallable = typename enable_if<__callable<_Fp>::value>::type;
 public:
 typedef _Rp result_type;
 
@@ -1622,9 +1627,7 @@ public:
 function(nullptr_t) _NOEXCEPT : __f_(0) {}
 function(const function&);
 function(function&&) _NOEXCEPT;
-template::value && !is_same<_Fp, function>::value
->::type>
+template>
 function(_Fp);
 
 #if _LIBCPP_STD_VER <= 14
@@ -1638,21 +1641,15 @@ public:
   function(allocator_arg_t, const _Alloc&, const function&);
 template
   function(allocator_arg_t, const _Alloc&, function&&);
-template::value>::type>
+template>
   function(allocator_arg_t, const _Alloc& __a, _Fp __f);
 #endif
 
 function& operator=(const function&);
 function& operator=(function&&) _NOEXCEPT;
 function& operator=(nullptr_t) _NOEXCEPT;
-template
-  typename enable_if
-  <
-__callable::type>::value &&
-!is_same::type, function>::value,
-function&
-  >::type
-  operator=(_Fp&&);
+template>
+function& operator=(_Fp&&);
 
 ~function();
 
@@ -1854,13 +1851,8 @@ function<_Rp(_ArgTypes...)>::operator=(n
 }
 
 template
-template 
-typename enable_if
-<
-function<_Rp(_ArgTypes...)>::template __callable::type>::value &&
-!is_same::type, 
function<_Rp(_ArgTypes...)>>::value,
-function<_Rp(_ArgTypes...)>&
->::type
+template 
+function<_Rp(_ArgTypes...)>&
 function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f)
 {
 function(_VSTD::forward<_Fp>(__f)).swap(*this);

Modified: libcxx/branches/release_50/include/type_traits
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/branches/release_50/include/type_traits?rev=318835&r1=318834&r2=318835&view=diff
==
--- libcxx/branches/release_50/include/type_traits (original)
+++ libcxx/branches/release_50/include/type_traits Wed Nov 22 06:45:26 2017
@@ -4339,8 +4339,8 @@ struct __invokable_r
 using _Result = decltype(
 _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...));
 
-static const bool value =
-conditional<
+using type =
+typename conditional<
 !is_same<_Result, __nat>::value,
 typename conditional<
 is_void<_Ret>::value,
@@ -4348,7 +4348,8 @@ struct __invokable_r
 is_convertible<_Result, _Ret>
 >::type,
 false_type
->::type::value;
+>::type;
+static const bool value = type::value;
 };
 
 template 

Modified: 
libcxx/branches/release_50/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/branches/release_50/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp?rev=318835&r1=318834&r2=318835&view=diff
===

[libcxx] r318837 - Merging r315994:

2017-11-22 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Wed Nov 22 07:06:35 2017
New Revision: 318837

URL: http://llvm.org/viewvc/llvm-project?rev=318837&view=rev
Log:
Merging r315994:


r315994 | ericwf | 2017-10-17 06:03:17 -0700 (Tue, 17 Oct 2017) | 18 lines

[libc++] Fix PR34898 - vector iterator constructors and assign method perform 
push_back instead of emplace_back.

Summary:
The constructors `vector(Iter, Iter, Alloc = Alloc{})` and `assign(Iter, Iter)` 
don't correctly perform EmplaceConstruction from the result of dereferencing 
the iterator. This results in them performing an additional and unneeded copy.

This patch addresses the issue by correctly using `emplace_back` in C++11 and 
newer.

There are also some bugs in our `insert` implementation, but those will be 
handled separately.

@mclow.lists We should probably merge this into 5.1, agreed?

Reviewers: mclow.lists, dlj, EricWF

Reviewed By: mclow.lists, EricWF

Subscribers: cfe-commits, mclow.lists

Differential Revision: https://reviews.llvm.org/D38757


Added:

libcxx/branches/release_50/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp
libcxx/branches/release_50/test/support/emplace_constructible.h
Modified:
libcxx/branches/release_50/include/deque
libcxx/branches/release_50/include/list
libcxx/branches/release_50/include/vector

libcxx/branches/release_50/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp

libcxx/branches/release_50/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp

libcxx/branches/release_50/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp

libcxx/branches/release_50/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp

libcxx/branches/release_50/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp

libcxx/branches/release_50/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
libcxx/branches/release_50/test/support/container_test_types.h

Modified: libcxx/branches/release_50/include/deque
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/branches/release_50/include/deque?rev=318837&r1=318836&r2=318837&view=diff
==
--- libcxx/branches/release_50/include/deque (original)
+++ libcxx/branches/release_50/include/deque Wed Nov 22 07:06:35 2017
@@ -1356,7 +1356,6 @@ public:
 iterator insert(const_iterator __p, initializer_list __il)
 {return insert(__p, __il.begin(), __il.end());}
 #endif  // _LIBCPP_CXX03_LANG
-
 iterator insert(const_iterator __p, const value_type& __v);
 iterator insert(const_iterator __p, size_type __n, const value_type& __v);
 template 
@@ -2224,7 +2223,11 @@ deque<_Tp, _Allocator>::__append(_InpIte

!__is_forward_iterator<_InpIter>::value>::type*)
 {
 for (; __f != __l; ++__f)
+#ifdef _LIBCPP_CXX03_LANG
 push_back(*__f);
+#else
+emplace_back(*__f);
+#endif
 }
 
 template 

Modified: libcxx/branches/release_50/include/list
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/branches/release_50/include/list?rev=318837&r1=318836&r2=318837&view=diff
==
--- libcxx/branches/release_50/include/list (original)
+++ libcxx/branches/release_50/include/list Wed Nov 22 07:06:35 2017
@@ -992,6 +992,15 @@ public:
 void push_front(const value_type& __x);
 void push_back(const value_type& __x);
 
+#ifndef _LIBCPP_CXX03_LANG
+template 
+_LIBCPP_INLINE_VISIBILITY
+void __emplace_back(_Arg&& __arg) { 
emplace_back(_VSTD::forward<_Arg>(__arg)); }
+#else
+_LIBCPP_INLINE_VISIBILITY
+void __emplace_back(value_type const& __arg) { push_back(__arg); }
+#endif
+
 iterator insert(const_iterator __p, const value_type& __x);
 iterator insert(const_iterator __p, size_type __n, const value_type& __x);
 template 
@@ -1189,7 +1198,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _I
 __get_db()->__insert_c(this);
 #endif
 for (; __f != __l; ++__f)
-push_back(*__f);
+__emplace_back(*__f);
 }
 
 template 
@@ -1202,7 +1211,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _I
 __get_db()->__insert_c(this);
 #endif
 for (; __f != __l; ++__f)
-push_back(*__f);
+__emplace_back(*__f);
 }
 
 template 

Modified: libcxx/branches/release_50/include/vector
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/branches/release_50/include/vector?rev=318837&r1=318836&r2=318837&view=diff
==
--- libcxx/branches/release_50/include/vector (original)
+++ libcxx/branches/release_50/include/vector Wed Nov 22 07:06:35 2017
@@ -674,6 +674,17 @@ public:
 const

[libcxx] r319280 - Creating release candidate rc2 from release_501 branch

2017-11-28 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Nov 28 18:49:00 2017
New Revision: 319280

URL: http://llvm.org/viewvc/llvm-project?rev=319280&view=rev
Log:
Creating release candidate rc2 from release_501 branch

Added:
libcxx/tags/RELEASE_501/rc2/   (props changed)
  - copied from r319279, libcxx/branches/release_50/

Propchange: libcxx/tags/RELEASE_501/rc2/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Nov 28 18:49:00 2017
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:309296,309307,309474,309838,309851,309917,309920


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r319281 - Creating release candidate rc2 from release_501 branch

2017-11-28 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Nov 28 18:49:04 2017
New Revision: 319281

URL: http://llvm.org/viewvc/llvm-project?rev=319281&view=rev
Log:
Creating release candidate rc2 from release_501 branch

Added:
libcxxabi/tags/RELEASE_501/rc2/
  - copied from r319280, libcxxabi/branches/release_50/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r319287 - Creating release candidate rc2 from release_501 branch

2017-11-28 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Tue Nov 28 18:49:31 2017
New Revision: 319287

URL: http://llvm.org/viewvc/llvm-project?rev=319287&view=rev
Log:
Creating release candidate rc2 from release_501 branch

Added:
libunwind/tags/RELEASE_501/rc2/   (props changed)
  - copied from r319286, libunwind/branches/release_50/

Propchange: libunwind/tags/RELEASE_501/rc2/
--
svn:mergeinfo = /libunwind/trunk:308871,309147


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r320096 - Creating release candidate rc3 from release_501 branch

2017-12-07 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Dec  7 14:10:39 2017
New Revision: 320096

URL: http://llvm.org/viewvc/llvm-project?rev=320096&view=rev
Log:
Creating release candidate rc3 from release_501 branch

Added:
libcxx/tags/RELEASE_501/rc3/   (props changed)
  - copied from r320095, libcxx/branches/release_50/

Propchange: libcxx/tags/RELEASE_501/rc3/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Dec  7 14:10:39 2017
@@ -0,0 +1,2 @@
+/libcxx/branches/apple:136569-137939
+/libcxx/trunk:309296,309307,309474,309838,309851,309917,309920


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] r320097 - Creating release candidate rc3 from release_501 branch

2017-12-07 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Dec  7 14:10:43 2017
New Revision: 320097

URL: http://llvm.org/viewvc/llvm-project?rev=320097&view=rev
Log:
Creating release candidate rc3 from release_501 branch

Added:
libcxxabi/tags/RELEASE_501/rc3/
  - copied from r320096, libcxxabi/branches/release_50/

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r320103 - Creating release candidate rc3 from release_501 branch

2017-12-07 Thread Tom Stellard via cfe-commits
Author: tstellar
Date: Thu Dec  7 14:11:09 2017
New Revision: 320103

URL: http://llvm.org/viewvc/llvm-project?rev=320103&view=rev
Log:
Creating release candidate rc3 from release_501 branch

Added:
libunwind/tags/RELEASE_501/rc3/   (props changed)
  - copied from r320102, libunwind/branches/release_50/

Propchange: libunwind/tags/RELEASE_501/rc3/
--
svn:mergeinfo = /libunwind/trunk:308871,309147


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Driver: Accept the --gcc-install-dir option multiple times (PR #71446)

2023-11-06 Thread Tom Stellard via cfe-commits

https://github.com/tstellar created 
https://github.com/llvm/llvm-project/pull/71446

The downside of the --gcc-install-dir is that you are required to specify a 
path that includes the gcc major version.  This makes it hard to use for 
distributions in configuration files, because an upgrade of gcc would cause 
clang to stop working.

We can fix this problem by accepting the --gcc-install-dir option multiple 
times.  This way distributions can specify all possible versions of gcc that 
might exist on the system in a config and avoid problems when gcc is upgraded.

>From 2474aad8585829936af66d8b1238a1876c0f8327 Mon Sep 17 00:00:00 2001
From: Tom Stellard 
Date: Mon, 6 Nov 2023 21:50:05 +
Subject: [PATCH] Driver: Accept the --gcc-install-dir option multiple times

The downside of the --gcc-install-dir is that you are required to
specify a path that includes the gcc major version.  This makes it
hard to use for distributions in configuration files, because an
upgrade of gcc would cause clang to stop working.

We can fix this problem by accepting the --gcc-install-dir option
multiple times.  This way distributions can specify all possible
versions of gcc that might exist on the system in a config and
avoid problems when gcc is upgraded.
---
 clang/include/clang/Driver/Options.td |  6 +++-
 clang/lib/Driver/ToolChains/Gnu.cpp   | 41 ---
 clang/test/Driver/gcc-install-dir.cpp | 13 +
 3 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 009ac1cfd8dc1b4..cb54bae9d322043 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -768,7 +768,11 @@ def B : JoinedOrSeparate<["-"], "B">, 
MetaVarName<"">,
 HelpText<"Search $prefix$file for executables, libraries, and data files. "
 "If $prefix is a directory, search $prefix/$file">;
 def gcc_install_dir_EQ : Joined<["--"], "gcc-install-dir=">,
-  HelpText<"Use GCC installation in the specified directory. The directory 
ends with path components like 'lib{,32,64}/gcc{,-cross}/$triple/$version'. "
+  HelpText<"Use GCC installation in the specified directory. The directory 
ends"
+   " with path components like 
'lib{,32,64}/gcc{,-cross}/$triple/$version'. "
+   " This option can be specified multiple times in which case clang 
will"
+   " start with last option and search until it finds a valid gcc 
install"
+   " among the given paths."
   "Note: executables (e.g. ld) used by the compiler are not overridden by the 
selected GCC installation">;
 def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>,
   HelpText<"Specify a directory where Clang can find 'include' and 
'lib{,32,64}/gcc{,-cross}/$triple/$version'. "
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp 
b/clang/lib/Driver/ToolChains/Gnu.cpp
index 3276590729e47ea..64645cd03b6f9fd 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2126,27 +2126,36 @@ void Generic_GCC::GCCInstallationDetector::init(
   StringRef TripleNoVendorRef(TripleNoVendor);
 
   // If --gcc-install-dir= is specified, skip filesystem detection.
-  if (const Arg *A =
-  Args.getLastArg(clang::driver::options::OPT_gcc_install_dir_EQ);
-  A && A->getValue()[0]) {
-StringRef InstallDir = A->getValue();
+  std::vector FailedGCCInstallDirs;
+  std::vector GCCInstallDirs = 
Args.getAllArgValues(clang::driver::options::OPT_gcc_install_dir_EQ);
+  for (auto it = GCCInstallDirs.rbegin(); it != GCCInstallDirs.rend(); ++it) {
+StringRef InstallDir = *it;
 if (!ScanGCCForMultilibs(TargetTriple, Args, InstallDir, false)) {
-  D.Diag(diag::err_drv_invalid_gcc_install_dir) << InstallDir;
-} else {
-  (void)InstallDir.consume_back("/");
-  StringRef VersionText = llvm::sys::path::filename(InstallDir);
-  StringRef TripleText =
-  llvm::sys::path::filename(llvm::sys::path::parent_path(InstallDir));
-
-  Version = GCCVersion::Parse(VersionText);
-  GCCTriple.setTriple(TripleText);
-  GCCInstallPath = std::string(InstallDir);
-  GCCParentLibPath = GCCInstallPath + "/../../..";
-  IsValid = true;
+  FailedGCCInstallDirs.push_back(std::string(InstallDir));
+  continue;
 }
+
+(void)InstallDir.consume_back("/");
+StringRef VersionText = llvm::sys::path::filename(InstallDir);
+StringRef TripleText =
+llvm::sys::path::filename(llvm::sys::path::parent_path(InstallDir));
+
+Version = GCCVersion::Parse(VersionText);
+GCCTriple.setTriple(TripleText);
+GCCInstallPath = std::string(InstallDir);
+GCCParentLibPath = GCCInstallPath + "/../../..";
+IsValid = true;
 return;
   }
 
+  for (auto FailedDir : FailedGCCInstallDirs) {
+D.Diag(diag::err_drv_invalid_gcc_install_dir) << FailedDir;
+  }
+
+  if (!FailedGCCInstallDirs.empty())
+return;
+
+
   // Compute the set of 

[clang] Driver: Accept the --gcc-install-dir option multiple times (PR #71446)

2023-11-06 Thread Tom Stellard via cfe-commits

tstellar wrote:

> When your system GCC moves 12 to 13, do you remove 
> `/usr/lib/gcc/x86_64-linux-gnu/12` and add `/usr/lib/gcc/x86_64-linux-gnu/13` 
> atomically?

Yes.

> Gentoo doesn't seem to have more driver option requirement. Perhaps @mgorny 
> @thesamesam can talk about they upgrade GCC and update Clang configuration 
> files.

Isn't this because the clang driver has custom logic for detecting gcc on 
Gentoo?

https://github.com/llvm/llvm-project/pull/71446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Driver: Accept the --gcc-install-dir option multiple times (PR #71446)

2023-11-07 Thread Tom Stellard via cfe-commits

tstellar wrote:

> I think I have expressed I wanted to say... The new probing semantics seems 
> really unusual to me. I do not feel that how path-related options usually 
> behave.
> 

@MaskRay Ok, what do you think would be a good alternative?  Another solution I 
considered was to have --gcc-install-dir accept paths like 
/usr/lib/gcc/x86_64-redhat-linux/ and then probe for the 'best' version in that 
directory, but I felt this complicated the logic too much.  Probably the most 
simple solution that would satisfy our requirements would be to add a new 
option `--gcc-triple` which would use the same probing logic as the driver does 
now except it would cause the driver to skip all the hard-coded triples and 
only search for the one specified by the option.

> Can the system be changed to keep both versions around before removing GCC 12?

No, it can't.

https://github.com/llvm/llvm-project/pull/71446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Driver] Simply some gcc search logic (PR #72558)

2023-11-16 Thread Tom Stellard via cfe-commits

https://github.com/tstellar created 
https://github.com/llvm/llvm-project/pull/72558

None

>From 3a0896141cf11c604f28326b3a6eee3762b4f79d Mon Sep 17 00:00:00 2001
From: Tom Stellard 
Date: Thu, 16 Nov 2023 05:54:29 +
Subject: [PATCH] [Driver] Simply some gcc search logic

---
 clang/lib/Driver/ToolChains/Gnu.cpp | 18 +++---
 clang/lib/Driver/ToolChains/Gnu.h   |  1 -
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp 
b/clang/lib/Driver/ToolChains/Gnu.cpp
index 19dff4ec4d45e08..d92c0f7f8984758 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2117,14 +2117,17 @@ void Generic_GCC::GCCInstallationDetector::init(
   // The compatible GCC triples for this particular architecture.
   SmallVector CandidateTripleAliases;
   SmallVector CandidateBiarchTripleAliases;
+  // Add some triples that we want to check first.
+  CandidateTripleAliases.push_back(TargetTriple.str());
+  std::string TripleNoVendor = TargetTriple.getArchName().str() + "-" +
+   TargetTriple.getOSAndEnvironmentName().str();
+  if (TargetTriple.getVendor() == llvm::Triple::UnknownVendor) {
+CandidateTripleAliases.push_back(TripleNoVendor);
+  }
   CollectLibDirsAndTriples(TargetTriple, BiarchVariantTriple, CandidateLibDirs,
CandidateTripleAliases, CandidateBiarchLibDirs,
CandidateBiarchTripleAliases);
 
-  TripleNoVendor = TargetTriple.getArchName().str() + "-" +
-   TargetTriple.getOSAndEnvironmentName().str();
-  StringRef TripleNoVendorRef(TripleNoVendor);
-
   // If --gcc-install-dir= is specified, skip filesystem detection.
   if (const Arg *A =
   Args.getLastArg(clang::driver::options::OPT_gcc_install_dir_EQ);
@@ -2204,13 +2207,6 @@ void Generic_GCC::GCCInstallationDetector::init(
   // Maybe filter out /gcc and /gcc-cross.
   bool GCCDirExists = VFS.exists(LibDir + "/gcc");
   bool GCCCrossDirExists = VFS.exists(LibDir + "/gcc-cross");
-  // Try to match the exact target triple first.
-  ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, TargetTriple.str(),
- false, GCCDirExists, GCCCrossDirExists);
-  // If vendor is unknown, let's try triple without vendor.
-  if (TargetTriple.getVendor() == llvm::Triple::UnknownVendor)
-ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, TripleNoVendorRef,
-   false, GCCDirExists, GCCCrossDirExists);
   for (StringRef Candidate : CandidateTripleAliases)
 ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, Candidate, false,
GCCDirExists, GCCCrossDirExists);
diff --git a/clang/lib/Driver/ToolChains/Gnu.h 
b/clang/lib/Driver/ToolChains/Gnu.h
index dcfc6307cac79e5..0b664a182d75e1c 100644
--- a/clang/lib/Driver/ToolChains/Gnu.h
+++ b/clang/lib/Driver/ToolChains/Gnu.h
@@ -249,7 +249,6 @@ class LLVM_LIBRARY_VISIBILITY Generic_GCC : public 
ToolChain {
 void print(raw_ostream &OS) const;
 
   private:
-std::string TripleNoVendor;
 static void
 CollectLibDirsAndTriples(const llvm::Triple &TargetTriple,
  const llvm::Triple &BiarchTriple,

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Driver] Simply some gcc search logic (PR #72558)

2023-11-21 Thread Tom Stellard via cfe-commits

https://github.com/tstellar updated 
https://github.com/llvm/llvm-project/pull/72558

>From 3a0896141cf11c604f28326b3a6eee3762b4f79d Mon Sep 17 00:00:00 2001
From: Tom Stellard 
Date: Thu, 16 Nov 2023 05:54:29 +
Subject: [PATCH 1/2] [Driver] Simply some gcc search logic

---
 clang/lib/Driver/ToolChains/Gnu.cpp | 18 +++---
 clang/lib/Driver/ToolChains/Gnu.h   |  1 -
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp 
b/clang/lib/Driver/ToolChains/Gnu.cpp
index 19dff4ec4d45e08..d92c0f7f8984758 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2117,14 +2117,17 @@ void Generic_GCC::GCCInstallationDetector::init(
   // The compatible GCC triples for this particular architecture.
   SmallVector CandidateTripleAliases;
   SmallVector CandidateBiarchTripleAliases;
+  // Add some triples that we want to check first.
+  CandidateTripleAliases.push_back(TargetTriple.str());
+  std::string TripleNoVendor = TargetTriple.getArchName().str() + "-" +
+   TargetTriple.getOSAndEnvironmentName().str();
+  if (TargetTriple.getVendor() == llvm::Triple::UnknownVendor) {
+CandidateTripleAliases.push_back(TripleNoVendor);
+  }
   CollectLibDirsAndTriples(TargetTriple, BiarchVariantTriple, CandidateLibDirs,
CandidateTripleAliases, CandidateBiarchLibDirs,
CandidateBiarchTripleAliases);
 
-  TripleNoVendor = TargetTriple.getArchName().str() + "-" +
-   TargetTriple.getOSAndEnvironmentName().str();
-  StringRef TripleNoVendorRef(TripleNoVendor);
-
   // If --gcc-install-dir= is specified, skip filesystem detection.
   if (const Arg *A =
   Args.getLastArg(clang::driver::options::OPT_gcc_install_dir_EQ);
@@ -2204,13 +2207,6 @@ void Generic_GCC::GCCInstallationDetector::init(
   // Maybe filter out /gcc and /gcc-cross.
   bool GCCDirExists = VFS.exists(LibDir + "/gcc");
   bool GCCCrossDirExists = VFS.exists(LibDir + "/gcc-cross");
-  // Try to match the exact target triple first.
-  ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, TargetTriple.str(),
- false, GCCDirExists, GCCCrossDirExists);
-  // If vendor is unknown, let's try triple without vendor.
-  if (TargetTriple.getVendor() == llvm::Triple::UnknownVendor)
-ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, TripleNoVendorRef,
-   false, GCCDirExists, GCCCrossDirExists);
   for (StringRef Candidate : CandidateTripleAliases)
 ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, Candidate, false,
GCCDirExists, GCCCrossDirExists);
diff --git a/clang/lib/Driver/ToolChains/Gnu.h 
b/clang/lib/Driver/ToolChains/Gnu.h
index dcfc6307cac79e5..0b664a182d75e1c 100644
--- a/clang/lib/Driver/ToolChains/Gnu.h
+++ b/clang/lib/Driver/ToolChains/Gnu.h
@@ -249,7 +249,6 @@ class LLVM_LIBRARY_VISIBILITY Generic_GCC : public 
ToolChain {
 void print(raw_ostream &OS) const;
 
   private:
-std::string TripleNoVendor;
 static void
 CollectLibDirsAndTriples(const llvm::Triple &TargetTriple,
  const llvm::Triple &BiarchTriple,

>From 994b7846d73b05ff8f5a41c56535e43e72f90220 Mon Sep 17 00:00:00 2001
From: Tom Stellard 
Date: Wed, 22 Nov 2023 00:18:57 +
Subject: [PATCH 2/2] Fix formatting

---
 clang/lib/Driver/ToolChains/Gnu.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp 
b/clang/lib/Driver/ToolChains/Gnu.cpp
index d92c0f7f8984758..0ea2df2ca8d87e2 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2121,9 +2121,9 @@ void Generic_GCC::GCCInstallationDetector::init(
   CandidateTripleAliases.push_back(TargetTriple.str());
   std::string TripleNoVendor = TargetTriple.getArchName().str() + "-" +
TargetTriple.getOSAndEnvironmentName().str();
-  if (TargetTriple.getVendor() == llvm::Triple::UnknownVendor) {
+  if (TargetTriple.getVendor() == llvm::Triple::UnknownVendor)
 CandidateTripleAliases.push_back(TripleNoVendor);
-  }
+
   CollectLibDirsAndTriples(TargetTriple, BiarchVariantTriple, CandidateLibDirs,
CandidateTripleAliases, CandidateBiarchLibDirs,
CandidateBiarchTripleAliases);

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Driver] Simply some gcc search logic (PR #72558)

2023-11-22 Thread Tom Stellard via cfe-commits

https://github.com/tstellar closed 
https://github.com/llvm/llvm-project/pull/72558
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


  1   2   3   4   5   6   >