merge(3p/absl): subtree merge of Abseil up to e19260f

... notably, this includes Abseil's own StatusOr type, which
conflicted with our implementation (that was taken from TensorFlow).

Change-Id: Ie7d6764b64055caaeb8dc7b6b9d066291e6b538f
This commit is contained in:
Vincent Ambo 2020-11-21 14:43:54 +01:00
parent cc27324d02
commit 082c006c04
854 changed files with 11260 additions and 5296 deletions

View file

@ -30,9 +30,6 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace flags_internal {
// Executes specified visitor for each non-retired flag in the registry.
// Requires the caller hold the registry lock.
void ForEachFlagUnlocked(std::function<void(CommandLineFlag&)> visitor);
// Executes specified visitor for each non-retired flag in the registry. While
// callback are executed, the registry is locked and can't be changed.
void ForEachFlag(std::function<void(CommandLineFlag&)> visitor);
@ -41,6 +38,8 @@ void ForEachFlag(std::function<void(CommandLineFlag&)> visitor);
bool RegisterCommandLineFlag(CommandLineFlag&);
void FinalizeRegistry();
//-----------------------------------------------------------------------------
// Retired registrations:
//
@ -74,13 +73,22 @@ bool RegisterCommandLineFlag(CommandLineFlag&);
//
// Retire flag with name "name" and type indicated by ops.
bool Retire(const char* name, FlagFastTypeId type_id);
void Retire(const char* name, FlagFastTypeId type_id, char* buf);
constexpr size_t kRetiredFlagObjSize = 3 * sizeof(void*);
constexpr size_t kRetiredFlagObjAlignment = alignof(void*);
// Registered a retired flag with name 'flag_name' and type 'T'.
template <typename T>
inline bool RetiredFlag(const char* flag_name) {
return flags_internal::Retire(flag_name, base_internal::FastTypeId<T>());
}
class RetiredFlag {
public:
void Retire(const char* flag_name) {
flags_internal::Retire(flag_name, base_internal::FastTypeId<T>(), buf_);
}
private:
alignas(kRetiredFlagObjAlignment) char buf_[kRetiredFlagObjSize];
};
} // namespace flags_internal
ABSL_NAMESPACE_END