Commit Graph

966 Commits

Author SHA1 Message Date
Andy Getz
8c0b94e793 Switch time_state to explicit default initialization instead of value initialization. (#1261)
It looks to me like the language rules treat these the same for this type, but evidently GCC feels differently.

This only matters under TSAN where SpinLock has a non-trivial destructor, and under C++20 where ABSL_CONST_INIT is implemented (as constinit) by gcc.

Fixes #1253

PiperOrigin-RevId: 469806751
Change-Id: Ic01b0142101f361bc19c95f9f9474e635669c58d
20220623.1
2022-08-31 13:15:21 -04:00
Derek Mauro
273292d1cf Apply LTS transformations for 20220623 LTS branch (#1202) 20220623.rc1 20220623.0 2022-06-23 14:22:47 -04:00
Abseil Team
4dc63bade3 Merge contiguous mappings from the same file.
This allows symbolization to work if different parts of a binary's text are mapped differently, e.g. if they're mlock()ed or mapped onto huge pages.

PiperOrigin-RevId: 456600880
Change-Id: I069264f94cf834df9201968275a00828f5eb077e
2022-06-22 13:56:07 -07:00
Derek Mauro
e7cbb2acd3 Update versions of WORKSPACE dependencies
PiperOrigin-RevId: 456549823
Change-Id: Iee19597c63a653b8562168367d5860cf8421b6ae
2022-06-22 10:39:53 -07:00
Abseil Team
8e27a61883 Use ABSL_INTERNAL_HAS_SSE2 instead of __SSE2__
This ensures that emmintrin.h is included with clang-cl. Otherwise, errors like
this occur:
.../absl/container/internal/raw_hash_set.h(536,8): error: unknown type name '__m128i'
inline __m128i _mm_cmpgt_epi8_fixed(__m128i a, __m128i b) {

This aligns the include ifdef guards and the guards that use the provided APIs.
The includes are also reordered, so they appear after the config header which
provides the internal macro values.

PiperOrigin-RevId: 456530271
Change-Id: I86dfd0022fd06fe7aa132138ec4d1bd14a86ba84
2022-06-22 09:15:57 -07:00
Fabrice Fontaine
01cc6567cf PR #1200: absl/debugging/CMakeLists.txt: link with libexecinfo if needed
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1200

`backtrace` and `execinfo.h` can be provided by libexecinfo on uclibc and musl resulting in the following build failure with any user of abseil-cpp (such as collectd):

```
/home/buildroot/autobuild/instance-0/output-1/host/lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-0/output-1/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libabsl_stacktrace.so: undefined reference to `backtrace'
```

[...]

```
    libgrpc++ . . . . . . no (libgrpc++ not found)
```

[...]

```
configure: error: "Some plugins are missing dependencies - see the summary above for details"
```

Fixes:
 - http://autobuild.buildroot.org/results/6a0484412f020e763ce3ad5bda48f09c78645bff

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Merge dac52cd20e into 93ad4284ac

Merging this change closes #1200

COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1200 from ffontaine:master dac52cd20e
PiperOrigin-RevId: 456323163
Change-Id: I3d2206761524d36e2b227c571e2e513f6840ff75
2022-06-21 12:28:27 -07:00
Derek Mauro
93ad4284ac Update GCC floor container to use Bazel 5.2.0
PiperOrigin-RevId: 456261906
Change-Id: I203199daa1687f54406be4583c2fd400bdbde2cd
2022-06-21 08:09:12 -07:00
Derek Mauro
d2c5297a3c Update GoogleTest version used by Abseil
As part of this update, GoogleTest is now using the Abseil flags
implementation, and the flags usage_test needs to be modified to pass.

If building with bazel and --define=absl=1 to force GoogleTest to use
Abseil, a WORKSPACE dependency on the abseil branch of the RE2 project
is now required.

PiperOrigin-RevId: 455512245
Change-Id: I2025df0c86006fac97a80713524c9d0aae8b358e
2022-06-16 18:46:33 -07:00
Dino Radakovic
b7ceff06d2 Release absl::AnyInvocable
AnyInvocable is a C++11 compatible equivalent of the C++23 [std::move_only_function](https://en.cppreference.com/w/cpp/utility/functional/move_only_function/move_only_function).
Although this implementation matches an intermediate draft revision of the standard (http://wg21.link/p0288r5), it is neither a standard tracking type nor a seamless backfill type.

PiperOrigin-RevId: 455494585
Change-Id: If01565f8eecc78eee38fb794ef142b32b31abc7c
2022-06-16 16:43:07 -07:00
Fabrice Fontaine
53a90f079a PR #1197: absl/base/internal/direct_mmap.h: fix musl build on mips
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1197

Fix the following musl build failure on mips:

```
In file included from /nvmedata/autobuild/instance-15/output-1/build/libabseil-cpp-20211102.0/absl/base/internal/low_level_alloc.cc:26:
/nvmedata/autobuild/instance-15/output-1/build/libabseil-cpp-20211102.0/absl/base/internal/direct_mmap.h:49:10: fatal error: sgidefs.h: No such file or directory
   49 | #include <sgidefs.h>
      |          ^~~~~~~~~~~
```

Fixes:
 - http://autobuild.buildroot.org/results/3fa027e602bacb22316fb5d9b233baa0b0f0e845

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Merge c9b5b5c547 into a184bab83f

Merging this change closes #1197

COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1197 from ffontaine:master c9b5b5c547
PiperOrigin-RevId: 455467767
Change-Id: I1905f7d70e914288bc1524a52adce3476a779fd8
2022-06-16 14:29:34 -07:00
Dino Radakovic
c3c49150cc absl/base/internal/invoke: Ignore bogus warnings on GCC >= 11
PiperOrigin-RevId: 455463553
Change-Id: Ifa6c238556339dd4e36715ac040ca048f2f84a9a
2022-06-16 14:09:51 -07:00
Dino Radakovic
44050f0d60 Revert GoogleTest version used by Abseil to commit 28e1da21d8d677bc98f12ccc7fc159ff19e8e817
Using GoogleTest at 0320f517fd920866d918e564105d68fd4362040a breaks Windows DLLs.

PiperOrigin-RevId: 455452411
Change-Id: Iff89a01351c01487786a22701efedf25860fadf9
2022-06-16 13:18:04 -07:00
Derek Mauro
6b6d40f999 Update GoogleTest version used by Abseil
As part of this update, GoogleTest is now using the Abseil flags
implementation, and the flags usage_test needs to be modified to pass.

If building with bazel and --define=absl=1 to force GoogleTest to use
Abseil, a WORKSPACE dependency on the abseil branch of the RE2 project
is now required.

PiperOrigin-RevId: 455257879
Change-Id: Id1548ce7d6a95b747b72a4f255d31ced98e36006
2022-06-15 17:28:25 -07:00
Derek Mauro
509f275822 explicit_seed_seq_test: work around/disable bogus warnings in GCC 12
PiperOrigin-RevId: 455129922
Change-Id: I3b2a62cbf50057b3ea9b73c2edb44271dc46986c
2022-06-15 07:54:31 -07:00
Derek Mauro
a184bab83f any_test: expand the any emplace bug suppression,
since it has gotten worse in GCC 12

PiperOrigin-RevId: 455128070
Change-Id: Ia866e59d4e2e810aea16afe492d58013c5661a2b
2022-06-15 07:43:22 -07:00
Derek Mauro
2e36d96669 absl::Time: work around bogus GCC 12 -Wrestrict warning
Upstream bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104336

PiperOrigin-RevId: 455001261
Change-Id: If0c72766a2a1d1e87c19c93c07cf62917031415b
2022-06-14 18:04:54 -07:00
Laramie Leavitt
ae228edc16 Make absl::StdSeedSeq an alias for std::seed_seq
PiperOrigin-RevId: 454969441
Change-Id: Ic18d91243ed3aa661ebf47a4c0ea96057aa4092d
2022-06-14 15:25:10 -07:00
Derek Mauro
d66e0dc6cc absl::Optional: suppress bogus -Wmaybe-uninitialized GCC 12 warning
PiperOrigin-RevId: 454947125
Change-Id: Idbe6c8b4953c3d6147326bebc915d24dff83e7d5
2022-06-14 13:51:49 -07:00
Derek Mauro
10ec11de9c algorithm_test: suppress bogus -Wnonnull warning in GCC 12
Upstream bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105705

PiperOrigin-RevId: 454937873
Change-Id: I44f940caf36d83714af765f01cc43c5143fe21c3
2022-06-14 13:11:39 -07:00
Derek Mauro
cfd9476bff flags/marshalling_test: work around bogus GCC 12 -Wmaybe-uninitialized warning
PiperOrigin-RevId: 454934969
Change-Id: Ia4c157133e73ff16390179b37f7a789fc03fa92e
2022-06-14 12:59:46 -07:00
Derek Mauro
bf93dba8e2 counting_allocator: suppress bogus -Wuse-after-free warning in GCC 12
PiperOrigin-RevId: 454932630
Change-Id: Ifc716552bb0cd7babcaf416fe28462c15b4c7f23
2022-06-14 12:48:56 -07:00
Abseil Team
76c7ad8241 Prefer to fallback to UTC when the embedded zoneinfo data does not
contain the requested zone.

And now that we have a fallback at all, remove the special case that
allowed for testing absl::LocalTimeZone() under TZ=US/Pacific.

And we might as well update the existing embedded data while we're here.

This is modifying the test framework only.

PiperOrigin-RevId: 454896078
Change-Id: I3ec8391a5a51fe1e86a14f39d57ed6dac89d5905
2022-06-14 10:24:15 -07:00
Abseil Team
02b0216656 Minor wording fix in the comment for ConsumeSuffix()
PiperOrigin-RevId: 454305599
Change-Id: I528dfe0223280c379d8791373dc2871ad5812f63
2022-06-10 23:21:10 -07:00
Andy Getzendanner
eda52d053e Tweak the signature of status_internal::MakeCheckFailString as part of an upcoming change
PiperOrigin-RevId: 454251164
Change-Id: I256b7a662478f9317a4133ec209fa5488a942886
2022-06-10 15:13:23 -07:00
Abseil Team
9431a83791 Fix several typos in comments.
PiperOrigin-RevId: 454185620
Change-Id: Ifdff33cec4bdd63f160a8d3c18f959ac2a3b6f25
2022-06-10 09:53:55 -07:00
Abseil Team
45eba9c16a Reformulate documentation of ABSL_LOCKS_EXCLUDED.
The intent of the macro is to say what locks cannot be held when calling the method, not making a promise that they will be acquired.

PiperOrigin-RevId: 454158686
Change-Id: I71087460c3df27c7d6e0571156f19f525024f1de
2022-06-10 07:19:04 -07:00
Dino Radakovic
db60907587 absl/base/internal/invoke.h: Use ABSL_INTERNAL_CPLUSPLUS_LANG for language version guard
PiperOrigin-RevId: 453970585
Change-Id: Iac23eb88ea676efc822f001020b1cc2c255dbbc1
2022-06-09 11:21:39 -07:00
Derek Mauro
9eff97861b Fix C++17 constexpr storage deprecation warnings
This change introduces the symbol
ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
to guard redundant declarations of static constexpr data
members that are needed prior to C++17.

This change also introduces the symbol
ABSL_INTERNAL_CPLUSPLUS_LANG, which is supposed to be set
to the same value as __cplusplus, except it uses _MSVC_LANG
on MSVC so that the value is correct on MSVC.

Neither of these new symbols should be used outside of Abseil.

Fixes #1191

PiperOrigin-RevId: 453923908
Change-Id: I1316c52c19fa0c168b93cced0c817e4cb7c9c862
2022-06-09 07:50:21 -07:00
Abseil Team
7383f346c9 Optimize SwissMap iteration by another 5-10% for ARM
https://pastebin.com/fDvgWgHe

After having a chat with Dougall Johnson (https://twitter.com/dougallj/status/1534213050944802816), we realized that __clzll works with zero arguments per documentation:

https://developer.arm.com/documentation/101028/0009/Data-processing-intrinsics

```
Returns the number of leading zero bits in x. When x is zero it returns the argument width, i.e. 32 or 64.
```

Codegen improves https://godbolt.org/z/ebadf717Y

Thus we can use a little bit different construction not involving CLS but using more understandable CLZ and removing some operations.

PiperOrigin-RevId: 453879080
Change-Id: Ie2d7f834f63364d7bd50dd6a682c107985f21942
2022-06-09 03:13:29 -07:00
Tom Manshreck
e0a32c2aee Add documentation on optional flags to the flags library overview.
PiperOrigin-RevId: 453766125
Change-Id: Id4d88ae20bdadc960a65bc1010eea746f1eba051
2022-06-08 14:23:13 -07:00
Saleem Abdulrasool
7a8d20b784 absl: correct the stack trace path on RISCV
When we would perform a stacktrace using the frame pointer walking, because we
did the adjustment for the return address separately, we were misaligning the
stack size and frame.  Simplify the logic and correct the offset.

The recovered frame pointer provides us with the return address of the current
frame and the previous frame's frame pointer.  Subsequently, we decide if we
want to record this frame or not.  The value in `next_frame_pointer` already
points to the value from the previous stack frame (that is the next frame
pointer to iterate).  As such, the value computed by `ComputeStackFrameSize` is
the value for the current frame.  This was offset by one previously.

Take the opportunity to clean up some of the local comments, fixing typos and
splitting up the comments to reflect the lines that they are associated with.

PiperOrigin-RevId: 453744059
Change-Id: If14813e0ac36f327f4b7594472f2222d05c478aa
2022-06-08 12:43:17 -07:00
Copybara-Service
ef799d3372 Merge pull request #1194 from jwnimmer-tri:default-linkopts
PiperOrigin-RevId: 453455549
Change-Id: Ib7c3d843d537e30d4086428dad539d162357308e
2022-06-07 09:31:59 -07:00
James Y Knight
ef615a8f5d Remove unintended defines from config.h
PiperOrigin-RevId: 453429588
Change-Id: Id377cd89dc807da80a33a8549f4e59bd935aff93
2022-06-07 07:14:56 -07:00
Jeremy Nimmer
c588201b68 Obey ABSL_DEFAULT_LINKOPTS for all cc_library targets
A few targets were missing `linkopts = ...` and so were not obeying
the project-wide default settings.

Omit any changes to cctz for now, because it's vendored from another project.
2022-06-06 13:13:36 -07:00
Benjamin Barenblat
ba9f2f6609 Ignore invalid TZ settings in tests
For portability, absl_time_test builds a small, incomplete tzdata
database into the test binary and uses that instead of the system tzdata
database. (absl_time_test needs to run on some platforms that lack a
system tzdata database.) However, this causes issues if TZ is set to
something that isn’t in the test database. To address them, fall back to
America/Los_Angeles if TZ is set to an unknown value during testing.

Bug: https://bugs.debian.org/1012194
PiperOrigin-RevId: 453257912
Change-Id: I293d0f96876b31c32a2847468a3377bb49f3aa15
2022-06-06 12:28:41 -07:00
Derek Mauro
91b8bfab44 Add ABSL_HARDENING_ASSERTs to CordBuffer::SetLength() and
CordBuffer::IncreaseLengthBy()

PiperOrigin-RevId: 453243686
Change-Id: If109da6be651006d4d9820bcc10eddfb56deaea2
2022-06-06 11:27:17 -07:00
Derek Mauro
800a88de73 Fix comment typo about absl::Status<T*>
PiperOrigin-RevId: 453241556
Change-Id: Ia92d737b6a678e3a4eda965056503392af44486a
2022-06-06 11:18:31 -07:00
Evan Brown
ef034836d3 In b-tree, support unassignable value types.
Avoid using value move/swap and delete those functions from slot_policy types. There was only one use of params_type::move in `erase`.

PiperOrigin-RevId: 453237739
Change-Id: Ie81c6dba6c4db34e97a067d2c0defcded8044a5a
2022-06-06 11:02:59 -07:00
Abseil Team
6481443560 Optimize SwissMap for ARM by 3-8% for all operations
https://pastebin.com/CmnzwUFN

The key idea is to avoid using 16 byte NEON and use 8 byte NEON which has lower latency for BitMask::Match. Even though 16 byte NEON achieves higher throughput, in SwissMap it's very important to catch these Matches with low latency as probing on average happens at most once.

I also introduced NonIterableMask as ARM has really great cbnz instructions and additional AND on scalar mask had 1 extra latency cycle

PiperOrigin-RevId: 453216147
Change-Id: I842c50d323954f8383ae156491232ced55aacb78
2022-06-06 09:29:27 -07:00
Derek Mauro
48419595d3 Release absl::CordBuffer
absl::CordBuffer holds data for eventual inclusion within an existing
absl::Cord. CordBuffers are useful for building large Cords that may
require custom allocation of its associated memory, a pattern that is
common in zero-copy APIs.
PiperOrigin-RevId: 453212229
Change-Id: I6a8adc3a8d206691cb1b0001a9161e5080dd1c5f
2022-06-06 09:10:20 -07:00
Derek Mauro
9cdb98e731 InlinedVector: Limit the scope of the maybe-uninitialized warning suppression
Due to changes in GCC 12, without this change, the warning fires

PiperOrigin-RevId: 453197246
Change-Id: I2e31cbff1707ab09868cf77dcf040b033984e654
2022-06-06 07:44:19 -07:00
Samuel Benzaquen
47345f63b9 Improve the compiler error by removing some noise from it.
The "deleted" overload error is useless to users. By passing some dummy string to the base class constructor we use a valid constructor and remove the unintended use of the deleted default constructor.

PiperOrigin-RevId: 452826509
Change-Id: I5430a373c8e7e3a13336d2c42899e0e59444620b
2022-06-03 13:02:27 -07:00
Copybara-Service
fa5d5f4c26 Merge pull request #714 from kgotlinux:patch-2
PiperOrigin-RevId: 452619005
Change-Id: I6c120f9e7bbabe3b00821adc441608ae9118bee6
2022-06-02 14:13:21 -07:00
Andy Getzendanner
859c63524f Include proper #includes for POSIX thread identity implementation when using that implementation on MinGW.
Fixes #1124

PiperOrigin-RevId: 452596638
Change-Id: Iab34b8e112dc050ffe346a418fa7b499983f0dcf
2022-06-02 12:27:26 -07:00
Laramie Leavitt
bed94589f2 Rework NonsecureURBGBase seed sequence.
Decompose RandenPoolSeedSeq from NonsecureURBGBase.

Adjust how the RandenPoolSeedSeq detects contiguous buffers passed to the generate function. Previously it made incorrect assumptions regarding the contiguous concept, which have been replaced with some type-based tests for a small number of known contiguous random access iterator types, including raw pointers.

PiperOrigin-RevId: 452564114
Change-Id: Idab1df9dd078d8e5c565c7fa7ccb9c0d3d392ad2
2022-06-02 10:08:59 -07:00
Tom Rybka
c34c552a1a Disable tests on some platforms where they currently fail.
PiperOrigin-RevId: 452542838
Change-Id: I45d80b220c0450d27423bb23504e95c25811877b
2022-06-02 08:22:59 -07:00
Abseil Team
6285deef8c Fixed typo in a comment.
PiperOrigin-RevId: 452537510
Change-Id: I7d2a19d1206aa08fce131bacda461fdefebe8713
2022-06-02 07:53:42 -07:00
Anqi D
2617970857 Rollforward of commit ea78ded7a5.
PiperOrigin-RevId: 452161150
Change-Id: Ia5515eae52502ca0b79c7e7dff0a57aa5899e354
2022-05-31 16:00:07 -07:00
Greg Falcon
a567153787 Add an internal helper for logging (upcoming).
PiperOrigin-RevId: 452134803
Change-Id: I8660df850ab537c441399545b25eb32399b2a3ef
2022-05-31 14:01:26 -07:00
Copybara-Service
b957f0ccd0 Merge pull request #1187 from trofi:fix-gcc-13-build
PiperOrigin-RevId: 452110436
Change-Id: I3cb870935932c7e2895c8a7f019f375ad707ee77
2022-05-31 12:20:05 -07:00