[cfe-commits] [libcxx] r122057 - in /libcxx/trunk: include/__config include/__locale include/ios include/locale include/string include/thread include/vector lib/buildit lib/libc++unexp.exp src/thread.cpp

Howard Hinnant hhinnant at apple.com
Fri Dec 17 06:46:43 PST 2010


Author: hhinnant
Date: Fri Dec 17 08:46:43 2010
New Revision: 122057

URL: http://llvm.org/viewvc/llvm-project?rev=122057&view=rev
Log:
Effort to reduce the number of exported symbols

Added:
    libcxx/trunk/lib/libc++unexp.exp
Modified:
    libcxx/trunk/include/__config
    libcxx/trunk/include/__locale
    libcxx/trunk/include/ios
    libcxx/trunk/include/locale
    libcxx/trunk/include/string
    libcxx/trunk/include/thread
    libcxx/trunk/include/vector
    libcxx/trunk/lib/buildit
    libcxx/trunk/src/thread.cpp

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=122057&r1=122056&r2=122057&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Fri Dec 17 08:46:43 2010
@@ -82,7 +82,7 @@
 
 #define _LIBCPP_CANTTHROW __attribute__ ((__nothrow__))
 
-#define _LIBCPP_ALWAYS_INLINE  __attribute__((__always_inline__))
+#define _LIBCPP_ALWAYS_INLINE  __attribute__ ((__visibility__("hidden"), __always_inline__))
 
 #if defined(__clang__)
 

Modified: libcxx/trunk/include/__locale
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__locale?rev=122057&r1=122056&r2=122057&view=diff
==============================================================================
--- libcxx/trunk/include/__locale (original)
+++ libcxx/trunk/include/__locale Fri Dec 17 08:46:43 2010
@@ -55,7 +55,8 @@
     explicit locale(const string&);
     locale(const locale&, const char*, category);
     locale(const locale&, const string&, category);
-    template <class _Facet> locale(const locale&, _Facet*);
+    template <class _Facet>
+        _LIBCPP_INLINE_VISIBILITY locale(const locale&, _Facet*);
     locale(const locale&, const locale&, category);
 
     ~locale() throw();

Modified: libcxx/trunk/include/ios
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ios?rev=122057&r1=122056&r2=122057&view=diff
==============================================================================
--- libcxx/trunk/include/ios (original)
+++ libcxx/trunk/include/ios Fri Dec 17 08:46:43 2010
@@ -272,16 +272,16 @@
     class Init;
 
     // 27.5.2.2 fmtflags state:
-    fmtflags flags() const;
-    fmtflags flags(fmtflags __fmtfl);
-    fmtflags setf(fmtflags __fmtfl);
-    fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
-    void unsetf(fmtflags __mask);
-
-    streamsize precision() const;
-    streamsize precision(streamsize __prec);
-    streamsize width() const;
-    streamsize width(streamsize __wide);
+    _LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
+    _LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
+    _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
+    _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
+    _LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);
+
+    _LIBCPP_INLINE_VISIBILITY streamsize precision() const;
+    _LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);
+    _LIBCPP_INLINE_VISIBILITY streamsize width() const;
+    _LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);
 
     // 27.5.2.3 locales:
     locale imbue(const locale& __loc);
@@ -307,17 +307,17 @@
 public:
     static bool sync_with_stdio(bool __sync = true);
 
-    iostate rdstate() const;
+    _LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
     void clear(iostate __state = goodbit);
-    void setstate(iostate __state);
+    _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);
 
-    bool good() const;
-    bool eof() const;
-    bool fail() const;
-    bool bad() const;
+    _LIBCPP_INLINE_VISIBILITY bool good() const;
+    _LIBCPP_INLINE_VISIBILITY bool eof() const;
+    _LIBCPP_INLINE_VISIBILITY bool fail() const;
+    _LIBCPP_INLINE_VISIBILITY bool bad() const;
 
