Export of internal Abseil changes.
-- fe689b30f9a3a614e8a577997cc340043d01c2f1 by Abseil Team <absl-team@google.com>: Change arm32 linux backtrace to use the generic implementation. PiperOrigin-RevId: 218386158 -- 86f8678d055d32edc989e6a4d1dc49c3a15cd350 by Abseil Team <absl-team@google.com>: Update documentation on SHARED_LOCKS_REQUIRED and EXCLUSIVE_LOCKS_REQUIRED so that users know the differences between them. PiperOrigin-RevId: 218365545 -- 22947b48ce4a1ba71ad4794f762235dac3a1df12 by Greg Falcon <gfalcon@google.com>: The from_chars implementation incorrectly assumed `uint32_t` was `unsigned int`. `strings_internal::BigUnsigned` had `uint32_t` and `uint64_t` constructors; when both of these types differ from `unsigned int`, `BigUnsigned(1u)` is ambiguous (neither conversion is better). Fix this by removing the `uint32_t` constructor. When the `uint64_t` constructor is called with a literal or type that is 32 bits or narrower, the compiler is smart enough to optimize away the two-word case, so this fix is free. PiperOrigin-RevId: 218346935 -- 7201ab430bb90ca0e30b102915d02564f61353eb by Abseil Team <absl-team@google.com>: Fix formatting errors discovered during merge conflict. PiperOrigin-RevId: 218229891 GitOrigin-RevId: fe689b30f9a3a614e8a577997cc340043d01c2f1 Change-Id: I5d382482ad227d48ffe57b243ce11b1eb44a1314
This commit is contained in:
parent
c16d5557cd
commit
0884a6a04e
5 changed files with 30 additions and 19 deletions
|
@ -112,6 +112,7 @@ endfunction()
|
||||||
# User can then use the library as absl::main_lib (although absl_main_lib is defined too).
|
# User can then use the library as absl::main_lib (although absl_main_lib is defined too).
|
||||||
#
|
#
|
||||||
# TODO: Implement "ALWAYSLINK"
|
# TODO: Implement "ALWAYSLINK"
|
||||||
|
|
||||||
function(absl_cc_library)
|
function(absl_cc_library)
|
||||||
cmake_parse_arguments(ABSL_CC_LIB
|
cmake_parse_arguments(ABSL_CC_LIB
|
||||||
"DISABLE_INSTALL;PUBLIC;TESTONLY"
|
"DISABLE_INSTALL;PUBLIC;TESTONLY"
|
||||||
|
@ -119,18 +120,21 @@ endfunction()
|
||||||
"HDRS;SRCS;COPTS;DEFINES;LINKOPTS;DEPS"
|
"HDRS;SRCS;COPTS;DEFINES;LINKOPTS;DEPS"
|
||||||
${ARGN}
|
${ARGN}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT ABSL_CC_LIB_TESTONLY OR ABSL_RUN_TESTS)
|
if (NOT ABSL_CC_LIB_TESTONLY OR ABSL_RUN_TESTS)
|
||||||
if (ABSL_CC_LIB_PUBLIC)
|
if (ABSL_CC_LIB_PUBLIC)
|
||||||
set(_NAME "absl_${ABSL_CC_LIB_NAME}")
|
set(_NAME "absl_${ABSL_CC_LIB_NAME}")
|
||||||
else()
|
else()
|
||||||
set(_NAME "absl_internal_${ABSL_CC_LIB_NAME}")
|
set(_NAME "absl_internal_${ABSL_CC_LIB_NAME}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Check if this is a header-only library
|
# Check if this is a header-only library
|
||||||
if ("${ABSL_CC_LIB_SRCS}" STREQUAL "")
|
if ("${ABSL_CC_LIB_SRCS}" STREQUAL "")
|
||||||
set(ABSL_CC_LIB_IS_INTERFACE 1)
|
set(ABSL_CC_LIB_IS_INTERFACE 1)
|
||||||
else()
|
else()
|
||||||
set(ABSL_CC_LIB_IS_INTERFACE 0)
|
set(ABSL_CC_LIB_IS_INTERFACE 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT ABSL_CC_LIB_IS_INTERFACE)
|
if(NOT ABSL_CC_LIB_IS_INTERFACE)
|
||||||
add_library(${_NAME} STATIC "")
|
add_library(${_NAME} STATIC "")
|
||||||
target_sources(${_NAME} PRIVATE ${ABSL_CC_LIB_SRCS} ${ABSL_CC_LIB_HDRS})
|
target_sources(${_NAME} PRIVATE ${ABSL_CC_LIB_SRCS} ${ABSL_CC_LIB_HDRS})
|
||||||
|
@ -144,6 +148,7 @@ endfunction()
|
||||||
PRIVATE ${ABSL_CC_LIB_LINKOPTS}
|
PRIVATE ${ABSL_CC_LIB_LINKOPTS}
|
||||||
)
|
)
|
||||||
target_compile_definitions(${_NAME} PUBLIC ${ABSL_CC_LIB_DEFINES})
|
target_compile_definitions(${_NAME} PUBLIC ${ABSL_CC_LIB_DEFINES})
|
||||||
|
|
||||||
# Add all Abseil targets to a a folder in the IDE for organization.
|
# Add all Abseil targets to a a folder in the IDE for organization.
|
||||||
set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER})
|
set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER})
|
||||||
else()
|
else()
|
||||||
|
@ -155,6 +160,7 @@ endfunction()
|
||||||
)
|
)
|
||||||
target_compile_definitions(${_NAME} INTERFACE ${ABSL_CC_LIB_DEFINES})
|
target_compile_definitions(${_NAME} INTERFACE ${ABSL_CC_LIB_DEFINES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ABSL_CC_LIB_PUBLIC)
|
if(ABSL_CC_LIB_PUBLIC)
|
||||||
add_library(absl::${ABSL_CC_LIB_NAME} ALIAS ${_NAME})
|
add_library(absl::${ABSL_CC_LIB_NAME} ALIAS ${_NAME})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -108,13 +108,23 @@
|
||||||
// The mutex is expected to be held both on entry to, and exit from, the
|
// The mutex is expected to be held both on entry to, and exit from, the
|
||||||
// function.
|
// function.
|
||||||
//
|
//
|
||||||
|
// An exclusive lock allows read-write access to the guarded data member(s), and
|
||||||
|
// only one thread can acquire a lock exclusively at any one time. A shared lock
|
||||||
|
// allows read-only access, and any number of threads can acquire a shared lock
|
||||||
|
// concurrently.
|
||||||
|
//
|
||||||
|
// Generally, non-const methods should be annotated with
|
||||||
|
// EXCLUSIVE_LOCKS_REQUIRED, while const methods should be annotated with
|
||||||
|
// SHARED_LOCKS_REQUIRED.
|
||||||
|
//
|
||||||
// Example:
|
// Example:
|
||||||
//
|
//
|
||||||
// Mutex mu1, mu2;
|
// Mutex mu1, mu2;
|
||||||
// int a GUARDED_BY(mu1);
|
// int a GUARDED_BY(mu1);
|
||||||
// int b GUARDED_BY(mu2);
|
// int b GUARDED_BY(mu2);
|
||||||
//
|
//
|
||||||
// void foo() EXCLUSIVE_LOCKS_REQUIRED(mu1, mu2) { ... };
|
// void foo() EXCLUSIVE_LOCKS_REQUIRED(mu1, mu2) { ... }
|
||||||
|
// void bar() const SHARED_LOCKS_REQUIRED(mu1, mu2) { ... }
|
||||||
#define EXCLUSIVE_LOCKS_REQUIRED(...) \
|
#define EXCLUSIVE_LOCKS_REQUIRED(...) \
|
||||||
THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__))
|
THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__))
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,9 @@
|
||||||
#define ABSL_STACKTRACE_INL_HEADER \
|
#define ABSL_STACKTRACE_INL_HEADER \
|
||||||
"absl/debugging/internal/stacktrace_aarch64-inl.inc"
|
"absl/debugging/internal/stacktrace_aarch64-inl.inc"
|
||||||
# elif defined(__arm__)
|
# elif defined(__arm__)
|
||||||
|
// Note: When using glibc this may require -funwind-tables to function properly.
|
||||||
#define ABSL_STACKTRACE_INL_HEADER \
|
#define ABSL_STACKTRACE_INL_HEADER \
|
||||||
"absl/debugging/internal/stacktrace_arm-inl.inc"
|
"absl/debugging/internal/stacktrace_generic-inl.inc"
|
||||||
# else
|
# else
|
||||||
#define ABSL_STACKTRACE_INL_HEADER \
|
#define ABSL_STACKTRACE_INL_HEADER \
|
||||||
"absl/debugging/internal/stacktrace_unimplemented-inl.inc"
|
"absl/debugging/internal/stacktrace_unimplemented-inl.inc"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
||||||
static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
|
static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
|
||||||
const void *ucp, int *min_dropped_frames) {
|
const void *ucp, int *min_dropped_frames) {
|
||||||
|
static_cast<void>(ucp); // Unused.
|
||||||
static const int kStackLength = 64;
|
static const int kStackLength = 64;
|
||||||
void * stack[kStackLength];
|
void * stack[kStackLength];
|
||||||
int size;
|
int size;
|
||||||
|
|
|
@ -57,17 +57,10 @@ class BigUnsigned {
|
||||||
"unsupported max_words value");
|
"unsupported max_words value");
|
||||||
|
|
||||||
BigUnsigned() : size_(0), words_{} {}
|
BigUnsigned() : size_(0), words_{} {}
|
||||||
explicit BigUnsigned(uint32_t v) : size_(v > 0 ? 1 : 0), words_{v} {}
|
explicit constexpr BigUnsigned(uint64_t v)
|
||||||
explicit BigUnsigned(uint64_t v)
|
: size_((v >> 32) ? 2 : v ? 1 : 0),
|
||||||
: size_(0),
|
words_{static_cast<uint32_t>(v & 0xffffffffu),
|
||||||
words_{static_cast<uint32_t>(v & 0xffffffff),
|
static_cast<uint32_t>(v >> 32)} {}
|
||||||
static_cast<uint32_t>(v >> 32)} {
|
|
||||||
if (words_[1]) {
|
|
||||||
size_ = 2;
|
|
||||||
} else if (words_[0]) {
|
|
||||||
size_ = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Constructs a BigUnsigned from the given string_view containing a decimal
|
// Constructs a BigUnsigned from the given string_view containing a decimal
|
||||||
// value. If the input std::string is not a decimal integer, constructs a 0
|
// value. If the input std::string is not a decimal integer, constructs a 0
|
||||||
|
|
Loading…
Reference in a new issue