From fbf0fdab62ac6fcc72b935d505f6837e0884fdc3 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 20 Aug 2020 08:54:55 -0700 Subject: Export of internal Abseil changes -- 9f746b79e16d36dba908ed9e2a586d890fe54acc by Derek Mauro : Remove the Bazel mirror URL that we use in our WORKSPACE file This doesn't appear to be supported. We use --distdir caching in our tests. PiperOrigin-RevId: 327634738 -- e1f6f54830c415fc8bb8dc14483fae4cf9713d75 by Abseil Team : Removing comments following license() rules as they are rarely useful, redundant with LICENSE files, and tend to fall out of date. PiperOrigin-RevId: 327504063 -- b59c076638a57a74a3f8475f1dee8b536e32a15f by Gennadiy Rozental : Change GetAllFlags API to return a collection of mutable flag handles. This will make this interface on par with FindCommandLineFlag and allow to call CommandLineFlag::ParseFrom on the handle returned by GetAllFlags. PiperOrigin-RevId: 327499084 -- bbf56b3c4a1d908d95e5a52aba38b1984151efff by Gennadiy Rozental : Make raw_hash_set compile when AllocTraits::propagate_on_container_swap is false. PiperOrigin-RevId: 327371107 -- 837f62c85ea65c1d6b847a75816198c625fe62ff by Abseil Team : On macOS, `mem_alloc` is defined like this: rpc/types.h:86:#define mem_alloc(bsize) calloc(1, bsize) So if that file is included before container_memory.h, the variable mem_alloc may never get defined. This is fixed by using a different name. PiperOrigin-RevId: 327360224 -- aa8f5528382c0d01239ce75b645723aaf7e1ef46 by Gennadiy Rozental : Release of absl::GetAllFlags API. PiperOrigin-RevId: 327275943 GitOrigin-RevId: 9f746b79e16d36dba908ed9e2a586d890fe54acc Change-Id: I99c5c87dd1712bf8df9a52397b0c1e400a3c3447 --- absl/flags/reflection.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'absl/flags/reflection.cc') diff --git a/absl/flags/reflection.cc b/absl/flags/reflection.cc index e4145b34..d7060221 100644 --- a/absl/flags/reflection.cc +++ b/absl/flags/reflection.cc @@ -303,5 +303,15 @@ CommandLineFlag* FindCommandLineFlag(absl::string_view name) { return registry.FindFlagLocked(name); } +// -------------------------------------------------------------------- + +absl::flat_hash_map GetAllFlags() { + absl::flat_hash_map res; + flags_internal::ForEachFlag([&](CommandLineFlag& flag) { + res.insert({flag.Name(), &flag}); + }); + return res; +} + ABSL_NAMESPACE_END } // namespace absl -- cgit v1.2.3