[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-11 Thread Louis Dionne via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rCXX336866: [libc++] Take 2: Replace uses of 
_LIBCPP_ALWAYS_INLINE by… (authored by ldionne, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D48892?vs=154415=155082#toc

Repository:
  rCXX libc++

https://reviews.llvm.org/D48892

Files:
  docs/DesignDocs/VisibilityMacros.rst
  include/__bsd_locale_fallbacks.h
  include/__config
  include/__locale
  include/__nullptr
  include/any
  include/cmath
  include/codecvt
  include/exception
  include/experimental/dynarray
  include/experimental/filesystem
  include/functional
  include/future
  include/initializer_list
  include/ios
  include/locale
  include/math.h
  include/memory
  include/new
  include/ostream
  include/regex
  include/stdexcept
  include/streambuf
  include/support/android/locale_bionic.h
  include/support/xlocale/__posix_l_fallback.h
  include/support/xlocale/__strtonum_fallback.h
  include/system_error
  include/typeinfo
  include/vector
  src/support/win32/thread_win32.cpp

Index: docs/DesignDocs/VisibilityMacros.rst
===
--- docs/DesignDocs/VisibilityMacros.rst
+++ docs/DesignDocs/VisibilityMacros.rst
@@ -41,10 +41,10 @@
   library and has an empty definition otherwise.
 
 **_LIBCPP_INLINE_VISIBILITY**
-  Mark a function as hidden and force inlining whenever possible.
-
-**_LIBCPP_ALWAYS_INLINE**
-  A synonym for `_LIBCPP_INLINE_VISIBILITY`
+  Mark a function as not being part of the ABI of any final linked image that
+  uses it, and also as being internal to each TU that uses that function. In
+  other words, the address of a function marked with this attribute is not
+  guaranteed to be the same across translation units.
 
 **_LIBCPP_TYPE_VIS**
   Mark a type's typeinfo, vtable and members as having default visibility.
Index: src/support/win32/thread_win32.cpp
===
--- src/support/win32/thread_win32.cpp
+++ src/support/win32/thread_win32.cpp
@@ -138,7 +138,7 @@
 }
 
 // Execute Once
-static inline _LIBCPP_ALWAYS_INLINE BOOL CALLBACK
+static inline _LIBCPP_INLINE_VISIBILITY BOOL CALLBACK
 __libcpp_init_once_execute_once_thunk(PINIT_ONCE __init_once, PVOID __parameter,
   PVOID *__context)
 {
@@ -178,7 +178,7 @@
   void *__arg;
 };
 
-static inline _LIBCPP_ALWAYS_INLINE unsigned WINAPI
+static inline _LIBCPP_INLINE_VISIBILITY unsigned WINAPI
 __libcpp_beginthreadex_thunk(void *__raw_data)
 {
   auto *__data =
Index: include/ostream
===
--- include/ostream
+++ include/ostream
@@ -232,7 +232,7 @@
 basic_ostream& seekp(off_type __off, ios_base::seekdir __dir);
 
 protected:
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
 basic_ostream() {}  // extension, intentially does not initialize
 };
 
@@ -249,7 +249,7 @@
 explicit sentry(basic_ostream<_CharT, _Traits>& __os);
 ~sentry();
 
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
 _LIBCPP_EXPLICIT
 operator bool() const {return __ok_;}
 };
Index: include/__config
===
--- include/__config
+++ include/__config
@@ -672,11 +672,9 @@
 
 #if defined(_LIBCPP_COMPILER_MSVC)
 #  define _LIBCPP_INLINE_VISIBILITY __forceinline
-#  define _LIBCPP_ALWAYS_INLINE __forceinline
 #  define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline
 #else
 #  define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
-#  define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
 #  define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__ ((__always_inline__))
 #endif
 
@@ -771,14 +769,6 @@
 #  endif
 #endif
 
-#ifndef _LIBCPP_ALWAYS_INLINE
-#  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-#define _LIBCPP_ALWAYS_INLINE  __attribute__ ((__visibility__("hidden"), __always_inline__))
-#  else
-#define _LIBCPP_ALWAYS_INLINE  __attribute__ ((__always_inline__))
-#  endif
-#endif
-
 #ifndef _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
 #define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__visibility__("default"), __always_inline__))