-    iostate exceptions() const;
-    void exceptions(iostate __except);
+    _LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
+    _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __except);
 
     void __set_badbit_and_consider_rethrow();
     void __set_failbit_and_consider_rethrow();
@@ -587,38 +587,52 @@
     _LIBCPP_ALWAYS_INLINE void exceptions(iostate __except) {ios_base::exceptions(__except);}
 
     // 27.5.4.1 Constructor/destructor:
+    _LIBCPP_INLINE_VISIBILITY
     explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
     virtual ~basic_ios();
 
     // 27.5.4.2 Members:
+    _LIBCPP_INLINE_VISIBILITY 
     basic_ostream<char_type, traits_type>* tie() const;
+    _LIBCPP_INLINE_VISIBILITY 
     basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
 
+    _LIBCPP_INLINE_VISIBILITY 
     basic_streambuf<char_type, traits_type>* rdbuf() const;
+    _LIBCPP_INLINE_VISIBILITY 
     basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
 
     basic_ios& copyfmt(const basic_ios& __rhs);
 
+    _LIBCPP_INLINE_VISIBILITY 
     char_type fill() const;
+    _LIBCPP_INLINE_VISIBILITY 
     char_type fill(char_type __ch);
 
+    _LIBCPP_INLINE_VISIBILITY 
     locale imbue(const locale& __loc);
 
+    _LIBCPP_INLINE_VISIBILITY 
     char narrow(char_type __c, char __dfault) const;
+    _LIBCPP_INLINE_VISIBILITY 
     char_type widen(char __c) const;
 
 protected:
     _LIBCPP_ALWAYS_INLINE
     basic_ios() {// purposefully does no initialization
                 }
+    _LIBCPP_INLINE_VISIBILITY 
     void init(basic_streambuf<char_type, traits_type>* __sb);
 
+    _LIBCPP_INLINE_VISIBILITY 
     void move(basic_ios& __rhs);
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_ALWAYS_INLINE
     void move(basic_ios&& __rhs) {move(__rhs);}
 #endif
+    _LIBCPP_INLINE_VISIBILITY 
     void swap(basic_ios& __rhs);
+    _LIBCPP_INLINE_VISIBILITY 
     void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
 private:
     basic_ostream<char_type, traits_type>* __tie_;

Modified: libcxx/trunk/include/locale
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/locale?rev=122057&r1=122056&r2=122057&view=diff
==============================================================================
--- libcxx/trunk/include/locale (original)
+++ libcxx/trunk/include/locale Fri Dec 17 08:46:43 2010
@@ -1768,7 +1768,7 @@
 };
 
 template <class _CharT>
-class __time_get_c_storage
+class __time_get_c_storage  // purposefully not decorated
 {
 protected:
     typedef basic_string<_CharT> string_type;
@@ -2650,24 +2650,15 @@
     _LIBCPP_ALWAYS_INLINE
     ~moneypunct() {}
 
-    _LIBCPP_ALWAYS_INLINE
     virtual char_type   do_decimal_point() const {return numeric_limits<char_type>::max();}
-    _LIBCPP_ALWAYS_INLINE
     virtual char_type   do_thousands_sep() const {return numeric_limits<char_type>::max();}
-    _LIBCPP_ALWAYS_INLINE
     virtual string      do_grouping()      const {return string();}
-    _LIBCPP_ALWAYS_INLINE
     virtual string_type do_curr_symbol()   const {return string_type();}
-    _LIBCPP_ALWAYS_INLINE
     virtual string_type do_positive_sign() const {return string_type();}
-    _LIBCPP_ALWAYS_INLINE
     virtual string_type do_negative_sign() const {return string_type(1, '-');}
-    _LIBCPP_ALWAYS_INLINE
     virtual int         do_frac_digits()   const {return 0;}
-    _LIBCPP_ALWAYS_INLINE
     virtual pattern     do_pos_format()    const
         {pattern __p = {symbol, sign, none, value}; return __p;}
-    _LIBCPP_ALWAYS_INLINE
     virtual pattern     do_neg_format()    const
         {pattern __p = {symbol, sign, none, value}; return __p;}
 };
