Compare commits

..

4 Commits

Author SHA1 Message Date
Bryce Lelbach (wash)
1179b32b93 GCC: fix __config for always inline/variadics 2011-04-22 14:56:55 +09:00
Bryce Lelbach (wash)
1160236b87 CMake: Change check target to libcxx.check to avoid CMake target conflicts. 2011-04-22 14:56:32 +09:00
Bryce Lelbach (wash)
afb2c7d9ff CMake: Install to include/libcxx/v1 instead of lib/c++/v1, don't depend on headers. 2011-04-22 14:56:17 +09:00
Bryce Lelbach (wash)
58da822e10 CMake: fix minimum version required: 2.6.4 works. 2011-04-22 14:56:04 +09:00
12 changed files with 34 additions and 79 deletions

View File

@@ -5,10 +5,10 @@
#===============================================================================
project(libcxx CXX C)
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 2.6.4)
set(PACKAGE_NAME libcxx)
set(PACKAGE_VERSION trunk-svn)
set(PACKAGE_VERSION lll)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")

View File

@@ -1609,7 +1609,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
const_iterator __next = _STD::next(__hint);
if (__next == end() || value_comp()(__v, *__next))
{
// *__hint < __v < *_STD::next(__hint)
// *__hint < __v < *next(__hint)
if (__hint.__ptr_->__right_ == nullptr)
{
__parent = const_cast<__node_pointer&>(__hint.__ptr_);

View File

@@ -30,43 +30,25 @@ Macros:
#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
#ifdef ELAST
const int __elast1 = ELAST+1;
const int __elast2 = ELAST+2;
#else
const int __elast1 = 104;
const int __elast2 = 105;
#endif
#undef ELAST
#ifdef ENOTRECOVERABLE
#define EOWNERDEAD __elast1
#ifdef ELAST
#undef ELAST
#define ELAST EOWNERDEAD
#endif
#elif defined(EOWNERDEAD)
#define ENOTRECOVERABLE __elast1
#ifdef ELAST
#undef ELAST
#define ELAST ENOTRECOVERABLE
#endif
#else // defined(EOWNERDEAD)
#define EOWNERDEAD __elast1
#define ENOTRECOVERABLE __elast2
#ifdef ELAST
#undef ELAST
#define ELAST ENOTRECOVERABLE
#endif
#endif // defined(EOWNERDEAD)

View File

@@ -1787,7 +1787,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
--__base::__start_;
++__base::size();
if (__pos > 1)
__b = __move_and_check(_STD::next(__b), __b + __pos, __b, __vt);
__b = __move_and_check(next(__b), __b + __pos, __b, __vt);
*__b = *__vt;
}
}
@@ -1847,7 +1847,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
--__base::__start_;
++__base::size();
if (__pos > 1)
__b = _STD::move(_STD::next(__b), __b + __pos, __b);
__b = _STD::move(next(__b), __b + __pos, __b);
*__b = _STD::move(__v);
}
}
@@ -1905,7 +1905,7 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
--__base::__start_;
++__base::size();
if (__pos > 1)
__b = _STD::move(_STD::next(__b), __b + __pos, __b);
__b = _STD::move(next(__b), __b + __pos, __b);
*__b = value_type(_STD::forward<_Args>(__args)...);
}
}
@@ -2621,7 +2621,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
}
else
{ // erase from back
iterator __i = _STD::move(_STD::next(__p), __base::end(), __p);
iterator __i = _STD::move(next(__p), __base::end(), __p);
__alloc_traits::destroy(__a, _STD::addressof(*__i));
--__base::size();
if (__back_spare() >= 2 * __base::__block_size)

View File

@@ -2346,12 +2346,6 @@ time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
__b = get(__b, __e, __iob, __err, __tm, __fmt, __fmt + sizeof(__fmt)/sizeof(__fmt[0]));
}
break;
case 'F':
{
const char_type __fmt[] = {'%', 'Y', '-', '%', 'm', '-', '%', 'd'};
__b = get(__b, __e, __iob, __err, __tm, __fmt, __fmt + sizeof(__fmt)/sizeof(__fmt[0]));
}
break;
case 'H':
__get_hour(__tm->tm_hour, __b, __e, __err, __ct);
break;

