Export of internal Abseil changes

--
f6d1ddef9a38e3fb8492181bf1a7a006b7f2145d by Abseil Team <absl-team@google.com>:

Update the implementation of `operator<<` in Status to use `ToString(StatusToStringMode::kWithEverything)`

PiperOrigin-RevId: 380740880

--
5f13b20c4b85c1c6e94b69c74f80f8f3f3941747 by Derek Mauro <dmauro@google.com>:

Update Docker images

This also disables the Clang/libstdc++/C++20 combo as it seems that
the latest libstdc++ is relying on C++20 Concepts to a greater extent
than Clang supports.

PiperOrigin-RevId: 380714572

--
f8f4dee12cfd02559bf741ad6b06f10ac0c48c73 by Abseil Team <absl-team@google.com>:

Fix shadow member warnings in randen_hwaes.cc

These happen when attempting to use abseil in github.com/google/benchmark. The project sets -Wshadow.

The warning is due to the name of the Vector128 ctor parameter. Using v instead, which I see used elsewhere (e.g. line 290)

PiperOrigin-RevId: 380704197

--
2e1a09e9cb1239485715acb4828d9b4799fcfbb5 by Tom Manshreck <shreck@google.com>:

Add more precise documentation for AbslParseFlag declarations in the Time API

PiperOrigin-RevId: 380649107

--
153e5f7a960c03e4161c03737a0ff18ba377ff73 by Evan Brown <ezb@google.com>:

Make the number of control bytes a constant.

We use a constexpr function because we need to support C++11, which doesn't have inline variables.

The motivation is to avoid future bugs where the number changes and we forget to update all the places it's used.

This CL should be a no-op.

PiperOrigin-RevId: 380253975
GitOrigin-RevId: f6d1ddef9a38e3fb8492181bf1a7a006b7f2145d
Change-Id: Id584138f898bf3ebef95fabcf48e41098c4db954
pull/986/head
Abseil Team 3 years ago committed by rogeeff
parent 60be12ed98
commit 4a23151e7e
  1. 2
      absl/container/internal/raw_hash_set.cc
  2. 14
      absl/container/internal/raw_hash_set.h
  3. 2
      absl/random/internal/randen_hwaes.cc
  4. 2
      absl/status/status.cc
  5. 28
      absl/time/time.h
  6. 1
      ci/linux_clang-latest_libcxx_asan_bazel.sh
  7. 1
      ci/linux_clang-latest_libcxx_bazel.sh
  8. 1
      ci/linux_clang-latest_libcxx_tsan_bazel.sh
  9. 3
      ci/linux_clang-latest_libstdcxx_bazel.sh
  10. 6
      ci/linux_docker_containers.sh
  11. 1
      ci/linux_gcc-floor_libstdcxx_bazel.sh
  12. 1
      ci/linux_gcc-latest_libstdcxx_bazel.sh

@ -51,7 +51,7 @@ void ConvertDeletedToEmptyAndFullToDeleted(
Group{pos}.ConvertSpecialToEmptyAndFullToDeleted(pos); Group{pos}.ConvertSpecialToEmptyAndFullToDeleted(pos);
} }
// Copy the cloned ctrl bytes. // Copy the cloned ctrl bytes.
std::memcpy(ctrl + capacity + 1, ctrl, Group::kWidth - 1); std::memcpy(ctrl + capacity + 1, ctrl, NumClonedBytes());
ctrl[capacity] = kSentinel; ctrl[capacity] = kSentinel;
} }