@@ -2704,23 +2695,14 @@
     _LIBCPP_ALWAYS_INLINE
     ~moneypunct_byname() {}
 
-    _LIBCPP_ALWAYS_INLINE
     virtual char_type   do_decimal_point() const {return __decimal_point_;}
-    _LIBCPP_ALWAYS_INLINE
     virtual char_type   do_thousands_sep() const {return __thousands_sep_;}
-    _LIBCPP_ALWAYS_INLINE
     virtual string      do_grouping()      const {return __grouping_;}
-    _LIBCPP_ALWAYS_INLINE
     virtual string_type do_curr_symbol()   const {return __curr_symbol_;}
-    _LIBCPP_ALWAYS_INLINE
     virtual string_type do_positive_sign() const {return __positive_sign_;}
-    _LIBCPP_ALWAYS_INLINE
     virtual string_type do_negative_sign() const {return __negative_sign_;}
-    _LIBCPP_ALWAYS_INLINE
     virtual int         do_frac_digits()   const {return __frac_digits_;}
-    _LIBCPP_ALWAYS_INLINE
     virtual pattern     do_pos_format()    const {return __pos_format_;}
-    _LIBCPP_ALWAYS_INLINE
     virtual pattern     do_neg_format()    const {return __neg_format_;}
 
 private:

Modified: libcxx/trunk/include/string
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/string?rev=122057&r1=122056&r2=122057&view=diff
==============================================================================
--- libcxx/trunk/include/string (original)
+++ libcxx/trunk/include/string Fri Dec 17 08:46:43 2010
@@ -1028,33 +1028,43 @@
 public:
     static const size_type npos = -1;
 
-    basic_string();
-    explicit basic_string(const allocator_type& __a);
+    _LIBCPP_INLINE_VISIBILITY basic_string();
+    _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a);
     basic_string(const basic_string& __str);
     basic_string(const basic_string& __str, const allocator_type& __a);
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     basic_string(basic_string&& __str);
     basic_string(basic_string&& __str, const allocator_type& __a);
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-    basic_string(const_pointer __s);
+    _LIBCPP_INLINE_VISIBILITY basic_string(const_pointer __s);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string(const_pointer __s, const allocator_type& __a);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string(const_pointer __s, size_type __n);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string(const_pointer __s, size_type __n, const allocator_type& __a);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string(size_type __n, value_type __c);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string(size_type __n, value_type __c, const allocator_type& __a);
     basic_string(const basic_string& __str, size_type __pos, size_type __n = npos,
                  const allocator_type& __a = allocator_type());
     template<class _InputIterator>
+        _LIBCPP_INLINE_VISIBILITY
         basic_string(_InputIterator __first, _InputIterator __last);
     template<class _InputIterator>
+        _LIBCPP_INLINE_VISIBILITY
         basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string(initializer_list<value_type> __il);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string(initializer_list<value_type> __il, const allocator_type& __a);
 
     ~basic_string();
 
     basic_string& operator=(const basic_string& __str);
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     basic_string& operator=(basic_string&& __str);
 #endif
     _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const_pointer __s)         {return assign(__s);}
@@ -1086,7 +1096,7 @@
     _LIBCPP_INLINE_VISIBILITY size_type size() const
         {return __is_long() ? __get_long_size() : __get_short_size();}
     _LIBCPP_INLINE_VISIBILITY size_type length() const {return size();}
-    size_type max_size() const;
+    _LIBCPP_INLINE_VISIBILITY size_type max_size() const;
     _LIBCPP_INLINE_VISIBILITY size_type capacity() const
         {return (__is_long() ? __get_long_cap() : __min_cap) - 1;}
 
@@ -1096,6 +1106,7 @@
     void reserve(size_type res_arg = 0);
     _LIBCPP_INLINE_VISIBILITY
     void shrink_to_fit() {reserve();}
