From e96d49687d9c078f2d47356b6723c3b5715493f7 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 5 Nov 2020 10:55:22 -0800 Subject: Export of internal Abseil changes -- 76c5eb1cf346a1a64e0a5e2edf032546d600075a by Andy Getzendanner : Fix stacktrace on aarch64 architecture. Fixes #805 Import of https://github.com/abseil/abseil-cpp/pull/827 PiperOrigin-RevId: 340886173 -- 28f48f7bcadd4681854cddb0a7736d26d7dab000 by Andy Getzendanner : Some attribute cleanups in and around statusor: * mark statusor_internal::Helper::Crash ABSL_ATTRIBUTE_NORETURN * add ABSL_INTERNAL_UNREACHABLE to ABSL_INTERNAL_LOG when severity is FATAL * create ABSL_INTERNAL_UNREACHABLE to wrap __builtin_unreachable and __assume(0) * use ABSL_ATTRIBUTE_NONNULL instead of __builtin_unreachable in statusor_internal::PlacementNew (https://godbolt.org/z/n691fa) PiperOrigin-RevId: 340868438 -- 33905d1d2d01eb6f81b04abaf24170bfebb6df09 by Andy Getzendanner : moved deleted functions to public for better compiler errors. Import of https://github.com/abseil/abseil-cpp/pull/828 PiperOrigin-RevId: 340863976 -- 5e502222dfc3f5a0ef146535a9e16c743b005092 by Jorg Brown : ConvertibleToStringView wastes a lot of cycles initializing members just to reset them immediately after. Only initialize the string storage when needed. This makes StrSplit() 0-30% faster depending on the use case. PiperOrigin-RevId: 340732039 GitOrigin-RevId: 76c5eb1cf346a1a64e0a5e2edf032546d600075a Change-Id: I2ba1f717c4eaad384cd0a22694fd05f9e6a2d8fa --- absl/status/internal/statusor_internal.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'absl/status') diff --git a/absl/status/internal/statusor_internal.h b/absl/status/internal/statusor_internal.h index 7cc76256..eaac2c0b 100644 --- a/absl/status/internal/statusor_internal.h +++ b/absl/status/internal/statusor_internal.h @@ -17,6 +17,7 @@ #include #include +#include "absl/base/attributes.h" #include "absl/meta/type_traits.h" #include "absl/status/status.h" #include "absl/utility/utility.h" @@ -135,18 +136,14 @@ class Helper { public: // Move type-agnostic error handling to the .cc. static void HandleInvalidStatusCtorArg(Status*); - static void Crash(const absl::Status& status); + ABSL_ATTRIBUTE_NORETURN static void Crash(const absl::Status& status); }; // Construct an instance of T in `p` through placement new, passing Args... to // the constructor. // This abstraction is here mostly for the gcc performance fix. template -void PlacementNew(void* p, Args&&... args) { -#if defined(__GNUC__) && !defined(__clang__) - // Teach gcc that 'p' cannot be null, fixing code size issues. - if (p == nullptr) __builtin_unreachable(); -#endif +ABSL_ATTRIBUTE_NONNULL(1) void PlacementNew(void* p, Args&&... args) { new (p) T(std::forward(args)...); } -- cgit v1.2.3