Skip to content

Commit

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

Enable the assertion in the iterator's operator++

PiperOrigin-RevId: 290134813

--
f8c53ba8e9c5bb16bbcc1e412a5c2519c912c83e by Abseil Team <[email protected]>:

Define operator== and operator!= for absl::{weak,strong}_equality and
absl::{partial,weak,strong}_ordering types themselves.

PiperOrigin-RevId: 290111564

--
36bc574090cefad74a451719ce2761982647a51d by Tom Manshreck <[email protected]>:

Specify Time library flag formats

PiperOrigin-RevId: 289928010

--
26dd40281add260baab2b60fec05dfb9c5304aaa by Mark Barolak <[email protected]>:

Delete an extraneous forward declaration of absl::Cord.

PiperOrigin-RevId: 289708481

--
e60aea7f33554ff66d7699bb70e7af1d26323f1d by Abseil Team <[email protected]>:

Release b-tree benchmarks.

PiperOrigin-RevId: 289654429

--
660aa83fa000d4bae072b2d1c790f81d0939bc7e by Greg Falcon <[email protected]>:

Use https links.

Import of #586

PiperOrigin-RevId: 289479559

--
0611ea4482dcf23d6b0a0389fe041eeb9052449a by Derek Mauro <[email protected]>:

Removes the static initializer for LookupTables<absl::uint128>::kVmaxOverBase

Uses template specialization to hard code the resulting array.

Static initializers are problematic for a number of reasons. Not only
are they responsible for the static initialization order fiasco, but
they are in the critical path during program startup. For these
reasons, the Google C++ style guide strongly discourages them (and
forbids them when they are not trivially destructible), and Chromium
even has a test forbidding them.

https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
https://chromium.googlesource.com/chromium/src.git/+/master/docs/static_initializers.md
http://neugierig.org/software/chromium/notes/2011/08/static-initializers.html

PiperOrigin-RevId: 289458677

--
c869362f6bb7a872314f74750d38d81bdaa73f95 by Greg Falcon <[email protected]>:

Step 2 of 2 to fix our CCTZ fork to respect inline namespaces.

Re-import of CCTZ from GitHub, applying new changes to honor Abseil's optional inline namespace in MSVC.

PiperOrigin-RevId: 289454407

--
fdb3474d76c2ee0371ccdf7593a78137c03a3f58 by Greg Falcon <[email protected]>:

Step 1 of 2 to fix our CCTZ fork to respect inline namespaces.

CCTZ uses a linker flag to simulate weak symbol support in MSVC.  This takes the form of a #pragma that includes the mangled names of two types: the symbol to treat as weak, and the symbol to use as its default value if no override is provided.

When Abseil is configured to use inline namespaces, the mangled names of these symbols change, and the pragma should change to reflect that.  Fortunately for us, MSVC name mangling is simple enough that we can generate the needed string literals in the preprocessor.

This CL introduces the new macros; the uses will be introduced in a follow-up CL.

PiperOrigin-RevId: 289435599

--
5f152cc36f008acb9ab78f30b5efa40ebaf2754b by Matt Kulukundis <[email protected]>:

Improve documentation for lazy_emplace

PiperOrigin-RevId: 289333112
GitOrigin-RevId: c42a234e2c186bf697ce8d77e85628601fa514a6
Change-Id: I139ce6c7044a70d083af53e428bcb987f0fd88c6
  • Loading branch information
Abseil Team authored and Xiaoyi Zhang committed Jan 21, 2020
1 parent a2e6ade commit 159bf2b
Show file tree
Hide file tree
Showing 11 changed files with 1,025 additions and 60 deletions.
28 changes: 26 additions & 2 deletions absl/base/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
#include "absl/base/options.h"
#include "absl/base/policy_checks.h"

// Helper macro to convert a CPP variable to a string literal.
#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x
#define ABSL_INTERNAL_TOKEN_STR(x) ABSL_INTERNAL_DO_TOKEN_STR(x)

// -----------------------------------------------------------------------------
// Abseil namespace annotations
// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -98,8 +102,6 @@
// Check that ABSL_OPTION_INLINE_NAMESPACE_NAME is neither "head" nor ""
#if defined(__cplusplus) && ABSL_OPTION_USE_INLINE_NAMESPACE == 1

#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x
#define ABSL_INTERNAL_TOKEN_STR(x) ABSL_INTERNAL_DO_TOKEN_STR(x)
#define ABSL_INTERNAL_INLINE_NAMESPACE_STR \
ABSL_INTERNAL_TOKEN_STR(ABSL_OPTION_INLINE_NAMESPACE_NAME)

Expand Down Expand Up @@ -617,6 +619,28 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#define ABSL_INTERNAL_MSVC_2017_DBG_MODE
#endif

// ABSL_INTERNAL_MANGLED_NS
// ABSL_INTERNAL_MANGLED_BACKREFERENCE
//
// Internal macros for building up mangled names in our internal fork of CCTZ.
// This implementation detail is only needed and provided for the MSVC build.
//
// These macros both expand to string literals. ABSL_INTERNAL_MANGLED_NS is
// the mangled spelling of the `absl` namespace, and
// ABSL_INTERNAL_MANGLED_BACKREFERENCE is a back-reference integer representing
// the proper count to skip past the CCTZ fork namespace names. (This number
// is one larger when there is an inline namespace name to skip.)
#if defined(_MSC_VER)
#if ABSL_OPTION_USE_INLINE_NAMESPACE == 0
#define ABSL_INTERNAL_MANGLED_NS "absl"
#define ABSL_INTERNAL_MANGLED_BACKREFERENCE "5"
#else
#define ABSL_INTERNAL_MANGLED_NS \
ABSL_INTERNAL_TOKEN_STR(ABSL_OPTION_INLINE_NAMESPACE_NAME) "@absl"
#define ABSL_INTERNAL_MANGLED_BACKREFERENCE "6"
#endif
#endif

#undef ABSL_INTERNAL_HAS_KEYWORD

#endif // ABSL_BASE_CONFIG_H_
26 changes: 26 additions & 0 deletions absl/container/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -874,3 +874,29 @@ cc_test(
"@com_google_googletest//:gtest_main",
],
)

cc_binary(
name = "btree_benchmark",
testonly = 1,
srcs = [
"btree_benchmark.cc",
],
copts = ABSL_TEST_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
tags = ["benchmark"],
visibility = ["//visibility:private"],
deps = [
":btree",
":btree_test_common",
":flat_hash_map",
":flat_hash_set",
":hashtable_debug",
"//absl/base:raw_logging_internal",
"//absl/flags:flag",
"//absl/hash",
"//absl/memory",
"//absl/strings:str_format",
"//absl/time",
"@com_github_google_benchmark//:benchmark_main",
],
)
Loading

0 comments on commit 159bf2b

Please sign in to comment.