+    _LIBCPP_INLINE_VISIBILITY
     void clear();
     _LIBCPP_INLINE_VISIBILITY bool empty() const {return size() == 0;}
 
@@ -1110,6 +1121,7 @@
     _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c)            {push_back(__c); return *this;}
     _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(initializer_list<value_type> __il) {return append(__il);}
 
+    _LIBCPP_INLINE_VISIBILITY
     basic_string& append(const basic_string& __str);
     basic_string& append(const basic_string& __str, size_type __pos, size_type __n);
     basic_string& append(const_pointer __s, size_type __n);
@@ -1134,12 +1146,14 @@
     basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
 
     void push_back(value_type __c);
+    _LIBCPP_INLINE_VISIBILITY
     void pop_back();
-    reference       front();
-    const_reference front() const;
-    reference       back();
-    const_reference back() const;
+    _LIBCPP_INLINE_VISIBILITY reference       front();
+    _LIBCPP_INLINE_VISIBILITY const_reference front() const;
+    _LIBCPP_INLINE_VISIBILITY reference       back();
+    _LIBCPP_INLINE_VISIBILITY const_reference back() const;
 
+    _LIBCPP_INLINE_VISIBILITY
     basic_string& assign(const basic_string& __str);
     basic_string& assign(const basic_string& __str, size_type __pos, size_type __n);
     basic_string& assign(const_pointer __s, size_type __n);
@@ -1163,12 +1177,14 @@
     _LIBCPP_INLINE_VISIBILITY
     basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
 
+    _LIBCPP_INLINE_VISIBILITY
     basic_string& insert(size_type __pos1, const basic_string& __str);
     basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n);
     basic_string& insert(size_type __pos, const_pointer __s, size_type __n);
     basic_string& insert(size_type __pos, const_pointer __s);
     basic_string& insert(size_type __pos, size_type __n, value_type __c);
     iterator      insert(const_iterator __pos, value_type __c);
+    _LIBCPP_INLINE_VISIBILITY
     iterator      insert(const_iterator __pos, size_type __n, value_type __c);
     template<class _InputIterator>
         typename enable_if
@@ -1190,17 +1206,24 @@
                     {return insert(__pos, __il.begin(), __il.end());}
 
     basic_string& erase(size_type __pos = 0, size_type __n = npos);
+    _LIBCPP_INLINE_VISIBILITY
     iterator      erase(const_iterator __pos);
+    _LIBCPP_INLINE_VISIBILITY
     iterator      erase(const_iterator __first, const_iterator __last);
 
+    _LIBCPP_INLINE_VISIBILITY
     basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str);
     basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2);
     basic_string& replace(size_type __pos, size_type __n1, const_pointer __s, size_type __n2);
     basic_string& replace(size_type __pos, size_type __n1, const_pointer __s);
     basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string& replace(const_iterator __i1, const_iterator __i2, const_pointer __s, size_type __n);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string& replace(const_iterator __i1, const_iterator __i2, const_pointer __s);
+    _LIBCPP_INLINE_VISIBILITY
     basic_string& replace(const_iterator __i1, const_iterator __i2, size_type __n, value_type __c);
     template<class _InputIterator>
         typename enable_if
@@ -1214,8 +1237,10 @@
         {return replace(__i1, __i2, __il.begin(), __il.end());}
 
     size_type copy(pointer __s, size_type __n, size_type __pos = 0) const;
+    _LIBCPP_INLINE_VISIBILITY
     basic_string substr(size_type __pos = 0, size_type __n = npos) const;
 
+    _LIBCPP_INLINE_VISIBILITY
     void swap(basic_string& __str);
 
     _LIBCPP_INLINE_VISIBILITY const_pointer c_str() const {return data();}
@@ -1223,44 +1248,62 @@
 
     _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const {return __alloc();}
 
