Skip to content

Commit

Permalink
Export of internal Abseil changes
Browse files Browse the repository at this point in the history
--
c99f979ad34f155fbeeea69b88bdc7458d89a21c by Derek Mauro <[email protected]>:

Remove a floating point division by zero test.

This isn't testing behavior related to the library, and MSVC warns
about it in opt mode.

PiperOrigin-RevId: 285220804

--
68b015491f0dbf1ab547994673281abd1f34cd4b by Gennadiy Rozental <[email protected]>:

This CL introduces following changes to the class FlagImpl:
* We eliminate the CommandLineFlagLocks struct. Instead callback guard and callback function are combined into a single CallbackData struct, while primary data lock is stored separately.
* CallbackData member of class FlagImpl is initially set to be nullptr and is only allocated and initialized when a flag's callback is being set. For most flags we do not pay for the extra space and extra absl::Mutex now.
* Primary data guard is stored in data_guard_ data member. This is a properly aligned character buffer of necessary size. During initialization of the flag we construct absl::Mutex in this space using placement new call.
* We now avoid extra value copy after successful attempt to parse value out of string. Instead we swap flag's current value with tentative value we just produced.

PiperOrigin-RevId: 285132636

--
ed45d118fb818969eb13094cf7827c885dfc562c by Tom Manshreck <[email protected]>:

Change null-term* (and nul-term*) to NUL-term* in comments

PiperOrigin-RevId: 285036610

--
729619017944db895ce8d6d29c1995aa2e5628a5 by Derek Mauro <[email protected]>:

Use the Posix implementation of thread identity on MinGW.
Some versions of MinGW suffer from thread_local bugs.

PiperOrigin-RevId: 285022920

--
39a25493503c76885bc3254c28f66a251c5b5bb0 by Greg Falcon <[email protected]>:

Implementation detail change.

Add further ABSL_NAMESPACE_BEGIN and _END annotation macros to files in Abseil.

PiperOrigin-RevId: 285012012
GitOrigin-RevId: c99f979ad34f155fbeeea69b88bdc7458d89a21c
Change-Id: I4c85d3704e45d11a9ac50d562f39640a6adbedc1
  • Loading branch information
Abseil Team authored and mattcalabrese-google committed Dec 12, 2019
1 parent 1e39f86 commit 12bc53e
Show file tree
Hide file tree
Showing 339 changed files with 949 additions and 83 deletions.
1 change: 1 addition & 0 deletions absl/algorithm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ cc_library(
hdrs = ["algorithm.h"],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = ["//absl/base:config"],
)