@@ -889,9 +879,9 @@
 #  define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
 #  define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
  __lx __v_; \
- _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
- _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
- _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
+ _LIBCPP_INLINE_VISIBILITY x(__lx __v) : __v_(__v) {} \
+ _LIBCPP_INLINE_VISIBILITY explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
+ 

[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-11 Thread Louis Dionne via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL336866: [libc++] Take 2: Replace uses of 
_LIBCPP_ALWAYS_INLINE by… (authored by ldionne, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D48892?vs=154415=155081#toc

Repository:
  rCXX libc++

https://reviews.llvm.org/D48892

Files:
  libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
  libcxx/trunk/include/__bsd_locale_fallbacks.h
  libcxx/trunk/include/__config
  libcxx/trunk/include/__locale
  libcxx/trunk/include/__nullptr
  libcxx/trunk/include/any
  libcxx/trunk/include/cmath
  libcxx/trunk/include/codecvt
  libcxx/trunk/include/exception
  libcxx/trunk/include/experimental/dynarray
  libcxx/trunk/include/experimental/filesystem
  libcxx/trunk/include/functional
  libcxx/trunk/include/future
  libcxx/trunk/include/initializer_list
  libcxx/trunk/include/ios
  libcxx/trunk/include/locale
  libcxx/trunk/include/math.h
  libcxx/trunk/include/memory
  libcxx/trunk/include/new
  libcxx/trunk/include/ostream
  libcxx/trunk/include/regex
  libcxx/trunk/include/stdexcept
  libcxx/trunk/include/streambuf
  libcxx/trunk/include/support/android/locale_bionic.h
  libcxx/trunk/include/support/xlocale/__posix_l_fallback.h
  libcxx/trunk/include/support/xlocale/__strtonum_fallback.h
  libcxx/trunk/include/system_error
  libcxx/trunk/include/typeinfo
  libcxx/trunk/include/vector
  libcxx/trunk/src/support/win32/thread_win32.cpp

Index: libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
===
--- libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
+++ libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
@@ -41,10 +41,10 @@
   library and has an empty definition otherwise.
 
 **_LIBCPP_INLINE_VISIBILITY**
-  Mark a function as hidden and force inlining whenever possible.
-
-**_LIBCPP_ALWAYS_INLINE**
-  A synonym for `_LIBCPP_INLINE_VISIBILITY`
+  Mark a function as not being part of the ABI of any final linked image that
+  uses it, and also as being internal to each TU that uses that function. In
+  other words, the address of a function marked with this attribute is not
+  guaranteed to be the same across translation units.
 
 **_LIBCPP_TYPE_VIS**
   Mark a type's typeinfo, vtable and members as having default visibility.
Index: libcxx/trunk/src/support/win32/thread_win32.cpp
===
--- libcxx/trunk/src/support/win32/thread_win32.cpp
+++ libcxx/trunk/src/support/win32/thread_win32.cpp
@@ -138,7 +138,7 @@
 }
 
 // Execute Once
-static inline _LIBCPP_ALWAYS_INLINE BOOL CALLBACK
+static inline _LIBCPP_INLINE_VISIBILITY BOOL CALLBACK
 __libcpp_init_once_execute_once_thunk(PINIT_ONCE __init_once, PVOID __parameter,
   PVOID *__context)
 {
@@ -178,7 +178,7 @@
   void *__arg;
 };
 
-static inline _LIBCPP_ALWAYS_INLINE unsigned WINAPI
+static inline _LIBCPP_INLINE_VISIBILITY unsigned WINAPI
 __libcpp_beginthreadex_thunk(void *__raw_data)
 {
   auto *__data =
Index: libcxx/trunk/include/__config
===
--- libcxx/trunk/include/__config
+++ libcxx/trunk/include/__config
@@ -672,11 +672,9 @@
 
 #if defined(_LIBCPP_COMPILER_MSVC)
 #  define _LIBCPP_INLINE_VISIBILITY __forceinline
-#  define _LIBCPP_ALWAYS_INLINE __forceinline
 #  define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline
 #else
 #  define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
-#  define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
 #  define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__ ((__always_inline__))
 #endif
 
@@ -771,14 +769,6 @@
 #  endif
 #endif
 
-#ifndef _LIBCPP_ALWAYS_INLINE
-#  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-#define _LIBCPP_ALWAYS_INLINE  __attribute__ ((__visibility__("hidden"), __always_inline__))
-#  else
-#define _LIBCPP_ALWAYS_INLINE  __attribute__ ((__always_inline__))
-#  endif
-#endif
-
 #ifndef _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
 #define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__visibility__("default"), __always_inline__))
@@ -889,9 +879,9 @@
 #  define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
 #  define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
  __lx __v_; \
- _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
- _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
- _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
+ _LIBCPP_INLINE_VISIBILITY x(__lx __v) : __v_(__v) {} \
+ _LIBCPP_INLINE_VISIBILITY explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
+ _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;} \
  };
 #else  // _LIBCPP_HAS_NO_STRONG_ENUMS
 #  