+    _LIBCPP_INLINE_VISIBILITY
     size_type find(const basic_string& __str, size_type __pos = 0) const;
     size_type find(const_pointer __s, size_type __pos, size_type __n) const;
+    _LIBCPP_INLINE_VISIBILITY
     size_type find(const_pointer __s, size_type __pos = 0) const;
     size_type find(value_type __c, size_type __pos = 0) const;
 
+    _LIBCPP_INLINE_VISIBILITY
     size_type rfind(const basic_string& __str, size_type __pos = npos) const;
     size_type rfind(const_pointer __s, size_type __pos, size_type __n) const;
+    _LIBCPP_INLINE_VISIBILITY
     size_type rfind(const_pointer __s, size_type __pos = npos) const;
     size_type rfind(value_type __c, size_type __pos = npos) const;
 
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_first_of(const basic_string& __str, size_type __pos = 0) const;
     size_type find_first_of(const_pointer __s, size_type __pos, size_type __n) const;
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_first_of(const_pointer __s, size_type __pos = 0) const;
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_first_of(value_type __c, size_type __pos = 0) const;
 
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_last_of(const basic_string& __str, size_type __pos = npos) const;
     size_type find_last_of(const_pointer __s, size_type __pos, size_type __n) const;
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_last_of(const_pointer __s, size_type __pos = npos) const;
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_last_of(value_type __c, size_type __pos = npos) const;
 
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const;
     size_type find_first_not_of(const_pointer __s, size_type __pos, size_type __n) const;
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_first_not_of(const_pointer __s, size_type __pos = 0) const;
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_first_not_of(value_type __c, size_type __pos = 0) const;
 
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const;
     size_type find_last_not_of(const_pointer __s, size_type __pos, size_type __n) const;
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_last_not_of(const_pointer __s, size_type __pos = npos) const;
+    _LIBCPP_INLINE_VISIBILITY
     size_type find_last_not_of(value_type __c, size_type __pos = npos) const;
 
+    _LIBCPP_INLINE_VISIBILITY
     int compare(const basic_string& __str) const;
+    _LIBCPP_INLINE_VISIBILITY
     int compare(size_type __pos1, size_type __n1, const basic_string& __str) const;
     int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2) const;
     int compare(const_pointer __s) const;
     int compare(size_type __pos1, size_type __n1, const_pointer __s) const;
     int compare(size_type __pos1, size_type __n1, const_pointer __s, size_type __n2) const;
 
-    bool __invariants() const;
+    _LIBCPP_INLINE_VISIBILITY bool __invariants() const;
 private:
     _LIBCPP_INLINE_VISIBILITY allocator_type&       __alloc()       {return __r_.second();}
     _LIBCPP_INLINE_VISIBILITY const allocator_type& __alloc() const {return __r_.second();}
@@ -1338,6 +1381,7 @@
                                size_type __n_copy,  size_type __n_del,
                                size_type __n_add, const_pointer __p_new_stuff);
 
+    _LIBCPP_INLINE_VISIBILITY
     void __erase_to_end(size_type __pos);
 
     _LIBCPP_INLINE_VISIBILITY
@@ -1361,7 +1405,9 @@
         {}
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     void __move_assign(basic_string& __str, false_type);
+    _LIBCPP_INLINE_VISIBILITY
     void __move_assign(basic_string& __str, true_type);
 #endif
 
@@ -1380,8 +1426,8 @@
     static void __swap_alloc(allocator_type& __x, allocator_type& __y, false_type)
         {}
 
-    void __invalidate_all_iterators();
-    void __invalidate_iterators_past(size_type);
+    _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
+    _LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(size_type);
 
     friend basic_string operator+<>(const basic_string&, const basic_string&);
     friend basic_string operator+<>(const value_type*, const basic_string&);