View File

@@ -567,9 +567,9 @@ public:
typedef const value_type& reference;
typedef typename __pointer_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
rebind<const value_type>
rebind<value_type>
#else
rebind<const value_type>::other
rebind<value_type>::other
#endif
pointer;

View File

@@ -1650,16 +1650,6 @@ class piecewise_linear_distribution
_LIBCPP_BEGIN_NAMESPACE_STD
// __is_seed_sequence
template <class _Sseq, class _Engine>
struct __is_seed_sequence
{
static const bool value =
!is_convertible<_Sseq, typename _Engine::result_type>::value &&
!is_same<typename remove_cv<_Sseq>::type, _Engine>::value;
};
// linear_congruential_engine
template <unsigned long long __a, unsigned long long __c,
@@ -1858,7 +1848,7 @@ public:
{seed(__s);}
template<class _Sseq> explicit linear_congruential_engine(_Sseq& __q,
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_seed_sequence<_Sseq, linear_congruential_engine>::value>::type* = 0)
typename enable_if<!is_convertible<_Sseq, result_type>::value>::type* = 0)
{seed(__q);}
_LIBCPP_INLINE_VISIBILITY
void seed(result_type __s = default_seed)
@@ -1868,7 +1858,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
__is_seed_sequence<_Sseq, linear_congruential_engine>::value,
!is_convertible<_Sseq, result_type>::value,
void
>::type
seed(_Sseq& __q)
@@ -2114,14 +2104,14 @@ public:
{seed(__sd);}
template<class _Sseq> explicit mersenne_twister_engine(_Sseq& __q,
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0)
typename enable_if<!is_convertible<_Sseq, result_type>::value>::type* = 0)
{seed(__q);}
void seed(result_type __sd = default_seed);
template<class _Sseq>
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
__is_seed_sequence<_Sseq, mersenne_twister_engine>::value,
!is_convertible<_Sseq, result_type>::value,
void
>::type
seed(_Sseq& __q)
@@ -2483,7 +2473,7 @@ public:
{seed(__sd);}
template<class _Sseq> explicit subtract_with_carry_engine(_Sseq& __q,
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value>::type* = 0)
typename enable_if<!is_convertible<_Sseq, result_type>::value>::type* = 0)
{seed(__q);}
_LIBCPP_INLINE_VISIBILITY
void seed(result_type __sd = default_seed)
@@ -2492,7 +2482,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value,
!is_convertible<_Sseq, result_type>::value,
void
>::type
seed(_Sseq& __q)
@@ -2751,7 +2741,7 @@ public:
template<class _Sseq>
_LIBCPP_INLINE_VISIBILITY
explicit discard_block_engine(_Sseq& __q,
typename enable_if<__is_seed_sequence<_Sseq, discard_block_engine>::value &&
typename enable_if<!is_convertible<_Sseq, result_type>::value &&
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
: __e_(__q), __n_(0) {}
_LIBCPP_INLINE_VISIBILITY
@@ -2762,7 +2752,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
__is_seed_sequence<_Sseq, discard_block_engine>::value,
!is_convertible<_Sseq, result_type>::value,
void
>::type
seed(_Sseq& __q) {__e_.seed(__q); __n_ = 0;}
@@ -2950,7 +2940,7 @@ public:
explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
template<class _Sseq> explicit independent_bits_engine(_Sseq& __q,
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_seed_sequence<_Sseq, independent_bits_engine>::value &&
typename enable_if<!is_convertible<_Sseq, result_type>::value &&
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
: __e_(__q) {}
_LIBCPP_INLINE_VISIBILITY
@@ -2961,7 +2951,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
__is_seed_sequence<_Sseq, independent_bits_engine>::value,
!is_convertible<_Sseq, result_type>::value,
void
>::type
seed(_Sseq& __q) {__e_.seed(__q);}
@@ -3173,7 +3163,7 @@ public:
explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();}
template<class _Sseq> explicit shuffle_order_engine(_Sseq& __q,
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_seed_sequence<_Sseq, shuffle_order_engine>::value &&
typename enable_if<!is_convertible<_Sseq, result_type>::value &&
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
: __e_(__q) {__init();}
_LIBCPP_INLINE_VISIBILITY
@@ -3184,7 +3174,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
__is_seed_sequence<_Sseq, shuffle_order_engine>::value,
!is_convertible<_Sseq, result_type>::value,
void
>::type
seed(_Sseq& __q) {__e_.seed(__q); __init();}
@@ -4477,7 +4467,7 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
{
result_type __x;
uniform_real_distribution<double> __urd;
if (__pr.__mean_ < 10)
if (__pr.__mean_ <= 10)
{
__x = 0;
for (double __p = __urd(__urng); __p > __pr.__l_; ++__x)

View File

@@ -211,13 +211,6 @@ struct _LIBCPP_VISIBLE pair
_LIBCPP_INLINE_VISIBILITY pair(const _T1& __x, const _T2& __y)
: first(__x), second(__y) {}
template<class _U1, class _U2>
_LIBCPP_INLINE_VISIBILITY
pair(const pair<_U1, _U2>& __p,
typename enable_if<is_convertible<_U1, _T1>::value &&
is_convertible<_U2, _T2>::value>::type* = 0)
: first(__p.first), second(__p.second) {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _U1, class _U2,
@@ -229,14 +222,6 @@ struct _LIBCPP_VISIBLE pair
second(_STD::forward<_U2>(__u2))
{}
template<class _U1, class _U2>
_LIBCPP_INLINE_VISIBILITY
pair(pair<_U1, _U2>&& __p,
typename enable_if<is_convertible<_U1, _T1>::value &&
is_convertible<_U2, _T2>::value>::type* = 0)
: first(_STD::forward<_U1>(__p.first)),
second(_STD::forward<_U2>(__p.second)) {}
#ifndef _LIBCPP_HAS_NO_VARIADICS
template<class _Tuple,
@@ -276,6 +261,10 @@ struct _LIBCPP_VISIBLE pair
#endif // _LIBCPP_HAS_NO_VARIADICS
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _U1, class _U2>
_LIBCPP_INLINE_VISIBILITY pair(const pair<_U1, _U2>& __p)
: first(__p.first), second(__p.second) {}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void _LIBCPP_INLINE_VISIBILITY swap(pair& __p) {_STD::swap(*this, __p);}
private:

View File

@@ -14,12 +14,10 @@ endif()
if (LIBCXX_ENABLE_SHARED)
add_library(cxx SHARED
${sources}
${headers}
)
else()
add_library(cxx STATIC
${sources}
${headers}
)
endif()
@@ -50,8 +48,10 @@ install(TARGETS cxx
)
install(DIRECTORY ../include/
DESTINATION include/c++/v1
DESTINATION include/libcxx/v1
FILES_MATCHING
PATTERN "*"
PATTERN ".svn" EXCLUDE
PATTERN ".git" EXCLUDE
)

View File

@@ -32,7 +32,7 @@ if(PYTHONINTERP_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
@ONLY)
add_custom_target(check
add_custom_target(libcxx.check
COMMAND ${PYTHON_EXECUTABLE}
${LIT_EXECUTABLE}
${LIT_ARGS}
@@ -40,5 +40,5 @@ if(PYTHONINTERP_FOUND)
DEPENDS
COMMENT "Running libcxx tests")
else()
message(WARNING "Could not find Python, no check target will be available!")
message(WARNING "Could not find Python, no libcxx.check target will be available!")
endif()

View File

@@ -40,7 +40,7 @@ test2()
typedef std::mt19937_64 E;
E e1;
e1();
E e2(e1);
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
E::result_type k = e1();

View File

@@ -38,7 +38,7 @@ test2()
typedef std::ranlux48_base E;
E e1;
e1();
E e2(e1);
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
E::result_type k = e1();