[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-11 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added a comment.

Pushing since I got an offline O.K. from Eric.


Repository:
  rL LLVM

https://reviews.llvm.org/D48892



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


[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-09 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added a comment.

I've now managed to run the `check-cxx-abilist` test on my machine and it 
passes. I'd like to commit this again, @EricWF am I good to go?


Repository:
  rL LLVM

https://reviews.llvm.org/D48892



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


[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-06 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added inline comments.



Comment at: libcxx/include/streambuf:261
 
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
 void __pbump(streamsize __n) { __nout_ += __n; }

This one was marked as `_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY` instead of 
`_LIBCPP_INLINE_VISIBILITY` in the previous revision. This is what caused the 
`check-cxx-abilist` test to fail.


Repository:
  rL LLVM

https://reviews.llvm.org/D48892



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


[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-06 Thread Louis Dionne via Phabricator via cfe-commits
ldionne updated this revision to Diff 154415.
ldionne added a comment.

This revision to the patch fixes a problem where __pbump had been applied
_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY instead of _LIBCPP_INLINE_VISIBILITY,
which caused the symbols exported in the ABI to change and broke the CI.

Independently, LLDB tests that were failing because they relied on
_LIBCPP_INLINE_VISIBILITY were fixed so that this change should not
break them again.

I still haven't been able to run the ABI tests locally (they fail on my
machine), and I'd like to do that before I submit this patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D48892

Files:
  libcxx/docs/DesignDocs/VisibilityMacros.rst
  libcxx/include/__bsd_locale_fallbacks.h
  libcxx/include/__config
  libcxx/include/__locale
  libcxx/include/__nullptr
  libcxx/include/any
  libcxx/include/cmath
  libcxx/include/codecvt
  libcxx/include/exception
  libcxx/include/experimental/dynarray
  libcxx/include/experimental/filesystem
  libcxx/include/functional
  libcxx/include/future
  libcxx/include/initializer_list
  libcxx/include/ios
  libcxx/include/locale
  libcxx/include/math.h
  libcxx/include/memory
  libcxx/include/new
  libcxx/include/ostream
  libcxx/include/regex
  libcxx/include/stdexcept
  libcxx/include/streambuf
  libcxx/include/support/android/locale_bionic.h
  libcxx/include/support/xlocale/__posix_l_fallback.h
  libcxx/include/support/xlocale/__strtonum_fallback.h
  libcxx/include/system_error
  libcxx/include/typeinfo
  libcxx/include/vector
  libcxx/src/support/win32/thread_win32.cpp

Index: libcxx/src/support/win32/thread_win32.cpp
===
--- libcxx/src/support/win32/thread_win32.cpp
+++ libcxx/src/support/win32/thread_win32.cpp
@@ -138,7 +138,7 @@
 }
 
 // Execute Once
-static inline _LIBCPP_ALWAYS_INLINE BOOL CALLBACK
+static inline _LIBCPP_INLINE_VISIBILITY BOOL CALLBACK
 __libcpp_init_once_execute_once_thunk(PINIT_ONCE __init_once, PVOID __parameter,
   PVOID *__context)
 {
@@ -178,7 +178,7 @@
   void *__arg;
 };
 
-static inline _LIBCPP_ALWAYS_INLINE unsigned WINAPI
+static inline _LIBCPP_INLINE_VISIBILITY unsigned WINAPI
 __libcpp_beginthreadex_thunk(void *__raw_data)
 {
   auto *__data =
Index: libcxx/include/vector
===
--- libcxx/include/vector
+++ libcxx/include/vector
@@ -295,7 +295,7 @@
 class __vector_base_common
 {
 protected:
-_LIBCPP_ALWAYS_INLINE __vector_base_common() {}
+_LIBCPP_INLINE_VISIBILITY __vector_base_common() {}
 _LIBCPP_NORETURN void __throw_length_error() const;
 _LIBCPP_NORETURN void __throw_out_of_range() const;
 };
Index: libcxx/include/typeinfo
===
--- libcxx/include/typeinfo
+++ libcxx/include/typeinfo
@@ -226,7 +226,7 @@
 #endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
 
 _LIBCPP_BEGIN_NAMESPACE_STD
-_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
 void __throw_bad_cast()
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
Index: libcxx/include/system_error
===
--- libcxx/include/system_error
+++ libcxx/include/system_error
@@ -203,7 +203,7 @@
 defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
 error_category() _NOEXCEPT;
 #else
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
 _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT _LIBCPP_DEFAULT
 #endif
 private:
@@ -217,13 +217,13 @@
 virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT;
 virtual string message(int __ev) const = 0;
 
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
 bool operator==(const error_category& __rhs) const _NOEXCEPT {return this == &__rhs;}
 
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
 bool operator!=(const error_category& __rhs) const _NOEXCEPT {return !(*this == __rhs);}
 
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
 bool operator< (const error_category& __rhs) const _NOEXCEPT {return this < &__rhs;}
 
 friend class _LIBCPP_HIDDEN __do_message;
@@ -244,52 +244,52 @@
 int __val_;
 const error_category* __cat_;
 public:
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
 error_condition() _NOEXCEPT : __val_(0), __cat_(_category()) {}
 
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
 error_condition(int __val, const error_category& __cat) _NOEXCEPT
 : __val_(__val), __cat_(&__cat) {}
 
 template 
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
 error_condition(_Ep __e,
   typename enable_if::value>::type* = 0
  ) _NOEXCEPT
 {*this = make_error_condition(__e);}
 

Re: [PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-05 Thread Davide Italiano via cfe-commits
On Thu, Jul 5, 2018 at 11:49 AM Davide Italiano via llvm-commits
 wrote:
>
> On Thu, Jul 5, 2018 at 11:37 AM Duncan P. N. Exon Smith via
> Phabricator  wrote:
> >
> > dexonsmith added a comment.
> >
> > In https://reviews.llvm.org/D48892#1153473, @davide wrote:
> >
> > > The lldb bot started failing very recently and the blamelist hints at 
> > > this change.
> > >
> > > http://green.lab.llvm.org/green/job/lldb-cmake//
> > >
> > > Can you please take a look?
> > >
> > > For your convenience, this is failing building LibCxx testcases with a 
> > > linker error:
> > >
> > >   Build Command Output:
> > >   Undefined symbols for architecture x86_64:
> > > "std::__1::__vector_base_common::__vector_base_common()", 
> > > referenced from:
> > > std::__1::__vector_base 
> > > >::__vector_base() in main.o
> > > std::__1::__vector_base > > std::__1::char_traits, std::__1::allocator >, 
> > > std::__1::allocator > > std::__1::char_traits, std::__1::allocator > > 
> > > >::__vector_base() in main.o
> > >   ld: symbol(s) not found for architecture x86_64
> > >   clang-7: error: linker command failed with exit code 1 (use -v to see 
> > > invocation)
> > >   make: *** [a.out] Error 1
> > >
> >
> >
> > Interesting.  The failing jobs all have things like this:
> >
> >   #include 
> >   #ifdef _LIBCPP_INLINE_VISIBILITY
> >   #undef _LIBCPP_INLINE_VISIBILITY
> >   #endif
> >   #define _LIBCPP_INLINE_VISIBILITY
> >   #include 
> >   #include 
> >
> > We should revert to green, but... why is LLDB doing that?
>
> FWIW, I don't think there's any really good reason for this. The
> original test was committed with this `VISIBILITY` dance but the
> commit message doesn't really contain any informations.
> I guess I'm going just to spin a build locally, see whether it sticks
> and remove the offending lines instead of reverting Louis commit.
>
> I'll follow up here.
>

Actually, never mind, I realized you just reverted this.

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


Re: [PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-05 Thread Davide Italiano via cfe-commits
On Thu, Jul 5, 2018 at 11:37 AM Duncan P. N. Exon Smith via
Phabricator  wrote:
>
> dexonsmith added a comment.
>
> In https://reviews.llvm.org/D48892#1153473, @davide wrote:
>
> > The lldb bot started failing very recently and the blamelist hints at this 
> > change.
> >
> > http://green.lab.llvm.org/green/job/lldb-cmake//
> >
> > Can you please take a look?
> >
> > For your convenience, this is failing building LibCxx testcases with a 
> > linker error:
> >
> >   Build Command Output:
> >   Undefined symbols for architecture x86_64:
> > "std::__1::__vector_base_common::__vector_base_common()", 
> > referenced from:
> > std::__1::__vector_base 
> > >::__vector_base() in main.o
> > std::__1::__vector_base > std::__1::char_traits, std::__1::allocator >, 
> > std::__1::allocator > std::__1::char_traits, std::__1::allocator > > 
> > >::__vector_base() in main.o
> >   ld: symbol(s) not found for architecture x86_64
> >   clang-7: error: linker command failed with exit code 1 (use -v to see 
> > invocation)
> >   make: *** [a.out] Error 1
> >
>
>
> Interesting.  The failing jobs all have things like this:
>
>   #include 
>   #ifdef _LIBCPP_INLINE_VISIBILITY
>   #undef _LIBCPP_INLINE_VISIBILITY
>   #endif
>   #define _LIBCPP_INLINE_VISIBILITY
>   #include 
>   #include 
>
> We should revert to green, but... why is LLDB doing that?

FWIW, I don't think there's any really good reason for this. The
original test was committed with this `VISIBILITY` dance but the
commit message doesn't really contain any informations.
I guess I'm going just to spin a build locally, see whether it sticks
and remove the offending lines instead of reverting Louis commit.

I'll follow up here.

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


Re: [PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-05 Thread Davide Italiano via cfe-commits
On Thu, Jul 5, 2018 at 11:46 AM Louis Dionne via Phabricator
 wrote:
>
> ldionne added a comment.
>
> I reverted this commit. Sorry for the blunder. I'll take a look at why LLDB's 
> tests are doing this.
>

No need to revert this immediately. I can probably take a look and fix
what the lldb tests are doing (and in case I can't, we can revert).
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-05 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added a comment.

I reverted this commit. Sorry for the blunder. I'll take a look at why LLDB's 
tests are doing this.


Repository:
  rCXX libc++

https://reviews.llvm.org/D48892



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


[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-05 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment.

In https://reviews.llvm.org/D48892#1153473, @davide wrote:

> The lldb bot started failing very recently and the blamelist hints at this 
> change.
>
> http://green.lab.llvm.org/green/job/lldb-cmake//
>
> Can you please take a look?
>
> For your convenience, this is failing building LibCxx testcases with a linker 
> error:
>
>   Build Command Output:
>   Undefined symbols for architecture x86_64:
> "std::__1::__vector_base_common::__vector_base_common()", 
> referenced from:
> std::__1::__vector_base 
> >::__vector_base() in main.o
> std::__1::__vector_base std::__1::char_traits, std::__1::allocator >, 
> std::__1::allocator, 
> std::__1::allocator > > >::__vector_base() in main.o
>   ld: symbol(s) not found for architecture x86_64
>   clang-7: error: linker command failed with exit code 1 (use -v to see 
> invocation)
>   make: *** [a.out] Error 1
>


Interesting.  The failing jobs all have things like this:

  #include 
  #ifdef _LIBCPP_INLINE_VISIBILITY
  #undef _LIBCPP_INLINE_VISIBILITY
  #endif
  #define _LIBCPP_INLINE_VISIBILITY
  #include 
  #include 

We should revert to green, but... why is LLDB doing that?


Repository:
  rCXX libc++

https://reviews.llvm.org/D48892



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


[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-05 Thread Davide Italiano via Phabricator via cfe-commits
davide reopened this revision.
davide added a comment.
This revision is now accepted and ready to land.

The lldb bot started failing very recently and the blamelist hints at this 
change.

http://green.lab.llvm.org/green/job/lldb-cmake//

Can you please take a look?

For your convenience, this is failing building LibCxx testcases with a linker 
error:

  Build Command Output:
  Undefined symbols for architecture x86_64:
"std::__1::__vector_base_common::__vector_base_common()", referenced 
from:
std::__1::__vector_base 
>::__vector_base() in main.o
std::__1::__vector_base, std::__1::allocator >, 
std::__1::allocator, 
std::__1::allocator > > >::__vector_base() in main.o
  ld: symbol(s) not found for architecture x86_64
  clang-7: error: linker command failed with exit code 1 (use -v to see 
invocation)
  make: *** [a.out] Error 1


Repository:
  rCXX libc++

https://reviews.llvm.org/D48892



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


[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-05 Thread Louis Dionne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rCXX336369: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by 
_LIBCPP_INLINE_VISIBILITY (authored by ldionne, committed by ).
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D48892?vs=153958=154258#toc

Repository:
  rCXX libc++

https://reviews.llvm.org/D48892

Files:
  docs/DesignDocs/VisibilityMacros.rst
  include/__bsd_locale_fallbacks.h
  include/__config
  include/__locale
  include/__nullptr
  include/any
  include/cmath
  include/codecvt
  include/exception
  include/experimental/dynarray
  include/experimental/filesystem
  include/functional
  include/future
  include/initializer_list
  include/ios
  include/locale
  include/math.h
  include/memory
  include/new
  include/ostream
  include/regex
  include/stdexcept
  include/streambuf
  include/support/android/locale_bionic.h
  include/support/xlocale/__posix_l_fallback.h
  include/support/xlocale/__strtonum_fallback.h
  include/system_error
  include/typeinfo
  include/vector
  src/support/win32/thread_win32.cpp

Index: docs/DesignDocs/VisibilityMacros.rst
===
--- docs/DesignDocs/VisibilityMacros.rst
+++ docs/DesignDocs/VisibilityMacros.rst
@@ -41,10 +41,10 @@
   library and has an empty definition otherwise.
 
 **_LIBCPP_INLINE_VISIBILITY**
-  Mark a function as hidden and force inlining whenever possible.
-
-**_LIBCPP_ALWAYS_INLINE**
-  A synonym for `_LIBCPP_INLINE_VISIBILITY`
+  Mark a function as not being part of the ABI of any final linked image that
+  uses it, and also as being internal to each TU that uses that function. In
+  other words, the address of a function marked with this attribute is not
+  guaranteed to be the same across translation units.
 
 **_LIBCPP_TYPE_VIS**
   Mark a type's typeinfo, vtable and members as having default visibility.
Index: src/support/win32/thread_win32.cpp
===
--- src/support/win32/thread_win32.cpp
+++ src/support/win32/thread_win32.cpp
@@ -138,7 +138,7 @@
 }
 
 // Execute Once
-static inline _LIBCPP_ALWAYS_INLINE BOOL CALLBACK
+static inline _LIBCPP_INLINE_VISIBILITY BOOL CALLBACK
 __libcpp_init_once_execute_once_thunk(PINIT_ONCE __init_once, PVOID __parameter,
   PVOID *__context)
 {
@@ -178,7 +178,7 @@
   void *__arg;
 };
 
-static inline _LIBCPP_ALWAYS_INLINE unsigned WINAPI
+static inline _LIBCPP_INLINE_VISIBILITY unsigned WINAPI
 __libcpp_beginthreadex_thunk(void *__raw_data)
 {
   auto *__data =
Index: include/functional
===
--- include/functional
+++ include/functional
@@ -1399,7 +1399,7 @@
 #endif
 };
 
-_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
 void __throw_bad_function_call()
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
Index: include/__bsd_locale_fallbacks.h
===
--- include/__bsd_locale_fallbacks.h
+++ include/__bsd_locale_fallbacks.h
@@ -24,80 +24,80 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return MB_CUR_MAX;
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 wint_t __libcpp_btowc_l(int __c, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return btowc(__c);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 int __libcpp_wctob_l(wint_t __c, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return wctob(__c);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
  size_t __len, mbstate_t *__ps, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return wcrtomb(__s, __wc, __ps);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
   size_t __len, mbstate_t *__ps, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
mbstate_t *__ps, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return mbrtowc(__pwc, __s, __n, __ps);
 }
 
-inline _LIBCPP_ALWAYS_INLINE