@@ -1741,7 +1787,6 @@
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_INLINE_VISIBILITY inline
 basic_string<_CharT, _Traits, _Allocator>::~basic_string()
 {
     __invalidate_all_iterators();
@@ -3204,6 +3249,7 @@
 // __invariants
 
 template<class _CharT, class _Traits, class _Allocator>
+_LIBCPP_INLINE_VISIBILITY inline
 bool
 basic_string<_CharT, _Traits, _Allocator>::__invariants() const
 {

Modified: libcxx/trunk/include/thread
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/thread?rev=122057&r1=122056&r2=122057&view=diff
==============================================================================
--- libcxx/trunk/include/thread (original)
+++ libcxx/trunk/include/thread Fri Dec 17 08:46:43 2010
@@ -297,7 +297,7 @@
 
 class __assoc_sub_state;
 
-class __thread_struct_imp;
+class _LIBCPP_HIDDEN __thread_struct_imp;
 
 class __thread_struct
 {

Modified: libcxx/trunk/include/vector
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/vector?rev=122057&r1=122056&r2=122057&view=diff
==============================================================================
--- libcxx/trunk/include/vector (original)
+++ libcxx/trunk/include/vector Fri Dec 17 08:46:43 2010
@@ -318,8 +318,8 @@
     _LIBCPP_INLINE_VISIBILITY pointer&              __end_cap()       {return __end_cap_.first();}
     _LIBCPP_INLINE_VISIBILITY const pointer&        __end_cap() const {return __end_cap_.first();}
 
-    __vector_base();
-    __vector_base(const allocator_type& __a);
+    _LIBCPP_INLINE_VISIBILITY __vector_base();
+    _LIBCPP_INLINE_VISIBILITY __vector_base(const allocator_type& __a);
     ~__vector_base();
 
     _LIBCPP_INLINE_VISIBILITY void clear() {__destruct_at_end(__begin_);}
@@ -327,8 +327,8 @@
 
     _LIBCPP_INLINE_VISIBILITY void __destruct_at_end(const_pointer __new_last)
         {__destruct_at_end(__new_last, is_trivially_destructible<value_type>());}
-        void __destruct_at_end(const_pointer __new_last, false_type);
-        void __destruct_at_end(const_pointer __new_last, true_type);
+    _LIBCPP_INLINE_VISIBILITY void __destruct_at_end(const_pointer __new_last, false_type);
+    _LIBCPP_INLINE_VISIBILITY void __destruct_at_end(const_pointer __new_last, true_type);
 
     _LIBCPP_INLINE_VISIBILITY
     void __copy_assign_alloc(const __vector_base& __c)
@@ -484,7 +484,9 @@
     template <class _ForwardIterator>
         vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
                typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = 0);
+    _LIBCPP_INLINE_VISIBILITY
     vector(initializer_list<value_type> __il);
+    _LIBCPP_INLINE_VISIBILITY
     vector(initializer_list<value_type> __il, const allocator_type& __a);
 #ifdef _LIBCPP_DEBUG
     _LIBCPP_INLINE_VISIBILITY
@@ -493,10 +495,14 @@
 
     vector(const vector& __x);
     vector(const vector& __x, const allocator_type& __a);
+    _LIBCPP_INLINE_VISIBILITY
     vector& operator=(const vector& __x);
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     vector(vector&& __x);
+    _LIBCPP_INLINE_VISIBILITY
     vector(vector&& __x, const allocator_type& __a);
+    _LIBCPP_INLINE_VISIBILITY
     vector& operator=(vector&& __x);
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
@@ -526,10 +532,10 @@
 
     _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const {return this->__alloc();}
 
-    iterator               begin();
-    const_iterator         begin()   const;
-    iterator               end();
-    const_iterator         end()     const;
+    _LIBCPP_INLINE_VISIBILITY iterator               begin();
+    _LIBCPP_INLINE_VISIBILITY const_iterator         begin()   const;
+    _LIBCPP_INLINE_VISIBILITY iterator               end();
+    _LIBCPP_INLINE_VISIBILITY const_iterator         end()     const;
 
     _LIBCPP_INLINE_VISIBILITY reverse_iterator       rbegin()         {return       reverse_iterator(end());}
     _LIBCPP_INLINE_VISIBILITY const_reverse_iterator rbegin()  const  {return const_reverse_iterator(end());}
@@ -563,7 +569,7 @@
     _LIBCPP_INLINE_VISIBILITY const value_type* data() const
         {return _STD::__to_raw_pointer(this->__begin_);}
 
-    void push_back(const_reference __x);
+    _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     void push_back(value_type&& __x);
 #ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -601,7 +607,7 @@
     iterator insert(const_iterator __position, initializer_list<value_type> __il)
         {return insert(__position, __il.begin(), __il.end());}
 
-    iterator erase(const_iterator __position);
+    _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
     iterator erase(const_iterator __first, const_iterator __last);
 
     _LIBCPP_INLINE_VISIBILITY void clear() {__base::clear();}
@@ -614,15 +620,17 @@
     bool __invariants() const;
 
 private:
-    void __invalidate_all_iterators();
+    _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
     void allocate(size_type __n);
     void deallocate();
-    size_type __recommend(size_type __new_size) const;
-    void __construct_at_end(size_type __n);
+    _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
+    _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n);
         void __construct_at_end(size_type __n, false_type);
-        void __construct_at_end(size_type __n, true_type);
+    _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, true_type);
+    _LIBCPP_INLINE_VISIBILITY
     void __construct_at_end(size_type __n, const_reference __x);
