8 Commits

Author SHA1 Message Date
Derek Mauro
5088cf5194 Cleanup the uses of the polyfills absl::any, absl::optional,
absl::variant, and related types

The corresponding headers are removed from cc files, but kept in
headers to prevent breakages from transitive dependencies.

PiperOrigin-RevId: 872421685
Change-Id: I867d4c3f7c9e422289c63816d44719b0530fb0a6
2026-02-19 08:53:17 -08:00
Derek Mauro
c64f219a33 ABSL_ASSUME: Use a ternary operator instead of do-while in the
implementations that use a branch marked unreachable so that it is
usable in more contexts.

The unimplemented case now uses the same definition as ABSL_ASSERT
when NDEBUG is defined.

Fixes https://github.com/abseil/abseil-cpp/issues/1814

PiperOrigin-RevId: 720236336
Change-Id: I4f4f6e8a384dd11a07626b085a001fc2f5b7db21
2025-01-27 11:07:33 -08:00
c8ef
892450977a PR #1786: Fix typo in test case.
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1786

Merge d81cf2128c into dee1b6c2a2

Merging this change closes #1786

COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1786 from c8ef:master d81cf2128c
PiperOrigin-RevId: 694627073
Change-Id: I7ba1dcc5aacdc1c8209628cff0a4e29a62cde7e6
2024-11-08 13:48:44 -08:00
Evan Brown
d859fafe1a Change the macro ABSL_IS_TRIVIALLY_RELOCATABLE into a type trait - absl::is_trivially_relocatable - and move it from optimization.h to type_traits.h.
Example of how to change to the new type trait:
```
#include "absl/base/attributes.h"

if (ABSL_IS_TRIVIALLY_RELOCATABLE(T)) { DoSomething(); }
```
to
```
#include "absl/meta/type_traits.h"

if (absl::is_trivially_relocatable<T>::value) { DoSomething(); }
```

Note that optimization.h is also built in C mode so we can't put a type trait there.

PiperOrigin-RevId: 475633715
Change-Id: I2bc85f3f6711d1280049fd01eb97c497d2d0d929
2022-09-20 13:13:13 -07:00
Evan Brown
c7e60ccfcd Add ABSL_IS_TRIVIALLY_RELOCATABLE and ABSL_ATTRIBUTE_TRIVIAL_ABI macros for use with clang's __is_trivially_relocatable and [[clang::trivial_abi]].
PiperOrigin-RevId: 463668740
Change-Id: I2d2d2f53d8184a7e4f7c848c2a5f5140c2481d72
2022-07-27 13:46:14 -07:00
Abseil Team
dea76486cb Export of internal Abseil changes
--
e1d2e93a3328d9e4362c5510e81bd15ddd0dcf00 by Derek Mauro <dmauro@google.com>:

ROLLBACK: Use auto-detected sanitizer attributes for ASAN, MSAN, and TSAN builds

PiperOrigin-RevId: 323612219

--
6fe0914715bcb680ac1dc533aae3461e2ca1ad50 by Derek Mauro <dmauro@google.com>:

Use auto-detected sanitizer attributes for ASAN, MSAN, and TSAN builds

PiperOrigin-RevId: 323597765

--
9ad74e277348585f06a511aac31fff917a89a5d7 by Mark Barolak <mbar@google.com>:

Import of CCTZ from GitHub.

PiperOrigin-RevId: 323594550

--
9e77ccb5adf7e9867cfa254105930f8fed19699d by Evan Brown <ezb@google.com>:

Remove an unnecessary nullptr check in Cord::PrependTree().

We already check for nullptr at all callsites.

PiperOrigin-RevId: 323583641

--
31ab2355c1b91e474b67ff88b8597ad99f346511 by Gennadiy Rozental <rogeeff@google.com>:

Avoid memory allocations while registering retired flags.

PiperOrigin-RevId: 323523011

--
33435e9b97b31763a80d3e41b5ab2459e862e99a by Jorg Brown <jorg@google.com>:

Allow ABSL_PREDICT_FALSE to be used with a type that's explicitly convertible to bool.

So far ABSL_PREDICT_TRUE could be used with these, but not ABSL_PREDICT_FALSE.

PiperOrigin-RevId: 323514860
GitOrigin-RevId: e1d2e93a3328d9e4362c5510e81bd15ddd0dcf00
Change-Id: Iee5b030d9aec1ae2c0fe8997763cee7bd84b4090
2020-07-28 14:37:27 -04:00
Abseil Team
ccdbb5941f Export of internal Abseil changes
--
05b0b9aaed03199b0041988f3aa31c6257e05712 by Chris Kennelly <ckennelly@google.com>:

Accept absl::string_view for internal ForEachSection parameter.

PiperOrigin-RevId: 316694540

--
d14d61f1d017e967923bbffaf12b45c4e6b40d36 by Abseil Team <absl-team@google.com>:

Allow ABSL_PREDICT_FALSE to be used with a type that's explicitly convertible to bool.

So far ABSL_PREDICT_TRUE could be used with these, but not ABSL_PREDICT_FALSE.

PiperOrigin-RevId: 316684594

--
16a8f5e183688b2bd5069f9d3a2c5f2a978d1eaa by Abseil Team <absl-team@google.com>:

Allow ABSL_PREDICT_FALSE to be used with a type that's explicitly convertible to bool.

So far ABSL_PREDICT_TRUE could be used with these, but not ABSL_PREDICT_FALSE.

PiperOrigin-RevId: 316634388

--
1ecfa42a400a5ea9435110e6a5416a46414bb6fb by Gennadiy Rozental <rogeeff@google.com>:

Internal change

PiperOrigin-RevId: 316547270

--
ee915dffdf18818b30107b79c82792d6ca7fc691 by Andy Getzendanner <durandal@google.com>:

Remove a copy-pasted comment and add a missing cmake dep.

PiperOrigin-RevId: 316541265

--
26c74c5a61269afe37cd459c9a508ddd0a47f8f3 by Gennadiy Rozental <rogeeff@google.com>:

Make absl/flag/reflection target publicly visible.

PiperOrigin-RevId: 316523446
GitOrigin-RevId: 05b0b9aaed03199b0041988f3aa31c6257e05712
Change-Id: I0aaa8b0b81c2a79fbc42d116c105512176010b25
2020-06-16 13:01:21 -04:00
Abseil Team
01f5f81f93 Export of internal Abseil changes
--
ede5d8e8877c81d7e69549e05076f62cb334ef7f by Abseil Team <absl-team@google.com>:

Optimize 128 bit division in absl::uint128 when the intrinsic does not exist

PiperOrigin-RevId: 316413322

--
5dd02300b5a5700f41e4034b15a1c8c9e7349673 by Abseil Team <absl-team@google.com>:

Add additional 128 bit division benchmarks.

PiperOrigin-RevId: 316358648

--
b7ee6e33b5076b7b6817b728f268d9e58b00b123 by Abseil Team <absl-team@google.com>:

Add tests for ABSL_PREDICT_TRUE and ABSL_PREDICT_FALSE macros.

PiperOrigin-RevId: 316325593

--
3d7fe4ab8bc1e736b9697098eeb2cdb7e9910105 by Andy Soffer <asoffer@google.com>:

Removing unnecessary comment using hurtful words.

PiperOrigin-RevId: 316192184
GitOrigin-RevId: ede5d8e8877c81d7e69549e05076f62cb334ef7f
Change-Id: I4e447286d0b823d99cdd658dd49fb66725bb7a30
2020-06-15 12:44:00 -04:00