cc_test(
Expand Down
2 changes: 2 additions & 0 deletions absl/algorithm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ absl_cc_library(
"algorithm.h"
COPTS
${ABSL_DEFAULT_COPTS}
DEPS
absl::config
PUBLIC
)

Expand Down
4 changes: 4 additions & 0 deletions absl/algorithm/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
#include <iterator>
#include <type_traits>

#include "absl/base/config.h"

namespace absl {
ABSL_NAMESPACE_BEGIN

namespace algorithm_internal {

Expand Down Expand Up @@ -150,6 +153,7 @@ ForwardIterator rotate(ForwardIterator first, ForwardIterator middle,
ForwardIterator>());
}

ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_ALGORITHM_ALGORITHM_H_
2 changes: 2 additions & 0 deletions absl/algorithm/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "absl/meta/type_traits.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_algorithm_internal {

// NOTE: it is important to defer to ADL lookup for building with C++ modules,
Expand Down Expand Up @@ -1720,6 +1721,7 @@ OutputIt c_partial_sum(const InputSequence& input, OutputIt output_first,
output_first, std::forward<BinaryOp>(op));
}

ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_ALGORITHM_CONTAINER_H_
2 changes: 1 addition & 1 deletion absl/base/internal/raw_logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ using LogPrefixHook = bool (*)(absl::LogSeverity severity, const char* file,
//
// 'file' and 'line' are the file and line number where the ABSL_RAW_LOG macro
// was located.
// The null-terminated logged message lives in the buffer between 'buf_start'
// The NUL-terminated logged message lives in the buffer between 'buf_start'
// and 'buf_end'. 'prefix_end' points to the first non-prefix character of the
// buffer (as written by the LogPrefixHook.)
using AbortHook = void (*)(const char* file, int line, const char* buf_start,
Expand Down
2 changes: 1 addition & 1 deletion absl/base/internal/thread_identity.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void ClearCurrentThreadIdentity();
#error ABSL_THREAD_IDENTITY_MODE cannot be direcly set
#elif defined(ABSL_FORCE_THREAD_IDENTITY_MODE)
#define ABSL_THREAD_IDENTITY_MODE ABSL_FORCE_THREAD_IDENTITY_MODE
#elif defined(_WIN32)
#elif defined(_WIN32) && !defined(__MINGW32__)
#define ABSL_THREAD_IDENTITY_MODE ABSL_THREAD_IDENTITY_MODE_USE_CPP11
#elif ABSL_PER_THREAD_TLS && defined(__GOOGLE_GRTE_VERSION__) && \
(__GOOGLE_GRTE_VERSION__ >= 20140228L)
Expand Down
8 changes: 8 additions & 0 deletions absl/container/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ cc_library(
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = ["//visibility:private"],
deps = ["//absl/base:config"],
)

cc_test(
Expand Down Expand Up @@ -478,6 +479,9 @@ cc_library(
hdrs = ["internal/hashtable_debug_hooks.h"],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
"//absl/base:config",
],
)

cc_library(
Expand Down Expand Up @@ -521,6 +525,7 @@ cc_library(
hdrs = ["internal/node_hash_policy.h"],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = ["//absl/base:config"],
)

cc_test(
Expand Down Expand Up @@ -662,6 +667,9 @@ cc_library(
hdrs = ["internal/tracked.h"],
copts = ABSL_TEST_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
"//absl/base:config",
],
)

cc_library(
Expand Down
8 changes: 8 additions & 0 deletions absl/container/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ absl_cc_library(
"internal/counting_allocator.h"
COPTS
${ABSL_DEFAULT_COPTS}
DEPS
absl::config
)

absl_cc_test(
Expand Down Expand Up @@ -574,6 +576,8 @@ absl_cc_library(
"internal/hashtable_debug_hooks.h"
COPTS
${ABSL_DEFAULT_COPTS}
DEPS
absl::config
PUBLIC
)

Expand All @@ -593,6 +597,8 @@ absl_cc_library(
"internal/node_hash_policy.h"
COPTS
${ABSL_DEFAULT_COPTS}
DEPS
absl::config
PUBLIC
)

Expand Down Expand Up @@ -735,6 +741,8 @@ absl_cc_library(
"internal/tracked.h"
COPTS
${ABSL_TEST_COPTS}
DEPS
absl::config
TESTONLY
)

Expand Down
2 changes: 2 additions & 0 deletions absl/container/btree_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "absl/container/internal/btree_container.h" // IWYU pragma: export

namespace absl {
ABSL_NAMESPACE_BEGIN

// absl::btree_map<>
//
Expand Down Expand Up @@ -700,6 +701,7 @@ void swap(btree_multimap<K, V, C, A> &x, btree_multimap<K, V, C, A> &y) {
return x.swap(y);
}

ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_CONTAINER_BTREE_MAP_H_
2 changes: 2 additions & 0 deletions absl/container/btree_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "absl/container/internal/btree_container.h" // IWYU pragma: export

namespace absl {
ABSL_NAMESPACE_BEGIN

// absl::btree_set<>
//
Expand Down Expand Up @@ -648,6 +649,7 @@ void swap(btree_multiset<K, C, A> &x, btree_multiset<K, C, A> &y) {
return x.swap(y);
}

ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_CONTAINER_BTREE_SET_H_
2 changes: 2 additions & 0 deletions absl/container/btree_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
ABSL_FLAG(int, test_values, 10000, "The number of values to use for tests");

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {
namespace {

Expand Down Expand Up @@ -2304,4 +2305,5 @@ TEST(Btree, EmptyTree) {

} // namespace
} // namespace container_internal
ABSL_NAMESPACE_END
} // namespace absl
2 changes: 2 additions & 0 deletions absl/container/btree_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "absl/time/time.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {

// Like remove_const but propagates the removal through std::pair.
Expand Down Expand Up @@ -148,6 +149,7 @@ std::vector<V> GenerateValuesWithSeed(int n, int maxval, int seed) {
}

} // namespace container_internal
ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_CONTAINER_BTREE_TEST_H_
2 changes: 2 additions & 0 deletions absl/container/fixed_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "absl/memory/memory.h"

namespace absl {
ABSL_NAMESPACE_BEGIN

constexpr static auto kFixedArrayUseDefault = static_cast<size_t>(-1);

Expand Down Expand Up @@ -508,6 +509,7 @@ void FixedArray<T, N, A>::NonEmptyInlinedStorage::AnnotateDestruct(
#endif // ADDRESS_SANITIZER
static_cast<void>(n); // Mark used when not in asan mode
}
ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_CONTAINER_FIXED_ARRAY_H_
2 changes: 2 additions & 0 deletions absl/container/fixed_array_exception_safety_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "absl/base/internal/exception_safety_testing.h"

namespace absl {
ABSL_NAMESPACE_BEGIN

namespace {

Expand Down Expand Up @@ -195,6 +196,7 @@ TEST(FixedArrayExceptionSafety, FillWithAlloc) {

} // namespace

ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_HAVE_EXCEPTIONS
2 changes: 2 additions & 0 deletions absl/container/flat_hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "absl/memory/memory.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {
template <class K, class V>
struct FlatHashMapPolicy;
Expand Down Expand Up @@ -584,6 +585,7 @@ struct IsUnorderedContainer<

} // namespace container_algorithm_internal

ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_CONTAINER_FLAT_HASH_MAP_H_
2 changes: 2 additions & 0 deletions absl/container/flat_hash_map_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "absl/types/any.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {
namespace {
using ::absl::container_internal::hash_internal::Enum;
Expand Down Expand Up @@ -251,4 +252,5 @@ TEST(FlatHashMap, Any) {

} // namespace
} // namespace container_internal
ABSL_NAMESPACE_END
} // namespace absl
2 changes: 2 additions & 0 deletions absl/container/flat_hash_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "absl/memory/memory.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {
template <typename T>
struct FlatHashSetPolicy;
Expand Down Expand Up @@ -488,6 +489,7 @@ struct IsUnorderedContainer<absl::flat_hash_set<Key, Hash, KeyEqual, Allocator>>

} // namespace container_algorithm_internal

ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_CONTAINER_FLAT_HASH_SET_H_
2 changes: 2 additions & 0 deletions absl/container/flat_hash_set_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "absl/strings/string_view.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {
namespace {

Expand Down Expand Up @@ -125,4 +126,5 @@ TEST(FlatHashSet, MergeExtractInsert) {

} // namespace
} // namespace container_internal
ABSL_NAMESPACE_END
} // namespace absl
2 changes: 2 additions & 0 deletions absl/container/inlined_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "absl/memory/memory.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
// -----------------------------------------------------------------------------
// InlinedVector
// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -841,6 +842,7 @@ H AbslHashValue(H h, const absl::InlinedVector<T, N, A>& a) {
return H::combine(H::combine_contiguous(std::move(h), a.data(), size), size);
}

ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_CONTAINER_INLINED_VECTOR_H_
2 changes: 2 additions & 0 deletions absl/container/internal/btree.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include "absl/utility/utility.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {

// A helper class that indicates if the Compare parameter is a key-compare-to
Expand Down Expand Up @@ -2606,6 +2607,7 @@ int btree<P>::internal_verify(
}

} // namespace container_internal
ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_CONTAINER_INTERNAL_BTREE_H_
2 changes: 2 additions & 0 deletions absl/container/internal/btree_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "absl/meta/type_traits.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {

// A common base class for btree_set, btree_map, btree_multiset, and
Expand Down Expand Up @@ -602,6 +603,7 @@ class btree_multimap_container : public btree_multiset_container<Tree> {
};

} // namespace container_internal
ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_CONTAINER_INTERNAL_BTREE_CONTAINER_H_
2 changes: 2 additions & 0 deletions absl/container/internal/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "absl/types/optional.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {

template <class, class = void>
Expand Down Expand Up @@ -196,6 +197,7 @@ struct InsertReturnType {
};

} // namespace container_internal
ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_CONTAINER_INTERNAL_CONTAINER_H_
2 changes: 2 additions & 0 deletions absl/container/internal/compressed_tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#endif

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {

template <typename... Ts>
Expand Down Expand Up @@ -256,6 +257,7 @@ template <>
class ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTuple<> {};

} // namespace container_internal
ABSL_NAMESPACE_END
} // namespace absl

#undef ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC
Expand Down
2 changes: 2 additions & 0 deletions absl/container/internal/compressed_tuple_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct TwoValues {


namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {
namespace {

Expand Down Expand Up @@ -408,4 +409,5 @@ TEST(CompressedTupleTest, EmptyFinalClass) {

} // namespace
} // namespace container_internal
ABSL_NAMESPACE_END
} // namespace absl
Loading

0 comments on commit 12bc53e

Please sign in to comment.