-        void __construct_at_end(size_type __n, const_reference __x, false_type);
+    void __construct_at_end(size_type __n, const_reference __x, false_type);
+    _LIBCPP_INLINE_VISIBILITY
         void __construct_at_end(size_type __n, const_reference __x, true_type);
     template <class _ForwardIterator>
         typename enable_if
@@ -634,7 +642,9 @@
     void __move_construct_at_end(pointer __first, pointer __last);
     void __append(size_type __n);
     void __append(size_type __n, const_reference __x);
+    _LIBCPP_INLINE_VISIBILITY
     iterator       __make_iter(pointer __p);
+    _LIBCPP_INLINE_VISIBILITY
     const_iterator __make_iter(const_pointer __p) const;
     void __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v);
     pointer __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v, pointer __p);
@@ -1757,8 +1767,8 @@
         {return (__n - 1) / __bits_per_word + 1;}
 
 public:
-    vector();
-    explicit vector(const allocator_type& __a);
+    _LIBCPP_INLINE_VISIBILITY vector();
+    _LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a);
     ~vector();
     explicit vector(size_type __n);
     vector(size_type __n, const value_type& __v);
@@ -1785,9 +1795,9 @@
     vector(initializer_list<value_type> __il, const allocator_type& __a);
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-    vector(vector&& __v);
+    _LIBCPP_INLINE_VISIBILITY vector(vector&& __v);
     vector(vector&& __v, const allocator_type& __a);
-    vector& operator=(vector&& __v);
+    _LIBCPP_INLINE_VISIBILITY vector& operator=(vector&& __v);
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     vector& operator=(initializer_list<value_type> __il)
@@ -1874,7 +1884,7 @@
     iterator insert(const_iterator __position, initializer_list<value_type> __il)
         {return insert(__position, __il.begin(), __il.end());}
 
-    iterator erase(const_iterator __position);
+    _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
     iterator erase(const_iterator __first, const_iterator __last);
 
     _LIBCPP_INLINE_VISIBILITY void clear() {__size_ = 0;}
@@ -1887,13 +1897,13 @@
     bool __invariants() const;
 
 private:
-    void __invalidate_all_iterators();
+    _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
     void allocate(size_type __n);
     void deallocate();
     _LIBCPP_INLINE_VISIBILITY static size_type __align(size_type __new_size)
         {return __new_size + (__bits_per_word-1) & ~(__bits_per_word-1);};
