Commit eb8f0c03 authored by Danil Chapovalov's avatar Danil Chapovalov Committed by Commit Bot

Roll abseil_revision e9e9b9fc74..a4798817e8

Change Log:
https://chromium.googlesource.com/external/github.com/abseil/abseil-cpp/+log/e9e9b9fc74..a4798817e8
Full diff:
https://chromium.googlesource.com/external/github.com/abseil/abseil-cpp/+/e9e9b9fc74..a4798817e8

Bug: None
Change-Id: Ic3de112f7c9f241984b6d8e9fdce79c0b043469b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2532257
Commit-Queue: Danil Chapovalov <danilchap@chromium.org>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Auto-Submit: Danil Chapovalov <danilchap@chromium.org>
Reviewed-by: default avatarMirko Bonadei <mbonadei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826254}
parent 233ceeb4
...@@ -4,7 +4,7 @@ URL: https://github.com/abseil/abseil-cpp ...@@ -4,7 +4,7 @@ URL: https://github.com/abseil/abseil-cpp
License: Apache 2.0 License: Apache 2.0
License File: LICENSE License File: LICENSE
Version: 0 Version: 0
Revision: e9e9b9fc74388482ab748cad33cd9732a2b75d31 Revision: a4798817e824a5c45689933bc62338f3c7d6961b
Security Critical: yes Security Critical: yes
Description: Description:
......
...@@ -61,6 +61,8 @@ class SchedulingGuard { ...@@ -61,6 +61,8 @@ class SchedulingGuard {
public: public:
// Returns true iff the calling thread may be cooperatively rescheduled. // Returns true iff the calling thread may be cooperatively rescheduled.
static bool ReschedulingIsAllowed(); static bool ReschedulingIsAllowed();
SchedulingGuard(const SchedulingGuard&) = delete;
SchedulingGuard& operator=(const SchedulingGuard&) = delete;
private: private:
// Disable cooperative rescheduling of the calling thread. It may still // Disable cooperative rescheduling of the calling thread. It may still
...@@ -101,9 +103,6 @@ class SchedulingGuard { ...@@ -101,9 +103,6 @@ class SchedulingGuard {
friend class SchedulingHelper; friend class SchedulingHelper;
friend class SpinLock; friend class SpinLock;
friend int absl::synchronization_internal::MutexDelay(int32_t c, int mode); friend int absl::synchronization_internal::MutexDelay(int32_t c, int mode);
SchedulingGuard(const SchedulingGuard&) = delete;
SchedulingGuard& operator=(const SchedulingGuard&) = delete;
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -72,12 +72,14 @@ ...@@ -72,12 +72,14 @@
// //
// The API is a subset of the above: each macro only takes two arguments. Use // The API is a subset of the above: each macro only takes two arguments. Use
// StrCat if you need to build a richer message. // StrCat if you need to build a richer message.
#define ABSL_INTERNAL_LOG(severity, message) \ #define ABSL_INTERNAL_LOG(severity, message) \
do { \ do { \
constexpr const char* absl_raw_logging_internal_filename = __FILE__; \ constexpr const char* absl_raw_logging_internal_filename = __FILE__; \
::absl::raw_logging_internal::internal_log_function( \ ::absl::raw_logging_internal::internal_log_function( \
ABSL_RAW_LOGGING_INTERNAL_##severity, \ ABSL_RAW_LOGGING_INTERNAL_##severity, \
absl_raw_logging_internal_filename, __LINE__, message); \ absl_raw_logging_internal_filename, __LINE__, message); \
if (ABSL_RAW_LOGGING_INTERNAL_##severity == ::absl::LogSeverity::kFatal) \
ABSL_INTERNAL_UNREACHABLE; \
} while (0) } while (0)
#define ABSL_INTERNAL_CHECK(condition, message) \ #define ABSL_INTERNAL_CHECK(condition, message) \
......
...@@ -144,4 +144,15 @@ ABSL_NAMESPACE_END ...@@ -144,4 +144,15 @@ ABSL_NAMESPACE_END
#define ABSL_INTERNAL_RETHROW do {} while (false) #define ABSL_INTERNAL_RETHROW do {} while (false)
#endif // ABSL_HAVE_EXCEPTIONS #endif // ABSL_HAVE_EXCEPTIONS
// `ABSL_INTERNAL_UNREACHABLE` is an unreachable statement. A program which
// reaches one has undefined behavior, and the compiler may optimize
// accordingly.
#if defined(__GNUC__) || ABSL_HAVE_BUILTIN(__builtin_unreachable)
#define ABSL_INTERNAL_UNREACHABLE __builtin_unreachable()
#elif defined(_MSC_VER)
#define ABSL_INTERNAL_UNREACHABLE __assume(0)
#else
#define ABSL_INTERNAL_UNREACHABLE
#endif
#endif // ABSL_BASE_MACROS_H_ #endif // ABSL_BASE_MACROS_H_
...@@ -37,8 +37,11 @@ static const unsigned char* GetKernelRtSigreturnAddress() { ...@@ -37,8 +37,11 @@ static const unsigned char* GetKernelRtSigreturnAddress() {
absl::debugging_internal::VDSOSupport vdso; absl::debugging_internal::VDSOSupport vdso;
if (vdso.IsPresent()) { if (vdso.IsPresent()) {
absl::debugging_internal::VDSOSupport::SymbolInfo symbol_info; absl::debugging_internal::VDSOSupport::SymbolInfo symbol_info;
if (!vdso.LookupSymbol("__kernel_rt_sigreturn", "LINUX_2.6.39", STT_FUNC, auto lookup = [&](int type) {
&symbol_info) || return vdso.LookupSymbol("__kernel_rt_sigreturn", "LINUX_2.6.39", type,
&symbol_info);
};
if ((!lookup(STT_FUNC) && !lookup(STT_NOTYPE)) ||
symbol_info.address == nullptr) { symbol_info.address == nullptr) {
// Unexpected: VDSO is present, yet the expected symbol is missing // Unexpected: VDSO is present, yet the expected symbol is missing
// or null. // or null.
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
#include "absl/base/attributes.h"
#include "absl/meta/type_traits.h" #include "absl/meta/type_traits.h"
#include "absl/status/status.h" #include "absl/status/status.h"
#include "absl/utility/utility.h" #include "absl/utility/utility.h"
...@@ -135,18 +136,14 @@ class Helper { ...@@ -135,18 +136,14 @@ class Helper {
public: public:
// Move type-agnostic error handling to the .cc. // Move type-agnostic error handling to the .cc.
static void HandleInvalidStatusCtorArg(Status*); static void HandleInvalidStatusCtorArg(Status*);
static void Crash(const absl::Status& status); ABSL_ATTRIBUTE_NORETURN static void Crash(const absl::Status& status);
}; };
// Construct an instance of T in `p` through placement new, passing Args... to // Construct an instance of T in `p` through placement new, passing Args... to
// the constructor. // the constructor.
// This abstraction is here mostly for the gcc performance fix. // This abstraction is here mostly for the gcc performance fix.
template <typename T, typename... Args> template <typename T, typename... Args>
void PlacementNew(void* p, Args&&... args) { ABSL_ATTRIBUTE_NONNULL(1) void PlacementNew(void* p, Args&&... args) {
#if defined(__GNUC__) && !defined(__clang__)
// Teach gcc that 'p' cannot be null, fixing code size issues.
if (p == nullptr) __builtin_unreachable();
#endif
new (p) T(std::forward<Args>(args)...); new (p) T(std::forward<Args>(args)...);
} }
......
...@@ -51,9 +51,9 @@ ABSL_NAMESPACE_BEGIN ...@@ -51,9 +51,9 @@ ABSL_NAMESPACE_BEGIN
namespace strings_internal { namespace strings_internal {
// This class is implicitly constructible from everything that absl::string_view // This class is implicitly constructible from everything that absl::string_view
// is implicitly constructible from. If it's constructed from a temporary // is implicitly constructible from, except for rvalue strings. This means it
// string, the data is moved into a data member so its lifetime matches that of // can be used as a function parameter in places where passing a temporary
// the ConvertibleToStringView instance. // string might cause memory lifetime issues.
class ConvertibleToStringView { class ConvertibleToStringView {
public: public:
ConvertibleToStringView(const char* s) // NOLINT(runtime/explicit) ConvertibleToStringView(const char* s) // NOLINT(runtime/explicit)
...@@ -65,57 +65,13 @@ class ConvertibleToStringView { ...@@ -65,57 +65,13 @@ class ConvertibleToStringView {
: value_(s) {} : value_(s) {}
// Matches rvalue strings and moves their data to a member. // Matches rvalue strings and moves their data to a member.
ConvertibleToStringView(std::string&& s) // NOLINT(runtime/explicit) ConvertibleToStringView(std::string&& s) = delete;
: copy_(std::move(s)), value_(copy_), self_referential_(true) {} ConvertibleToStringView(const std::string&& s) = delete;
ConvertibleToStringView(const ConvertibleToStringView& other)
: value_(other.value_), self_referential_(other.self_referential_) {
if (other.self_referential_) {
new (&copy_) std::string(other.copy_);
value_ = copy_;
}
}
ConvertibleToStringView(ConvertibleToStringView&& other)
: value_(other.value_), self_referential_(other.self_referential_) {
if (other.self_referential_) {
new (&copy_) std::string(std::move(other.copy_));
value_ = copy_;
}
}
ConvertibleToStringView& operator=(ConvertibleToStringView other) {
this->~ConvertibleToStringView();
new (this) ConvertibleToStringView(std::move(other));
return *this;
}
absl::string_view value() const { return value_; } absl::string_view value() const { return value_; }
~ConvertibleToStringView() { MaybeReleaseCopy(); }
private: private:
void MaybeReleaseCopy() {
if (self_referential_) {
// An explicit destructor call cannot be a qualified name such as
// std::string. The "using" declaration works around this
// issue by creating an unqualified name for the destructor.
using string_type = std::string;
copy_.~string_type();
}
}
struct Unused { // MSVC disallows unions with only 1 member.
};
// Holds the data moved from temporary std::string arguments. Declared first
// so that 'value' can refer to 'copy_'.
union {
std::string copy_;
Unused unused_;
};
absl::string_view value_; absl::string_view value_;
// true if value_ refers to the internal copy_ member.
bool self_referential_ = false;
}; };
// An iterator that enumerates the parts of a string from a Splitter. The text // An iterator that enumerates the parts of a string from a Splitter. The text
...@@ -288,7 +244,11 @@ struct SplitterIsConvertibleTo ...@@ -288,7 +244,11 @@ struct SplitterIsConvertibleTo
// the split strings: only strings for which the predicate returns true will be // the split strings: only strings for which the predicate returns true will be
// kept. A Predicate object is any unary functor that takes an absl::string_view // kept. A Predicate object is any unary functor that takes an absl::string_view
// and returns bool. // and returns bool.
template <typename Delimiter, typename Predicate> //
// The StringType parameter can be either string_view or string, depending on
// whether the Splitter refers to a string stored elsewhere, or if the string
// resides inside the Splitter itself.
template <typename Delimiter, typename Predicate, typename StringType>
class Splitter { class Splitter {
public: public:
using DelimiterType = Delimiter; using DelimiterType = Delimiter;
...@@ -296,12 +256,12 @@ class Splitter { ...@@ -296,12 +256,12 @@ class Splitter {
using const_iterator = strings_internal::SplitIterator<Splitter>; using const_iterator = strings_internal::SplitIterator<Splitter>;
using value_type = typename std::iterator_traits<const_iterator>::value_type; using value_type = typename std::iterator_traits<const_iterator>::value_type;
Splitter(ConvertibleToStringView input_text, Delimiter d, Predicate p) Splitter(StringType input_text, Delimiter d, Predicate p)
: text_(std::move(input_text)), : text_(std::move(input_text)),
delimiter_(std::move(d)), delimiter_(std::move(d)),
predicate_(std::move(p)) {} predicate_(std::move(p)) {}
absl::string_view text() const { return text_.value(); } absl::string_view text() const { return text_; }
const Delimiter& delimiter() const { return delimiter_; } const Delimiter& delimiter() const { return delimiter_; }
const Predicate& predicate() const { return predicate_; } const Predicate& predicate() const { return predicate_; }
...@@ -458,7 +418,7 @@ class Splitter { ...@@ -458,7 +418,7 @@ class Splitter {
}; };
}; };
ConvertibleToStringView text_; StringType text_;
Delimiter delimiter_; Delimiter delimiter_;
Predicate predicate_; Predicate predicate_;
}; };
......
...@@ -369,6 +369,12 @@ struct SkipWhitespace { ...@@ -369,6 +369,12 @@ struct SkipWhitespace {
} }
}; };
template <typename T>
using EnableSplitIfString =
typename std::enable_if<std::is_same<T, std::string>::value ||
std::is_same<T, const std::string>::value,
int>::type;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// StrSplit() // StrSplit()
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -489,22 +495,50 @@ struct SkipWhitespace { ...@@ -489,22 +495,50 @@ struct SkipWhitespace {
// Try not to depend on this distinction because the bug may one day be fixed. // Try not to depend on this distinction because the bug may one day be fixed.
template <typename Delimiter> template <typename Delimiter>
strings_internal::Splitter< strings_internal::Splitter<
typename strings_internal::SelectDelimiter<Delimiter>::type, AllowEmpty> typename strings_internal::SelectDelimiter<Delimiter>::type, AllowEmpty,
absl::string_view>
StrSplit(strings_internal::ConvertibleToStringView text, Delimiter d) { StrSplit(strings_internal::ConvertibleToStringView text, Delimiter d) {
using DelimiterType = using DelimiterType =
typename strings_internal::SelectDelimiter<Delimiter>::type; typename strings_internal::SelectDelimiter<Delimiter>::type;
return strings_internal::Splitter<DelimiterType, AllowEmpty>( return strings_internal::Splitter<DelimiterType, AllowEmpty,
absl::string_view>(
text.value(), DelimiterType(d), AllowEmpty());
}
template <typename Delimiter, typename StringType,
EnableSplitIfString<StringType> = 0>
strings_internal::Splitter<
typename strings_internal::SelectDelimiter<Delimiter>::type, AllowEmpty,
std::string>
StrSplit(StringType&& text, Delimiter d) {
using DelimiterType =
typename strings_internal::SelectDelimiter<Delimiter>::type;
return strings_internal::Splitter<DelimiterType, AllowEmpty, std::string>(
std::move(text), DelimiterType(d), AllowEmpty()); std::move(text), DelimiterType(d), AllowEmpty());
} }
template <typename Delimiter, typename Predicate> template <typename Delimiter, typename Predicate>
strings_internal::Splitter< strings_internal::Splitter<
typename strings_internal::SelectDelimiter<Delimiter>::type, Predicate> typename strings_internal::SelectDelimiter<Delimiter>::type, Predicate,
absl::string_view>
StrSplit(strings_internal::ConvertibleToStringView text, Delimiter d, StrSplit(strings_internal::ConvertibleToStringView text, Delimiter d,
Predicate p) { Predicate p) {
using DelimiterType = using DelimiterType =
typename strings_internal::SelectDelimiter<Delimiter>::type; typename strings_internal::SelectDelimiter<Delimiter>::type;
return strings_internal::Splitter<DelimiterType, Predicate>( return strings_internal::Splitter<DelimiterType, Predicate,
absl::string_view>(
text.value(), DelimiterType(d), std::move(p));
}
template <typename Delimiter, typename Predicate, typename StringType,
EnableSplitIfString<StringType> = 0>
strings_internal::Splitter<
typename strings_internal::SelectDelimiter<Delimiter>::type, Predicate,
std::string>
StrSplit(StringType&& text, Delimiter d, Predicate p) {
using DelimiterType =
typename strings_internal::SelectDelimiter<Delimiter>::type;
return strings_internal::Splitter<DelimiterType, Predicate, std::string>(
std::move(text), DelimiterType(d), std::move(p)); std::move(text), DelimiterType(d), std::move(p));
} }
......
...@@ -730,6 +730,7 @@ EXPORTS ...@@ -730,6 +730,7 @@ EXPORTS
?format@detail@cctz@time_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@AEBV567@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$00@__1@std@@@234@@chrono@67@AEBV?$duration@_JV?$ratio@$00$0DINHOKEMGIAAA@@__1@std@@@967@AEBVtime_zone@234@@Z ?format@detail@cctz@time_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@AEBV567@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$00@__1@std@@@234@@chrono@67@AEBV?$duration@_JV?$ratio@$00$0DINHOKEMGIAAA@@__1@std@@@967@AEBVtime_zone@234@@Z
?from_chars@absl@@YA?AUfrom_chars_result@1@PEBD0AEAMW4chars_format@1@@Z ?from_chars@absl@@YA?AUfrom_chars_result@1@PEBD0AEAMW4chars_format@1@@Z
?from_chars@absl@@YA?AUfrom_chars_result@1@PEBD0AEANW4chars_format@1@@Z ?from_chars@absl@@YA?AUfrom_chars_result@1@PEBD0AEANW4chars_format@1@@Z
?get_weekday@detail@cctz@time_internal@absl@@YA?AW4weekday@1234@AEBV?$civil_time@Usecond_tag@detail@cctz@time_internal@absl@@@1234@@Z
?load_time_zone@cctz@time_internal@absl@@YA_NAEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PEAVtime_zone@123@@Z ?load_time_zone@cctz@time_internal@absl@@YA_NAEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PEAVtime_zone@123@@Z
?local_time_zone@cctz@time_internal@absl@@YA?AVtime_zone@123@XZ ?local_time_zone@cctz@time_internal@absl@@YA?AVtime_zone@123@XZ
?lookup@time_zone@cctz@time_internal@absl@@QEBA?AUabsolute_lookup@1234@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$00@__1@std@@@234@@chrono@__1@std@@@Z ?lookup@time_zone@cctz@time_internal@absl@@QEBA?AUabsolute_lookup@1234@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$00@__1@std@@@234@@chrono@__1@std@@@Z
......
...@@ -730,6 +730,7 @@ EXPORTS ...@@ -730,6 +730,7 @@ EXPORTS
?format@detail@cctz@time_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@AEBV567@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$00@__1@std@@@234@@chrono@67@AEBV?$duration@_JV?$ratio@$00$0DINHOKEMGIAAA@@__1@std@@@967@AEBVtime_zone@234@@Z ?format@detail@cctz@time_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@AEBV567@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$00@__1@std@@@234@@chrono@67@AEBV?$duration@_JV?$ratio@$00$0DINHOKEMGIAAA@@__1@std@@@967@AEBVtime_zone@234@@Z
?from_chars@absl@@YA?AUfrom_chars_result@1@PEBD0AEAMW4chars_format@1@@Z ?from_chars@absl@@YA?AUfrom_chars_result@1@PEBD0AEAMW4chars_format@1@@Z
?from_chars@absl@@YA?AUfrom_chars_result@1@PEBD0AEANW4chars_format@1@@Z ?from_chars@absl@@YA?AUfrom_chars_result@1@PEBD0AEANW4chars_format@1@@Z
?get_weekday@detail@cctz@time_internal@absl@@YA?AW4weekday@1234@AEBV?$civil_time@Usecond_tag@detail@cctz@time_internal@absl@@@1234@@Z
?load_time_zone@cctz@time_internal@absl@@YA_NAEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PEAVtime_zone@123@@Z ?load_time_zone@cctz@time_internal@absl@@YA_NAEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PEAVtime_zone@123@@Z
?local_time_zone@cctz@time_internal@absl@@YA?AVtime_zone@123@XZ ?local_time_zone@cctz@time_internal@absl@@YA?AVtime_zone@123@XZ
?lookup@time_zone@cctz@time_internal@absl@@QEBA?AUabsolute_lookup@1234@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$00@__1@std@@@234@@chrono@__1@std@@@Z ?lookup@time_zone@cctz@time_internal@absl@@QEBA?AUabsolute_lookup@1234@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$00@__1@std@@@234@@chrono@__1@std@@@Z
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment