mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 16:56:06 +00:00
[libc++][random] Removes transitive includes.
It seems these includes are still provided by the sub headers, so it only removes the duplicates. There is no change in the list of includes, but the change affects the modular build. By not having the includes in the top-level header the module map has changed. This uncovers missing includes in the tests and missing exports in the module map. This causes the huge amount of changes in the patch. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D133252
This commit is contained in:
parent
6975ab7126
commit
24e1736d84
@ -56,11 +56,12 @@ Deprecations and Removals
|
||||
|
||||
- C++20: ``chrono``
|
||||
- C++2b: ``algorithm``, ``array``, ``atomic``, ``bit``, ``chrono``,
|
||||
``climits``, ``cmath``, ``compare``, ``concepts``, ``cstdarg``, ``cstdlib``,
|
||||
``cstring``, ``ctime``, ``exception``, ``functional``,
|
||||
``initializer_list``, ``iosfwd``, ``iterator``, ``memory``, ``new``,
|
||||
``optional``, ``ratio``, ``stdexcept``, ``tuple``, ``typeinfo``,
|
||||
``unordered_map``, ``utility``, ``variant``, ``vector``.
|
||||
``climits``, ``cmath``, ``compare``, ``concepts``, ``cstdarg`, ``cstddef``,
|
||||
``cstdint``, ``cstdlib``, ``cstring``, ``ctime``, ``exception``,
|
||||
``functional``, ``initializer_list``, ``iosfwd``, ``iterator``, ``limits``,
|
||||
``memory``, ``new``, ``numeric``, ``optional``, ``ratio``, ``stdexcept``,
|
||||
``string``, ``tuple``, ``type_traits``, ``typeinfo``, ``unordered_map``,
|
||||
``utility``, ``variant``, ``vector``.
|
||||
|
||||
Users can also remove all incidental transitive includes by defining
|
||||
``_LIBCPP_REMOVE_TRANSITIVE_INCLUDES`` regardless of the language version
|
||||
|
@ -938,7 +938,10 @@ module std [system] {
|
||||
module clamp_to_integral { private header "__random/clamp_to_integral.h" }
|
||||
module default_random_engine { private header "__random/default_random_engine.h" }
|
||||
module discard_block_engine { private header "__random/discard_block_engine.h" }
|
||||
module discrete_distribution { private header "__random/discrete_distribution.h" }
|
||||
module discrete_distribution {
|
||||
private header "__random/discrete_distribution.h"
|
||||
export vector
|
||||
}
|
||||
module exponential_distribution { private header "__random/exponential_distribution.h" }
|
||||
module extreme_value_distribution { private header "__random/extreme_value_distribution.h" }
|
||||
module fisher_f_distribution { private header "__random/fisher_f_distribution.h" }
|
||||
@ -955,8 +958,14 @@ module std [system] {
|
||||
module mersenne_twister_engine { private header "__random/mersenne_twister_engine.h" }
|
||||
module negative_binomial_distribution { private header "__random/negative_binomial_distribution.h" }
|
||||
module normal_distribution { private header "__random/normal_distribution.h" }
|
||||
module piecewise_constant_distribution { private header "__random/piecewise_constant_distribution.h" }
|
||||
module piecewise_linear_distribution { private header "__random/piecewise_linear_distribution.h" }
|
||||
module piecewise_constant_distribution {
|
||||
private header "__random/piecewise_constant_distribution.h"
|
||||
export vector
|
||||
}
|
||||
module piecewise_linear_distribution {
|
||||
private header "__random/piecewise_linear_distribution.h"
|
||||
export vector
|
||||
}
|
||||
module poisson_distribution { private header "__random/poisson_distribution.h" }
|
||||
module random_device { private header "__random/random_device.h" }
|
||||
module ranlux { private header "__random/ranlux.h" }
|
||||
|
@ -1721,22 +1721,21 @@ class piecewise_linear_distribution
|
||||
// standard-mandated includes
|
||||
#include <initializer_list>
|
||||
|
||||
#include <cmath> // for backward compatibility; TODO remove it
|
||||
#include <cstddef> // for backward compatibility; TODO remove it
|
||||
#include <cstdint> // for backward compatibility; TODO remove it
|
||||
#include <iosfwd> // for backward compatibility; TODO remove it
|
||||
#include <limits> // for backward compatibility; TODO remove it
|
||||
#include <numeric> // for backward compatibility; TODO remove it
|
||||
#include <string> // for backward compatibility; TODO remove it
|
||||
#include <type_traits> // for backward compatibility; TODO remove it
|
||||
#include <vector> // for backward compatibility; TODO remove it
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
|
||||
# include <algorithm>
|
||||
# include <cmath>
|
||||
# include <cstddef>
|
||||
# include <cstdint>
|
||||
# include <iosfwd>
|
||||
# include <limits>
|
||||
# include <numeric>
|
||||
# include <string>
|
||||
# include <type_traits>
|
||||
# include <vector>
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_RANDOM
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
#include <random>
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// explicit independent_bits_engine(const Engine& e);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// explicit shuffle_order_engine(const Engine& e);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// template<class _URNG> result_type operator()(_URNG& g);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type min() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type min() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type min() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type min() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,10 @@
|
||||
// template<class _URNG> result_type operator()(_URNG& g);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// result_type max() const;
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// discrete_distribution();
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// UnaryOperation fw);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// discrete_distribution(initializer_list<double> wl);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -15,7 +15,9 @@
|
||||
// discrete_distribution(InputIterator firstW, InputIterator lastW);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// explicit discrete_distribution(const param_type& parm);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// param_type(initializer_list<double> wl);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// UnaryOperation fw);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// param_type(initializer_list<double> wl);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -15,7 +15,9 @@
|
||||
// param_type(InputIterator firstW, InputIterator lastW);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// piecewise_constant_distribution(initializer_list<double> wl);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// result_type xmax, UnaryOperation fw);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -17,7 +17,9 @@
|
||||
// UnaryOperation fw);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -17,7 +17,9 @@
|
||||
// InputIteratorW firstW);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// explicit piecewise_constant_distribution(const param_type& parm);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// param_type();
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// UnaryOperation fw);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// param_type(initializer_list<result_type> bl, UnaryOperation fw);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// InputIteratorW firstW);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// piecewise_linear_distribution(initializer_list<double> wl);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// result_type xmax, UnaryOperation fw);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -17,7 +17,9 @@
|
||||
// UnaryOperation fw);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -17,7 +17,9 @@
|
||||
// InputIteratorW firstW);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// explicit piecewise_linear_distribution(const param_type& parm);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -14,7 +14,9 @@
|
||||
// param_type();
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// UnaryOperation fw);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// param_type(initializer_list<result_type> bl, UnaryOperation fw);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
// InputIteratorW firstW);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -18,7 +18,9 @@
|
||||
// IntType b = numeric_limits<IntType>::max()); // C++20
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
|
||||
#include "test_macros.h"
|
||||
#if TEST_STD_VER >= 11
|
||||
|
@ -16,7 +16,9 @@
|
||||
// template<class _URNG> result_type operator()(_URNG& g);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
@ -12,7 +12,9 @@
|
||||
// RealType generate_canonical(URNG& g);
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "truncate_fp.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user