-    size_type __recommend(size_type __new_size) const;
-    void __construct_at_end(size_type __n, bool __x);
+    _LIBCPP_INLINE_VISIBILITY  size_type __recommend(size_type __new_size) const;
+    _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, bool __x);
     template <class _ForwardIterator>
         typename enable_if
         <
@@ -2250,7 +2260,6 @@
 }
 
 template <class _Allocator>
-_LIBCPP_INLINE_VISIBILITY inline
 vector<bool, _Allocator>::~vector()
 {
     if (__begin_ != 0)

Modified: libcxx/trunk/lib/buildit
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/buildit?rev=122057&r1=122056&r2=122057&view=diff
==============================================================================
--- libcxx/trunk/lib/buildit (original)
+++ libcxx/trunk/lib/buildit Fri Dec 17 08:46:43 2010
@@ -41,6 +41,7 @@
 			-compatibility_version 1 \
 			-install_name /usr/lib/libc++.dylib \
 			-Wl,-reexport_library,/usr/lib/libc++abi.dylib \
+			-Wl,-unexported_symbols_list,libc++unexp.exp  \
 			/usr/lib/libSystem.B.dylib"
 	else
 		LDSHARED_FLAGS="-o libc++.1.dylib \
@@ -49,6 +50,7 @@
 			-install_name /usr/lib/libc++.dylib \
 			${SDKROOT}/usr/lib/libc++abi.dylib \
 			-lSystem  \
+			-Wl,-unexported_symbols_list,libc++unexp.exp  \
 			-Wl,-reexported_symbols_list,libc++abi.exp \
 			-Wl,-force_symbols_not_weak_list,notweak.exp"
 	fi

Added: libcxx/trunk/lib/libc++unexp.exp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/libc%2B%2Bunexp.exp?rev=122057&view=auto
==============================================================================
--- libcxx/trunk/lib/libc++unexp.exp (added)
+++ libcxx/trunk/lib/libc++unexp.exp Fri Dec 17 08:46:43 2010
@@ -0,0 +1,19 @@
+# all guard variables
+__ZGVNSt3__*
+# all vtables
+# __ZTV*
+# all VTT
+# __ZTT*
+# all non-virtual thunks
+# __ZTh*
+# all virtual thunks
+# __ZTv*
+# typeinfo for std::__1::__types
+#    There are no std::__types
+# __ZTINSt3__1[0-9][0-9]*__*
+# typeinfo name for std::__1::__types
+__ZTSNSt3__1[0-9][0-9]*__*
+# anything using __hidden_allocator
+*__hidden_allocator*
+# anything using __sso_allocator
+*__sso_allocator*

Modified: libcxx/trunk/src/thread.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/thread.cpp?rev=122057&r1=122056&r2=122057&view=diff
==============================================================================
--- libcxx/trunk/src/thread.cpp (original)
+++ libcxx/trunk/src/thread.cpp Fri Dec 17 08:46:43 2010
@@ -92,10 +92,25 @@
 
 // __thread_struct_imp
 
-class __thread_struct_imp
+template <class T>
+class _LIBCPP_HIDDEN __hidden_allocator
 {
-    typedef vector<__assoc_sub_state*> _AsyncStates;
-    typedef vector<pair<condition_variable*, mutex*> > _Notify;
+public:
+    typedef T  value_type;
+    
+    T* allocate(size_t __n)
+        {return static_cast<T*>(::operator new(__n * sizeof(T)));}
+    void deallocate(T* __p, size_t) {::operator delete((void*)__p);}
+
+    size_t max_size() const {return size_t(~0) / sizeof(T);}
+};
+
+class _LIBCPP_HIDDEN __thread_struct_imp
+{
+    typedef vector<__assoc_sub_state*,
+                          __hidden_allocator<__assoc_sub_state*> > _AsyncStates;
+    typedef vector<pair<condition_variable*, mutex*>,
+               __hidden_allocator<pair<condition_variable*, mutex*> > > _Notify;
 
     _AsyncStates async_states_;
     _Notify notify_;





More information about the cfe-commits mailing list