[libcxx] r246915 - Try and fix links again. Seems to be a sphinx version issue.

2015-09-05 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sat Sep  5 02:20:53 2015
New Revision: 246915

URL: http://llvm.org/viewvc/llvm-project?rev=246915&view=rev
Log:
Try and fix links again. Seems to be a sphinx version issue.

Modified:
libcxx/trunk/docs/index.rst

Modified: libcxx/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/index.rst?rev=246915&r1=246914&r2=246915&view=diff
==
--- libcxx/trunk/docs/index.rst (original)
+++ libcxx/trunk/docs/index.rst Sat Sep  5 02:20:53 2015
@@ -102,9 +102,9 @@ C++ Dialect Support
 -
 
 * C++11 - Complete
-* `C++14 - Complete `__
-* `C++1z - In Progress `__
-* `Post C++14 Technical Specifications - In Progress `__
+* `C++14 - Complete `_
+* `C++1z - In Progress `_
+* `Post C++14 Technical Specifications - In Progress `_
 
 .. _cxx14 status: http://libcxx.llvm.org/cxx1y_status.html
 .. _cxx1z status: http://libcxx.llvm.org/cxx1z_status.html
@@ -122,7 +122,7 @@ This list contains known issues with lib
   must be used during configuration.
 
 
-A full list of currently open libc++ bugs can be `found here `__.
+A full list of currently open libc++ bugs can be `found here `_.
 
 .. _`libcxx bug list`: 
https://llvm.org/bugs/buglist.cgi?component=All%20Bugs&product=libc%2B%2B&query_format=advanced&resolution=---&order=changeddate%20DESC%2Cassigned_to%20DESC%2Cbug_status%2Cpriority%2Cbug_id&list_id=74184
 
@@ -132,7 +132,7 @@ Design Documents
 * ` design `_
 * ` design `_
 * `Status of debug mode `_
-* `Notes by Marshall Clow `__
+* `Notes by Marshall Clow `_
 
 .. _clow notes: 
https://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/
 
@@ -158,13 +158,13 @@ Please include "libc++" in your subject.
 **Patches**
 
 If you want to contribute a patch to libc++, the best place for that is
-`Phabricator `__. Please include [libcxx] in the subject and
+`Phabricator `_. Please include [libcxx] in the subject and
 add `cfe-commits` as a subscriber. Also make sure you are subscribed to the
-`cfe-commits mailing list `__.
+`cfe-commits mailing list `_.
 
 **Discussion and Questions**
 
-Send discussions and questions to the `cfe-dev mailing list `__.
+Send discussions and questions to the `cfe-dev mailing list `_.
 Please include [libcxx] in the subject.
 
 .. _phab doc: http://llvm.org/docs/Phabricator.html
@@ -172,11 +172,11 @@ Please include [libcxx] in the subject.
 
 Quick Links
 ===
-* `LLVM Homepage `__
-* `libc++abi Homepage `__
+* `LLVM Homepage `_
+* `libc++abi Homepage `_
 * `LLVM Bugzilla`_
-* `cfe-commits Mailing List `__
-* `cfe-dev Mailing List `__
+* `cfe-commits Mailing List `_
+* `cfe-dev Mailing List `_
 * `Browse libc++ -- SVN `_
 * `Browse libc++ -- ViewVC 
`_
 


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


Re: [PATCH] D12631: Avoid repeated replacements on loop-convert check.

2015-09-05 Thread Manuel Klimek via cfe-commits
klimek added a comment.

Note that I think we should add a regression test that will work with the 
spelling loc but not with the expansion loc.
Something like:
#define A \

   \
  

A


http://reviews.llvm.org/D12631



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


Re: [PATCH] D11781: Refactored pthread usage in libcxx

2015-09-05 Thread Fulvio Esposito via cfe-commits
espositofulvio updated the summary for this revision.
espositofulvio updated this revision to Diff 34104.
espositofulvio added a comment.

- Addressed possible ABI breaks
- Reverted to not using a __config_file as @jroelofs has two separate patch for 
that


Repository:
  rL LLVM