@ -448,6 +448,10 @@ using Group = GroupSse2Impl;
using Group = GroupPortableImpl; using Group = GroupPortableImpl;
#endif #endif
// The number of cloned control bytes that we copy from the beginning to the
// end of the control bytes array.
constexpr size_t NumClonedBytes() { return Group::kWidth - 1; }
template <class Policy, class Hash, class Eq, class Alloc> template <class Policy, class Hash, class Eq, class Alloc>
class raw_hash_set; class raw_hash_set;
@ -629,8 +633,8 @@ class raw_hash_set {
static Layout MakeLayout(size_t capacity) { static Layout MakeLayout(size_t capacity) {
assert(IsValidCapacity(capacity)); assert(IsValidCapacity(capacity));
// The extra control bytes are for 1 sentinel byte followed by // The extra control bytes are for 1 sentinel byte followed by
// `Group::kWidth - 1` bytes that are cloned from the beginning. // NumClonedBytes() bytes that are cloned from the beginning.
return Layout(capacity + Group::kWidth, capacity); return Layout(capacity + 1 + NumClonedBytes(), capacity);
} }
using AllocTraits = absl::allocator_traits<allocator_type>; using AllocTraits = absl::allocator_traits<allocator_type>;
@ -1796,8 +1800,8 @@ class raw_hash_set {
} }
ctrl_[i] = h; ctrl_[i] = h;
constexpr size_t kClonedBytes = Group::kWidth - 1; ctrl_[((i - NumClonedBytes()) & capacity_) +
ctrl_[((i - kClonedBytes) & capacity_) + (kClonedBytes & capacity_)] = h; (NumClonedBytes() & capacity_)] = h;
} }
size_t& growth_left() { return settings_.template get<0>(); } size_t& growth_left() { return settings_.template get<0>(); }
@ -1816,7 +1820,7 @@ class raw_hash_set {
// TODO(alkis): Investigate removing some of these fields: // TODO(alkis): Investigate removing some of these fields:
// - ctrl/slots can be derived from each other // - ctrl/slots can be derived from each other
// - size can be moved into the slot array // - size can be moved into the slot array
ctrl_t* ctrl_ = EmptyGroup(); // [(capacity + Group::kWidth) * ctrl_t] ctrl_t* ctrl_ = EmptyGroup(); // [(capacity + 1 + NumClonedBytes()) * ctrl_t]
slot_type* slots_ = nullptr; // [capacity * slot_type] slot_type* slots_ = nullptr; // [capacity * slot_type]
size_t size_ = 0; // number of full slots size_t size_ = 0; // number of full slots
size_t capacity_ = 0; // total number of slots size_t capacity_ = 0; // total number of slots

@ -270,7 +270,7 @@ namespace {
class Vector128 { class Vector128 {
public: public:
// Convert from/to intrinsics. // Convert from/to intrinsics.
inline explicit Vector128(const __m128i& Vector128) : data_(Vector128) {} inline explicit Vector128(const __m128i& v) : data_(v) {}
inline __m128i data() const { return data_; } inline __m128i data() const { return data_; }

@ -308,7 +308,7 @@ std::string Status::ToStringSlow(StatusToStringMode mode) const {
} }
std::ostream& operator<<(std::ostream& os, const Status& x) { std::ostream& operator<<(std::ostream& os, const Status& x) {
os << x.ToString(); os << x.ToString(StatusToStringMode::kWithEverything);
return os; return os;
} }

@ -547,10 +547,20 @@ inline std::ostream& operator<<(std::ostream& os, Duration d) {
// `ZeroDuration()`. Parses "inf" and "-inf" as +/- `InfiniteDuration()`. // `ZeroDuration()`. Parses "inf" and "-inf" as +/- `InfiniteDuration()`.
bool ParseDuration(absl::string_view dur_string, Duration* d); bool ParseDuration(absl::string_view dur_string, Duration* d);
// Support for flag values of type Duration. Duration flags must be specified // AbslParseFlag()
// in a format that is valid input for absl::ParseDuration(). //
// Parses a command-line flag string representation `text` into a a Duration
// value. Duration flags must be specified in a format that is valid input for
// `absl::ParseDuration()`.
bool AbslParseFlag(absl::string_view text, Duration* dst, std::string* error); bool AbslParseFlag(absl::string_view text, Duration* dst, std::string* error);
// AbslUnparseFlag()
//
// Unparses a Duration value into a command-line string representation using
// the format specified by `absl::ParseDuration()`.
std::string AbslUnparseFlag(Duration d); std::string AbslUnparseFlag(Duration d);
ABSL_DEPRECATED("Use AbslParseFlag() instead.") ABSL_DEPRECATED("Use AbslParseFlag() instead.")
bool ParseFlag(const std::string& text, Duration* dst, std::string* error); bool ParseFlag(const std::string& text, Duration* dst, std::string* error);
ABSL_DEPRECATED("Use AbslUnparseFlag() instead.") ABSL_DEPRECATED("Use AbslUnparseFlag() instead.")
@ -813,8 +823,12 @@ Time FromChrono(const std::chrono::system_clock::time_point& tp);
// // tp == std::chrono::system_clock::from_time_t(123); // // tp == std::chrono::system_clock::from_time_t(123);
std::chrono::system_clock::time_point ToChronoTime(Time); std::chrono::system_clock::time_point ToChronoTime(Time);
// Support for flag values of type Time. Time flags must be specified in a // AbslParseFlag()
// format that matches absl::RFC3339_full. For example: //
// Parses the command-line flag string representation `text` into a Time value.
// Time flags must be specified in a format that matches absl::RFC3339_full.
//
// For example:
// //
// --start_time=2016-01-02T03:04:05.678+08:00 // --start_time=2016-01-02T03:04:05.678+08:00
// //
@ -824,7 +838,13 @@ std::chrono::system_clock::time_point ToChronoTime(Time);
// seconds/milliseconds/etc from the Unix epoch, use an absl::Duration flag // seconds/milliseconds/etc from the Unix epoch, use an absl::Duration flag
// and add that duration to absl::UnixEpoch() to get an absl::Time. // and add that duration to absl::UnixEpoch() to get an absl::Time.
bool AbslParseFlag(absl::string_view text, Time* t, std::string* error); bool AbslParseFlag(absl::string_view text, Time* t, std::string* error);
// AbslUnparseFlag()
//
// Unparses a Time value into a command-line string representation using
// the format specified by `absl::ParseTime()`.
std::string AbslUnparseFlag(Time t); std::string AbslUnparseFlag(Time t);
ABSL_DEPRECATED("Use AbslParseFlag() instead.") ABSL_DEPRECATED("Use AbslParseFlag() instead.")
bool ParseFlag(const std::string& text, Time* t, std::string* error); bool ParseFlag(const std::string& text, Time* t, std::string* error);
ABSL_DEPRECATED("Use AbslUnparseFlag() instead.") ABSL_DEPRECATED("Use AbslUnparseFlag() instead.")

@ -83,6 +83,7 @@ for std in ${STD}; do
--copt="-fsanitize=undefined" \ --copt="-fsanitize=undefined" \
--copt="-fno-sanitize-blacklist" \ --copt="-fno-sanitize-blacklist" \
--copt=-Werror \ --copt=-Werror \
--distdir="/bazel-distdir" \
--keep_going \ --keep_going \
--linkopt="-fsanitize=address" \ --linkopt="-fsanitize=address" \
--linkopt="-fsanitize-link-c++-runtime" \ --linkopt="-fsanitize-link-c++-runtime" \

@ -85,6 +85,7 @@ for std in ${STD}; do
--copt=\"${exceptions_mode}\" \ --copt=\"${exceptions_mode}\" \
--copt=-Werror \ --copt=-Werror \
--define=\"absl=1\" \ --define=\"absl=1\" \
--distdir=\"/bazel-distdir\" \
--keep_going \ --keep_going \
--show_timestamps \ --show_timestamps \
--test_env=\"GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1\" \ --test_env=\"GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1\" \

@ -81,6 +81,7 @@ for std in ${STD}; do
--copt="-fsanitize=thread" \ --copt="-fsanitize=thread" \
--copt="-fno-sanitize-blacklist" \ --copt="-fno-sanitize-blacklist" \
--copt=-Werror \ --copt=-Werror \
--distdir="/bazel-distdir" \
--keep_going \ --keep_going \
--linkopt="-fsanitize=thread" \ --linkopt="-fsanitize=thread" \
--show_timestamps \ --show_timestamps \

@ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then
fi fi
if [[ -z ${STD:-} ]]; then if [[ -z ${STD:-} ]]; then
STD="c++11 c++14 c++17 c++20" STD="c++11 c++14 c++17"
fi fi
if [[ -z ${COMPILATION_MODE:-} ]]; then if [[ -z ${COMPILATION_MODE:-} ]]; then
@ -78,6 +78,7 @@ for std in ${STD}; do
--copt="${exceptions_mode}" \ --copt="${exceptions_mode}" \
--copt=-Werror \ --copt=-Werror \
--define="absl=1" \ --define="absl=1" \
--distdir="/bazel-distdir" \
--keep_going \ --keep_going \
--linkopt="--gcc-toolchain=/usr/local" \ --linkopt="--gcc-toolchain=/usr/local" \
--show_timestamps \ --show_timestamps \

@ -16,6 +16,6 @@
# Test scripts should source this file to get the identifiers. # Test scripts should source this file to get the identifiers.
readonly LINUX_ALPINE_CONTAINER="gcr.io/google.com/absl-177019/alpine:20201026" readonly LINUX_ALPINE_CONTAINER="gcr.io/google.com/absl-177019/alpine:20201026"
readonly LINUX_CLANG_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20210519" readonly LINUX_CLANG_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20210617"
readonly LINUX_GCC_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20210519" readonly LINUX_GCC_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20210617"
readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20201015" readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20210617"

@ -77,6 +77,7 @@ for std in ${STD}; do
--copt="${exceptions_mode}" \ --copt="${exceptions_mode}" \
--copt=-Werror \ --copt=-Werror \
--define="absl=1" \ --define="absl=1" \
--distdir="/bazel-distdir" \
--keep_going \ --keep_going \
--show_timestamps \ --show_timestamps \
--test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" \ --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" \

@ -83,6 +83,7 @@ for std in ${STD}; do
--copt=\"${exceptions_mode}\" \ --copt=\"${exceptions_mode}\" \
--copt=-Werror \ --copt=-Werror \
--define=\"absl=1\" \ --define=\"absl=1\" \
--distdir=\"/bazel-distdir\" \
--keep_going \ --keep_going \
--show_timestamps \ --show_timestamps \
--test_env=\"GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1\" \ --test_env=\"GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1\" \

Loading…
Cancel
Save