http://reviews.llvm.org/D11781

Files:
  .gitignore
  CMakeLists.txt
  include/__config
  include/__mutex_base
  include/mutex
  include/support/condition_variable.h
  include/support/mutex.h
  include/support/pthread/condition_variable.h
  include/support/pthread/mutex.h
  include/support/pthread/thread.h
  include/support/thread.h
  include/thread
  lib/CMakeLists.txt
  src/algorithm.cpp
  src/condition_variable.cpp
  src/memory.cpp
  src/mutex.cpp
  src/support/pthread/condition_variable.cpp
  src/support/pthread/mutex.cpp
  src/support/pthread/thread.cpp
  src/thread.cpp

Index: src/thread.cpp
===
--- src/thread.cpp
+++ src/thread.cpp
@@ -32,6 +32,8 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+using namespace __libcpp_support;
+
 thread::~thread()
 {
 if (__t_ != 0)
@@ -41,7 +43,7 @@
 void
 thread::join()
 {
-int ec = pthread_join(__t_, 0);
+int ec = __os_thread_join(__t_);
 #ifndef _LIBCPP_NO_EXCEPTIONS
 if (ec)
 throw system_error(error_code(ec, system_category()), "thread::join failed");
@@ -57,7 +59,7 @@
 int ec = EINVAL;
 if (__t_ != 0)
 {
-ec = pthread_detach(__t_);
+ec = __os_thread_detach(__t_);
 if (ec == 0)
 __t_ = 0;
 }
@@ -104,34 +106,12 @@
 namespace this_thread
 {
 
-void
-sleep_for(const chrono::nanoseconds& ns)
+void sleep_for(const chrono::nanoseconds& ns)
 {
-using namespace chrono;
-if (ns > nanoseconds::zero())
-{
-seconds s = duration_cast(ns);
-timespec ts;
-typedef decltype(ts.tv_sec) ts_sec;
-_LIBCPP_CONSTEXPR ts_sec ts_sec_max = numeric_limits::max();
-if (s.count() < ts_sec_max)
-{
-ts.tv_sec = static_cast(s.count());
-ts.tv_nsec = static_cast((ns-s).count());
-}
-else
-{
-ts.tv_sec = ts_sec_max;
-ts.tv_nsec = giga::num - 1;
-}
-
-while (nanosleep(&ts, &ts) == -1 && errno == EINTR)
-;
-}
+__libcpp_support::__os_sleep_for(ns);
 }
 
-}  // this_thread
-
+}
 __thread_specific_ptr<__thread_struct>&
 __thread_local_data()
 {
Index: src/support/pthread/thread.cpp
===
--- /dev/null
+++ src/support/pthread/thread.cpp
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+//===-- support/pthread/thread.cpp ===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "__config"
+
+#include 
+#include 
+#define _LIBCPP_INCLUDE_THREAD_API
+#include 
+#undef _LIBCPP_INCLUDE_THREAD_API
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+namespace __libcpp_support
+{
+
+void
+__os_sleep_for(const chrono::nanoseconds& ns)
+{
+using namespace chrono;
+if (ns > nanoseconds::zero())
+{
+seconds s = duration_cast(ns);
+timespec ts;
+typedef decltype(ts.tv_sec) ts_sec;
+_LIBCPP_CONSTEXPR ts_sec ts_sec_max = numeric_limits::max();
+if (s.count() < ts_sec_max)
+{
+ts.tv_sec = static_cast(s.count());
+ts.tv_nsec = static_cast((ns-s).count());
+}
+else
+{
+ts.tv_sec = ts_sec_max;
+ts.tv_nsec = giga::num - 1;
+}
+
+while (nanosleep(&ts, &ts) == -1 && errno == EINTR)
+;
+}
+}
+
+} //namespace __libcpp_support
+
+#endif // _LIBCPP_HAS_NO_THREADS
+_LIBCPP_END_NAMESPACE_STD
Index: src/support/pthread/mutex.cpp
===
--- /dev/null
+++ src/support/pthread/mutex.cpp
@@ -0,0 +1,131 @@
+// -*- C++ -*-
+//===-- support/pthread/thread.cpp ===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "__config"
+
+#include 
+#include 
+#include "../../include/atomic_support.h"
+
+#define _LIBCPP_INCLUDE_THREAD_API
+#include 
+#undef _LIBCPP_INCLUDE_THREAD_API
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+namespace __libcpp_support
+{
+
+void __os_recursive_mutex_init(__os_mutex* __m)
+{
+pthread_mutexattr_t attr;
+int ec = pthread_mutexattr_init(&attr);
+if (ec)
+goto fail;
+e

Re: [PATCH] D11328: [clang-tidy] new "throw-by-value-catch-by-reference" check for clang-tidy

2015-09-05 Thread Tobias Langner via cfe-commits
randomcppprogrammer added a reviewer: aaron.ballman.
randomcppprogrammer updated this revision to Diff 34111.
randomcppprogrammer added a comment.

Updated check according to comments given by Aaron Ballman. Most notable 
change: added optional check for throwing anonmyous temporaries.


http://reviews.llvm.org/D11328

Files:
  clang-tidy/misc/CMakeLists.txt
  clang-tidy/misc/MiscTidyModule.cpp
  clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
  clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h
  test/clang-tidy/misc-throw-by-value-catch-by-reference.cpp

Index: test/clang-tidy/misc-throw-by-value-catch-by-reference.cpp
===
--- /dev/null
+++ test/clang-tidy/misc-throw-by-value-catch-by-reference.cpp
@@ -0,0 +1,138 @@
+// RUN: %python %S/check_clang_tidy.py %s misc-throw-by-value-catch-by-reference %t
+
+//#include 
+
+class logic_error {
+public:
+  logic_error(const char *message) {}
+};
+
+typedef logic_error *logic_ptr;
+typedef logic_ptr logic_double_typedef;
+
+int lastException;
+
+logic_error CreateException() { return logic_error("created"); }
+
+void testThrowFunc() {
+  throw new logic_error("by pointer");
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: avoid throwing pointer
+  // [misc-throw-by-value-catch-by-reference]
+  logic_ptr tmp = new logic_error("by pointer");
+  throw tmp;
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: avoid throwing pointer
+  // [misc-throw-by-value-catch-by-reference]
+  // CHECK-MESSAGES: :[[@LINE-3]]:9: warning: prefer throwing anonymous
+  // temporaries [misc-throw-by-value-catch-by-reference]
+  throw logic_error("by value");
+  auto *literal = "test";
+  throw logic_error(literal);
+  throw "test string literal";
+  throw L"throw wide string literal";
+  const char *characters = 0;
+  throw characters;
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: avoid throwing pointer
+  // [misc-throw-by-value-catch-by-reference]
+  // CHECK-MESSAGES: :[[@LINE-3]]:9: warning: prefer throwing anonymous
+  // temporaries [misc-throw-by-value-catch-by-reference]
+  logic_error lvalue("lvalue");
+  throw lvalue;
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: prefer throwing anonymous
+  // temporaries [misc-throw-by-value-catch-by-reference]
+  
+  // can be enabled once std::move can be included
+  // throw std::move(lvalue)  
+  int &ex = lastException;
+  throw ex;
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: prefer throwing anonymous
+  // temporaries [misc-throw-by-value-catch-by-reference]
+  throw CreateException();
+}
+
+void throwReferenceFunc(logic_error &ref) {
+  throw ref;
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: prefer throwing anonymous
+  // temporaries [misc-throw-by-value-catch-by-reference]
+}
+
+void catchByPointer() {
+  try {
+testThrowFunc();
+  } catch (logic_error *e) {
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: catch by reference
+// [misc-throw-by-value-catch-by-reference]
+  }
+}
+
+void catchByValue() {
+  try {
+testThrowFunc();
+  } catch (logic_error e) {
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: catch by reference
+// [misc-throw-by-value-catch-by-reference]
+  }
+}
+
+void catchByReference() {
+  try {
+testThrowFunc();
+  } catch (logic_error &e) {
+  }
+}
+
+void catchByConstReference() {
+  try {
+testThrowFunc();
+  } catch (const logic_error &e) {
+  }
+}
+
+void catchTypedef() {
+  try {
+testThrowFunc();
+  } catch (logic_ptr) {
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: catch by reference
+// [misc-throw-by-value-catch-by-reference]
+  }
+}
+
+void catchAll() {
+  try {
+testThrowFunc();
+  } catch (...) {
+  }
+}
+
+void catchLiteral() {
+  try {
+testThrowFunc();
+  } catch (const char *) {
+  } catch (const wchar_t *) {
+// disabled for now until it is clear
+// how to enable them in the test
+//} catch (const char16_t*) {
+//} catch (const char32_t*) {
+  }
+}
+
+// catching fundamentals should not warn
+void catchFundamental() {
+  try {
+testThrowFunc();
+  } catch (int) {
+  } catch (double) {
+  } catch (unsigned long) {
+  }
+}
+
+struct TrivialType {
+  double x;
+  double y;
+};
+
+void catchTrivial() {
+  try {
+testThrowFunc();
+  } catch (TrivialType) {
+  }
+}
Index: clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h
===
--- /dev/null
+++ clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h
@@ -0,0 +1,43 @@
+//===--- ThrowByValueCatchByReferenceCheck.h - clang-tidy*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_THROW_BY_VALUE_CATCH_BY_REFERENCE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_THROW_BY_VALUE

r246931 - Index: expose visibility attribute

2015-09-05 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sat Sep  5 13:53:43 2015
New Revision: 246931

URL: http://llvm.org/viewvc/llvm-project?rev=246931&view=rev
Log:
Index: expose visibility attribute

Expose the previously unexposed visibility attribute via the python and C
bindings.

Added:
cfe/trunk/test/Index/visibility.c
Modified:
cfe/trunk/bindings/python/clang/cindex.py
cfe/trunk/include/clang-c/Index.h
cfe/trunk/tools/libclang/CIndex.cpp
cfe/trunk/tools/libclang/CXCursor.cpp

Modified: cfe/trunk/bindings/python/clang/cindex.py
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/bindings/python/clang/cindex.py?rev=246931&r1=246930&r2=246931&view=diff
==
--- cfe/trunk/bindings/python/clang/cindex.py (original)
+++ cfe/trunk/bindings/python/clang/cindex.py Sat Sep  5 13:53:43 2015
@@ -1100,6 +1100,8 @@ CursorKind.CUDAGLOBAL_ATTR = CursorKind(
 CursorKind.CUDAHOST_ATTR = CursorKind(415)
 CursorKind.CUDASHARED_ATTR = CursorKind(416)
 
+CursorKind.VISIBILITY_ATTR = CursorKind(417)
+
 ###
 # Preprocessing
 CursorKind.PREPROCESSING_DIRECTIVE = CursorKind(500)

Modified: cfe/trunk/include/clang-c/Index.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=246931&r1=246930&r2=246931&view=diff
==
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Sat Sep  5 13:53:43 2015
@@ -32,7 +32,7 @@
  * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
  */
 #define CINDEX_VERSION_MAJOR 0
-#define CINDEX_VERSION_MINOR 30
+#define CINDEX_VERSION_MINOR 31
 
 #define CINDEX_VERSION_ENCODE(major, minor) ( \
   ((major) * 1)   \
@@ -2279,7 +2279,8 @@ enum CXCursorKind {
   CXCursor_CUDAGlobalAttr= 414,
   CXCursor_CUDAHostAttr  = 415,
   CXCursor_CUDASharedAttr= 416,
-  CXCursor_LastAttr  = CXCursor_CUDASharedAttr,
+  CXCursor_VisibilityAttr= 417,
+  CXCursor_LastAttr  = CXCursor_VisibilityAttr,
 
   /* Preprocessing */
   CXCursor_PreprocessingDirective= 500,

Added: cfe/trunk/test/Index/visibility.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/visibility.c?rev=246931&view=auto
==
--- cfe/trunk/test/Index/visibility.c (added)
+++ cfe/trunk/test/Index/visibility.c Sat Sep  5 13:53:43 2015
@@ -0,0 +1,13 @@
+// RUN: c-index-test -index-file %s -target i686-pc-linux \
+// RUN:  | FileCheck %s -check-prefix CHECK -check-prefix CHECK-LINUX
+// RUN: c-index-test -index-file -Wno-unsupported-visibility %s -target 
i386-darwin \
+// RUN:  | FileCheck %s -check-prefix CHECK -check-prefix CHECK-DARWIN
+
+void __attribute__ (( visibility("default") )) default_visibility();
+// CHECK:  : attribute(visibility)=default
+void __attribute__ (( visibility("hidden") )) hidden_visibility();
+// CHECK:  : attribute(visibility)=hidden
+void __attribute__ (( visibility("protected") )) protected_visibility();
+// CHECK-LINUX:  : attribute(visibility)=protected
+// CHECK-DARWIN:  : attribute(visibility)=default
+

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=246931&r1=246930&r2=246931&view=diff
==
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Sat Sep  5 13:53:43 2015
@@ -3756,6 +3756,19 @@ CXString clang_getCursorSpelling(CXCurso
 return cxstring::createRef("packed");
   }
 
+  if (C.kind == CXCursor_VisibilityAttr) {
+const VisibilityAttr *AA = 
cast(cxcursor::getCursorAttr(C));
+switch (AA->getVisibility()) {
+case VisibilityAttr::VisibilityType::Default:
+  return cxstring::createRef("default");
+case VisibilityAttr::VisibilityType::Hidden:
+  return cxstring::createRef("hidden");
+case VisibilityAttr::VisibilityType::Protected:
+  return cxstring::createRef("protected");
+}
+llvm_unreachable("unknown visibility type");
+  }
+
   return cxstring::createEmpty();
 }
 
@@ -4237,6 +4250,8 @@ CXString clang_getCursorKindSpelling(enu
 return cxstring::createRef("attribute(host)");
   case CXCursor_CUDASharedAttr:
 return cxstring::createRef("attribute(shared)");
+  case CXCursor_VisibilityAttr:
+return cxstring::createRef("attribute(visibility)");
   case CXCursor_PreprocessingDirective:
 return cxstring::createRef("preprocessing directive");
   case CXCursor_MacroDefinition:

Modified: cfe/trunk/tools/libclang/CXCursor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=246931&r1=246930&r2=246931&view=diff
==
--- cfe

Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604

2015-09-05 Thread Joerg Sonnenberger via cfe-commits
On Fri, Sep 04, 2015 at 09:28:39PM +, Eric Fiselier via cfe-commits wrote:
> EricWF added a comment.
> 
> In http://reviews.llvm.org/D12512#237175, @joerg wrote:
> 
> > Please don't commit this as is. Many platforms have posix_memalign or 
> > equivalent, which makes this both simpler and potentially without wasting 
> > memory. Compare e.g. http://reviews.llvm.org/D12001.
> 
> 
> Will do. Any advice on detecting posix_memalign? I don't see anything in the 
> patch you pointed me to.

Provide a feature variable for it and set it by default. For Unix-like
systems, I think only Android wants to disable it by default. Not sure
about Windows and OSX.

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


Re: [PATCH][Solaris] Default to -fno-cxa-finalize

2015-09-05 Thread Saleem Abdulrasool via cfe-commits
On Fri, Sep 4, 2015 at 1:11 AM, Xan López via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> On Fri, Aug 28, 2015 at 07:52:17PM +0200, Xan López via cfe-commits wrote:
> > There is no __cxa_finalize symbol available on recent Solaris OS
> > versions, so we need this flag to make non trivial C++ programs run.
> >
> > Also stop looking for cxa_finalize.o, since it won't be there.
> >
> > (This patch sits on top of a couple of unreviewed patches that make
> clang actually work on Solaris, see:
> >
> >
> http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/292800.html
> >
> http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150817/293971.html
> >
> > It should be trivial to rebase against master if it is reviewed first
> though)
> >
> > Xan
>
> Ping?
>

Does this break with older Solaris releases?  How far back did this change
in Solaris?  The change itself should really be accompanied with a test.


> > From 014ddb164689a3452b76f85079f213d607d07840 Mon Sep 17 00:00:00 2001
> > From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
> > Date: Fri, 14 Aug 2015 11:36:56 +0200
> > Subject: [PATCH 2/4] [Solaris] Default to -fno-cxa-finalize
> >
> > There is no __cxa_finalize symbol available on recent Solaris OS
> > versions, so we need this flag to make non trivial C++ programs run.
> >
> > Also stop looking for cxa_finalize.o, since it won't be there.
> > ---
> >  lib/Driver/Tools.cpp | 9 +++--
> >  1 file changed, 3 insertions(+), 6 deletions(-)
> >
> > diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
> > index b204961..cf01d7b 100644
> > --- a/lib/Driver/Tools.cpp
> > +++ b/lib/Driver/Tools.cpp
> > @@ -4506,8 +4506,9 @@ void Clang::ConstructJob(Compilation &C, const
> JobAction &JA,
> >if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,
> >  options::OPT_fno_use_cxa_atexit,
> >  !IsWindowsCygnus && !IsWindowsGNU &&
> > -getToolChain().getArch() !=
> llvm::Triple::hexagon &&
> > -getToolChain().getArch() !=
> llvm::Triple::xcore) ||
> > +getToolChain().getTriple().getOS() !=
> llvm::Triple::Solaris &&
> > +getToolChain().getArch() != llvm::Triple::hexagon &&
> > +getToolChain().getArch() != llvm::Triple::xcore) ||
> >KernelOrKext)
> >  CmdArgs.push_back("-fno-use-cxa-atexit");
> >
> > @@ -6882,10 +6883,6 @@ void solaris::Linker::ConstructJob(Compilation
> &C, const JobAction &JA,
> >  Args.MakeArgString(getToolChain().GetFilePath("values-Xa.o")));
> >  CmdArgs.push_back(
> >  Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
> > -
> > -if (getToolChain().getDriver().CCCIsCXX())
> > -  CmdArgs.push_back(
> > -
> Args.MakeArgString(getToolChain().GetFilePath("cxa_finalize.o")));
> >}
> >
> >const ToolChain::path_list &Paths = getToolChain().getFilePaths();
> > --
> > 2.4.3
> >
>
> > ___
> > 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
>



-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Add -lc also when linking shared libraries

2015-09-05 Thread Saleem Abdulrasool via cfe-commits
On Fri, Sep 4, 2015 at 1:12 AM, Xan López via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> On Fri, Aug 28, 2015 at 07:53:40PM +0200, Xan López via cfe-commits wrote:
> > This is actually needed, otherwise libc won't be added at all. For
> > instance when building libclang.so all the libc symbols won't be
> > found, with ld warning about libc being an "implicit dependency".
> >
> > ((This patch sits on top of a couple of unreviewed patches that make
> clang actually work on Solaris, see:
> >
> >
> http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/292800.html
> >
> http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150817/293971.html
> >
> > It should be trivial to rebase against master if it is reviewed first
> though)
> >
> > Xan
>
> Ping?
>

Testcase?  Looks fine otherwise.


> > From 8e81d6b095542c0ff1e28cf1f09d675f8afe1a25 Mon Sep 17 00:00:00 2001
> > From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
> > Date: Mon, 17 Aug 2015 16:04:26 +0200
> > Subject: [PATCH 4/4] [Solaris] Add -lc also when linking shared libraries
> >
> > This is actually needed, otherwise libc won't be added at all. For
> > instance when building libclang.so all the libc symbols won't be
> > found, with ld warning about libc being an "implicit dependency".
> > ---
> >  lib/Driver/Tools.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
> > index cf01d7b..2034c0f 100644
> > --- a/lib/Driver/Tools.cpp
> > +++ b/lib/Driver/Tools.cpp
> > @@ -6899,9 +6899,9 @@ void solaris::Linker::ConstructJob(Compilation &C,
> const JobAction &JA,
> >  if (getToolChain().getDriver().CCCIsCXX())
> >getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
> >  CmdArgs.push_back("-lgcc_s");
> > +CmdArgs.push_back("-lc");
> >  if (!Args.hasArg(options::OPT_shared)) {
> >CmdArgs.push_back("-lgcc");
> > -  CmdArgs.push_back("-lc");
> >CmdArgs.push_back("-lm");
> >  }
> >}
> > --
> > 2.4.3
> >
>
> > ___
> > 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
>



-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604

2015-09-05 Thread Dan Albert via cfe-commits
danalbert added a comment.

Android has posix_memalign too.


http://reviews.llvm.org/D12512



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


Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604

2015-09-05 Thread Dan Albert via cfe-commits
Android has posix_memalign too.
On Sep 5, 2015 12:00, "Joerg Sonnenberger"  wrote:

> On Fri, Sep 04, 2015 at 09:28:39PM +, Eric Fiselier via cfe-commits
> wrote:
> > EricWF added a comment.
> >
> > In http://reviews.llvm.org/D12512#237175, @joerg wrote:
> >
> > > Please don't commit this as is. Many platforms have posix_memalign or
> equivalent, which makes this both simpler and potentially without wasting
> memory. Compare e.g. http://reviews.llvm.org/D12001.
> >
> >
> > Will do. Any advice on detecting posix_memalign? I don't see anything in
> the patch you pointed me to.
>
> Provide a feature variable for it and set it by default. For Unix-like
> systems, I think only Android wants to disable it by default. Not sure
> about Windows and OSX.
>
> Joerg
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604

2015-09-05 Thread Joerg Sonnenberger via cfe-commits
On Sat, Sep 05, 2015 at 07:29:43PM +, Dan Albert via cfe-commits wrote:
> danalbert added a comment.
> 
> Android has posix_memalign too.

Yes, but people seem to be reluctant to use it. See the linked review.

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


Re: [PATCH] D12462: [PATCH] [clang-tidy] Add inconsistent declaration parameter name check

2015-09-05 Thread Piotr Dziwinski via cfe-commits
piotrdz added a comment.

Now that I fixed all review issues, I think this version would be acceptable 
for commit. @alexfh: do you agree?
There are of course two outstanding issues marked with TODO and FIXME comments, 
but these are areas of improvement. I would like to first discuss the best 
solution to them, before attempting to fix them in code.


http://reviews.llvm.org/D12462



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


Re: [PATCH] D12462: [PATCH] [clang-tidy] Add inconsistent declaration parameter name check

2015-09-05 Thread Piotr Dziwinski via cfe-commits
piotrdz updated this revision to Diff 34113.
piotrdz marked 6 inline comments as done.
piotrdz added a comment.

I addressed all latest review issues.


http://reviews.llvm.org/D12462

Files:
  clang-tidy/readability/CMakeLists.txt
  clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp
  clang-tidy/readability/InconsistentDeclarationParameterNameCheck.h
  clang-tidy/readability/ReadabilityTidyModule.cpp
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/readability-inconsistent-declaration-parameter-name.rst
  test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp

Index: test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp
===
--- test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp
+++ test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp
@@ -0,0 +1,149 @@
+// RUN: %python %S/check_clang_tidy.py %s readability-inconsistent-declaration-parameter-name %t
+
+void consistentFunction(int a, int b, int c);
+void consistentFunction(int a, int b, int c);
+void consistentFunction(int a, int b, int /*c*/);
+void consistentFunction(int /*c*/, int /*c*/, int /*c*/);
+
+//
+
+// CHECK-MESSAGES: :[[@LINE+1]]:6: warning: function 'inconsistentFunction' has 2 other declarations with differently named parameters [readability-inconsistent-declaration-parameter-name]
+void inconsistentFunction(int a, int b, int c);
+// CHECK-MESSAGES: :[[@LINE+2]]:6: note: 1st inconsistent declaration seen here
+// CHECK-MESSAGES: :[[@LINE+1]]:6: note: differing parameters are named here: ('d', 'e', 'f'), while in compared declaration: ('a', 'b', 'c')
+void inconsistentFunction(int d, int e, int f);
+// CHECK-MESSAGES: :[[@LINE+2]]:6: note: 2nd inconsistent declaration seen here
+// CHECK-MESSAGES: :[[@LINE+1]]:6: note: differing parameters are named here: ('x', 'y', 'z'), while in compared declaration: ('a', 'b', 'c')
+void inconsistentFunction(int x, int y, int z);
+
+//
+
+// CHECK-MESSAGES: :[[@LINE+5]]:6: warning: function 'inconsistentFunctionWithVisibleDefinition' has 1 other declaration with differently named parameters [readability-inconsistent-declaration-parameter-name]
+// CHECK-MESSAGES: :[[@LINE+3]]:6: note: 1st inconsistent declaration seen here
+// CHECK-MESSAGES: :[[@LINE+2]]:6: note: differing parameters are named here: ('a'), while in compared declaration: ('b')
+// CHECK-FIXES: void inconsistentFunctionWithVisibleDefinition(int b);
+void inconsistentFunctionWithVisibleDefinition(int a);
+void inconsistentFunctionWithVisibleDefinition(int b) {}
+
+//
+
+struct Struct {
+// CHECK-MESSAGES: :[[@LINE+7]]:14: warning:  function 'Struct::inconsistentFunction' has 1 other declaration with differently named parameters [readability-inconsistent-declaration-parameter-name]
+// CHECK-MESSAGES: :[[@LINE+3]]:8: note: 1st inconsistent declaration seen here
+// CHECK-MESSAGES: :[[@LINE+2]]:8: note: differing parameters are named here: ('a'), while in compared declaration: ('b')
+// CHECK-FIXES: void inconsistentFunction(int b);
+  void inconsistentFunction(int a);
+};
+
+void Struct::inconsistentFunction(int b) {}
+
+//
+
+struct SpecialFunctions {
+// CHECK-MESSAGES: :[[@LINE+13]]:19: warning:  function 'SpecialFunctions::SpecialFunctions' has 1 other declaration with differently named parameters [readability-inconsistent-declaration-parameter-name]
+// CHECK-MESSAGES: :[[@LINE+3]]:3: note: 1st inconsistent declaration seen here
+// CHECK-MESSAGES: :[[@LINE+2]]:3: note: differing parameters are named here: ('a'), while in compared declaration: ('b')
+// CHECK-FIXES: SpecialFunctions(int b);
+  SpecialFunctions(int a);
+
+// CHECK-MESSAGES: :[[@LINE+9]]:37: warning:  function 'SpecialFunctions::operator=' has 1 other declaration with differently named parameters [readability-inconsistent-declaration-parameter-name]
+// CHECK-MESSAGES: :[[@LINE+3]]:21: note: 1st inconsistent declaration seen here
+// CHECK-MESSAGES: :[[@LINE+2]]:21: note: differing parameters are named here: ('a'), while in compared declaration: ('b')
+// CHECK-FIXES: SpecialFunctions& operator=(const SpecialFunctions& b);
+  SpecialFunctions& operator=(const SpecialFunctions& a);
+};
+
+SpecialFunctions::SpecialFunctions(int b) {}
+
+SpecialFunctions& SpecialFunctions::operator=(const SpecialFunctions& b) { return *this; }
+
+//
+
+// CHECK-MESSAGES: :[[@LINE+8]]:6: warning:  function 'templateFunctionWithSeparateDeclarationAndDefinition' has 1 other declaration with differently named parameters [readability-inconsistent-declaration-parameter-name]
+// CHECK-MESSAGES: :[[@LINE+4]]:6: note: 1st inconsistent declaration seen here
+// CHECK-MESSAGES: :[[@LIN

Re: [PATCH] D12664: Fixed comparison.

2015-09-05 Thread James Touton via cfe-commits
jtouton added a comment.

Added cfe-commits.


http://reviews.llvm.org/D12664



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