Commit 6aef90f3 authored by Danil Chapovalov's avatar Danil Chapovalov Committed by Commit Bot

Roll abseil_revision f624790b7f..41a6263fd0

Change Log:
https://chromium.googlesource.com/external/github.com/abseil/abseil-cpp/+log/f624790b7f..41a6263fd0
Full diff:
https://chromium.googlesource.com/external/github.com/abseil/abseil-cpp/+/f624790b7f..41a6263fd0

Bug: None
Change-Id: I79e04696901bf607d83ff66393340de2bd5da3f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315143Reviewed-by: default avatarMirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Danil Chapovalov <danilchap@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791269}
parent cce93de9
......@@ -22,16 +22,24 @@
cmake_minimum_required(VERSION 3.5)
# Compiler id for Apple Clang is now AppleClang.
cmake_policy(SET CMP0025 NEW)
if (POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif (POLICY CMP0025)
# if command can use IN_LIST
cmake_policy(SET CMP0057 NEW)
if (POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif (POLICY CMP0057)
# Project version variables are the empty string if version is unspecified
cmake_policy(SET CMP0048 NEW)
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)
# option() honor variables
cmake_policy(SET CMP0077 NEW)
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif (POLICY CMP0077)
project(absl CXX)
......
......@@ -4,7 +4,7 @@ URL: https://github.com/abseil/abseil-cpp
License: Apache 2.0
License File: LICENSE
Version: 0
Revision: f624790b7f76ab92fed5ae966abb99a0d455c96f
Revision: 41a6263fd0bcc93a90ff739785f17260f8ea061e
Security Critical: yes
Description:
......
......@@ -154,6 +154,12 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#define ABSL_INTERNAL_HAS_KEYWORD(x) 0
#endif
#ifdef __has_feature
#define ABSL_HAVE_FEATURE(f) __has_feature(f)
#else
#define ABSL_HAVE_FEATURE(f) 0
#endif
// ABSL_HAVE_TLS is defined to 1 when __thread should be supported.
// We assume __thread is supported on Linux when compiled with Clang or compiled
// against libstdc++ with _GLIBCXX_HAVE_TLS defined.
......@@ -226,11 +232,9 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// * Xcode 9.3 started disallowing `thread_local` for 32-bit iOS simulator
// targeting iOS 9.x.
// * Xcode 10 moves the deployment target check for iOS < 9.0 to link time
// making __has_feature unreliable there.
// making ABSL_HAVE_FEATURE unreliable there.
//
// Otherwise, `__has_feature` is only supported by Clang so it has be inside
// `defined(__APPLE__)` check.
#if __has_feature(cxx_thread_local) && \
#if ABSL_HAVE_FEATURE(cxx_thread_local) && \
!(TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0)
#define ABSL_HAVE_THREAD_LOCAL 1
#endif
......@@ -312,15 +316,15 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 6)
// Clang >= 3.6
#if __has_feature(cxx_exceptions)
#if ABSL_HAVE_FEATURE(cxx_exceptions)
#define ABSL_HAVE_EXCEPTIONS 1
#endif // __has_feature(cxx_exceptions)
#endif // ABSL_HAVE_FEATURE(cxx_exceptions)
#else
// Clang < 3.6
// http://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html#the-exceptions-macro
#if defined(__EXCEPTIONS) && __has_feature(cxx_exceptions)
#if defined(__EXCEPTIONS) && ABSL_HAVE_FEATURE(cxx_exceptions)
#define ABSL_HAVE_EXCEPTIONS 1
#endif // defined(__EXCEPTIONS) && __has_feature(cxx_exceptions)
#endif // defined(__EXCEPTIONS) && ABSL_HAVE_FEATURE(cxx_exceptions)
#endif // __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 6)
// Handle remaining special cases and default to exceptions being supported.
......@@ -661,4 +665,50 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#define ABSL_DLL
#endif // defined(_MSC_VER)
// ABSL_HAVE_MEMORY_SANITIZER
//
// MemorySanitizer (MSan) is a detector of uninitialized reads. It consists of
// a compiler instrumentation module and a run-time library.
#ifdef ABSL_HAVE_MEMORY_SANITIZER
#error "ABSL_HAVE_MEMORY_SANITIZER cannot be directly set."
#elif defined(MEMORY_SANITIZER)
// The MEMORY_SANITIZER macro is deprecated but we will continue to honor it
// for now.
#define ABSL_HAVE_MEMORY_SANITIZER 1
#elif defined(__SANITIZE_MEMORY__)
#define ABSL_HAVE_MEMORY_SANITIZER 1
#elif !defined(__native_client__) && ABSL_HAVE_FEATURE(memory_sanitizer)
#define ABSL_HAVE_MEMORY_SANITIZER 1
#endif
// ABSL_HAVE_THREAD_SANITIZER
//
// ThreadSanitizer (TSan) is a fast data race detector.
#ifdef ABSL_HAVE_THREAD_SANITIZER
#error "ABSL_HAVE_THREAD_SANITIZER cannot be directly set."
#elif defined(THREAD_SANITIZER)
// The THREAD_SANITIZER macro is deprecated but we will continue to honor it
// for now.
#define ABSL_HAVE_THREAD_SANITIZER 1
#elif defined(__SANITIZE_THREAD__)
#define ABSL_HAVE_THREAD_SANITIZER 1
#elif ABSL_HAVE_FEATURE(thread_sanitizer)
#define ABSL_HAVE_THREAD_SANITIZER 1
#endif
// ABSL_HAVE_ADDRESS_SANITIZER
//
// AddressSanitizer (ASan) is a fast memory error detector.
#ifdef ABSL_HAVE_ADDRESS_SANITIZER
#error "ABSL_HAVE_ADDRESS_SANITIZER cannot be directly set."
#elif defined(ADDRESS_SANITIZER)
// The ADDRESS_SANITIZER macro is deprecated but we will continue to honor it
// for now.
#define ABSL_HAVE_ADDRESS_SANITIZER 1
#elif defined(__SANITIZE_ADDRESS__)
#define ABSL_HAVE_ADDRESS_SANITIZER 1
#elif ABSL_HAVE_FEATURE(address_sanitizer)
#define ABSL_HAVE_ADDRESS_SANITIZER 1
#endif
#endif // ABSL_BASE_CONFIG_H_
......@@ -18,14 +18,14 @@
#include "absl/base/dynamic_annotations.h"
// Compiler-based ThreadSanitizer defines
// ABSL_DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL = 1
// DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL = 1
// and provides its own definitions of the functions.
#ifndef ABSL_DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL
# define ABSL_DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL 0
#ifndef DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL
# define DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL 0
#endif
#if ABSL_DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 && !defined(__native_client__)
#if DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 && !defined(__native_client__)
extern "C" {
......@@ -69,4 +69,4 @@ double AbslValgrindSlowdown(void) {
}
} // extern "C"
#endif // ABSL_DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0
#endif // DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0
......@@ -50,19 +50,9 @@
#include "absl/base/config.h"
// -------------------------------------------------------------------------
// Decide which features are enabled
// Decide which features are enabled.
#ifndef ABSL_DYNAMIC_ANNOTATIONS_ENABLED
#define ABSL_DYNAMIC_ANNOTATIONS_ENABLED 0
#endif
#if defined(__clang__) && !defined(SWIG)
#define ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 1
#else
#define ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 0
#endif
#if ABSL_DYNAMIC_ANNOTATIONS_ENABLED != 0
#ifdef ABSL_HAVE_THREAD_SANITIZER
#define ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 1
#define ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 1
......@@ -82,24 +72,21 @@
// will issue a warning, if these attributes are compiled. Only include them
// when compiling using Clang.
// ABSL_ANNOTALYSIS_ENABLED == 1 when IGNORE_READ_ATTRIBUTE_ENABLED == 1
#define ABSL_INTERNAL_ANNOTALYSIS_ENABLED \
ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED
// Read/write annotations are enabled in Annotalysis mode; disabled otherwise.
#define ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED \
ABSL_INTERNAL_ANNOTALYSIS_ENABLED
#endif
// Memory annotations are also made available to LLVM's Memory Sanitizer
#if defined(MEMORY_SANITIZER) && defined(__has_feature) && \
!defined(__native_client__)
#if __has_feature(memory_sanitizer)
#define ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED 1
#if defined(__clang__)
#define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 1
#if !defined(SWIG)
#define ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 1
#else
#define ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 0
#endif
#else
#define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0
#define ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 0
#endif
#ifndef ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED
#define ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED 0
// Read/write annotations are enabled in Annotalysis mode; disabled otherwise.
#define ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED \
ABSL_INTERNAL_ANNOTALYSIS_ENABLED
#endif
#ifdef __cplusplus
......@@ -129,20 +116,20 @@
// point where `pointer` has been allocated, preferably close to the point
// where the race happens. See also ABSL_ANNOTATE_BENIGN_RACE_STATIC.
#define ABSL_ANNOTATE_BENIGN_RACE(pointer, description) \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateBenignRaceSized) \
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \
(__FILE__, __LINE__, pointer, sizeof(*(pointer)), description)
// Same as ABSL_ANNOTATE_BENIGN_RACE(`address`, `description`), but applies to
// the memory range [`address`, `address`+`size`).
#define ABSL_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateBenignRaceSized) \
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \
(__FILE__, __LINE__, address, size, description)
// Enable (`enable`!=0) or disable (`enable`==0) race detection for all threads.
// This annotation could be useful if you want to skip expensive race analysis
// during some period of program execution, e.g. during initialization.
#define ABSL_ANNOTATE_ENABLE_RACE_DETECTION(enable) \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateEnableRaceDetection) \
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateEnableRaceDetection) \
(__FILE__, __LINE__, enable)
// -------------------------------------------------------------
......@@ -150,7 +137,7 @@
// Report the current thread `name` to a race detector.
#define ABSL_ANNOTATE_THREAD_NAME(name) \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateThreadName)(__FILE__, __LINE__, name)
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateThreadName)(__FILE__, __LINE__, name)
// -------------------------------------------------------------
// Annotations useful when implementing locks. They are not normally needed by
......@@ -159,12 +146,12 @@
// Report that a lock has been created at address `lock`.
#define ABSL_ANNOTATE_RWLOCK_CREATE(lock) \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateRWLockCreate)(__FILE__, __LINE__, lock)
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreate)(__FILE__, __LINE__, lock)
// Report that a linker initialized lock has been created at address `lock`.
#ifdef THREAD_SANITIZER
#define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateRWLockCreateStatic) \
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreateStatic) \
(__FILE__, __LINE__, lock)
#else
#define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) \
......@@ -173,18 +160,18 @@
// Report that the lock at address `lock` is about to be destroyed.
#define ABSL_ANNOTATE_RWLOCK_DESTROY(lock) \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateRWLockDestroy)(__FILE__, __LINE__, lock)
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockDestroy)(__FILE__, __LINE__, lock)
// Report that the lock at address `lock` has been acquired.
// `is_w`=1 for writer lock, `is_w`=0 for reader lock.
#define ABSL_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateRWLockAcquired) \
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockAcquired) \
(__FILE__, __LINE__, lock, is_w)
// Report that the lock at address `lock` is about to be released.
// `is_w`=1 for writer lock, `is_w`=0 for reader lock.
#define ABSL_ANNOTATE_RWLOCK_RELEASED(lock, is_w) \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateRWLockReleased) \
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockReleased) \
(__FILE__, __LINE__, lock, is_w)
// Apply ABSL_ANNOTATE_BENIGN_RACE_SIZED to a static variable `static_var`.
......@@ -203,23 +190,23 @@
// Function prototypes of annotations provided by the compiler-based sanitizer
// implementation.
ABSL_INTERNAL_BEGIN_EXTERN_C
void AbslAnnotateRWLockCreate(const char* file, int line,
void AnnotateRWLockCreate(const char* file, int line,
const volatile void* lock);
void AbslAnnotateRWLockCreateStatic(const char* file, int line,
void AnnotateRWLockCreateStatic(const char* file, int line,
const volatile void* lock);
void AbslAnnotateRWLockDestroy(const char* file, int line,
void AnnotateRWLockDestroy(const char* file, int line,
const volatile void* lock);
void AbslAnnotateRWLockAcquired(const char* file, int line,
void AnnotateRWLockAcquired(const char* file, int line,
const volatile void* lock, long is_w); // NOLINT
void AbslAnnotateRWLockReleased(const char* file, int line,
void AnnotateRWLockReleased(const char* file, int line,
const volatile void* lock, long is_w); // NOLINT
void AbslAnnotateBenignRace(const char* file, int line,
void AnnotateBenignRace(const char* file, int line,
const volatile void* address, const char* description);
void AbslAnnotateBenignRaceSized(const char* file, int line,
void AnnotateBenignRaceSized(const char* file, int line,
const volatile void* address, size_t size,
const char* description);
void AbslAnnotateThreadName(const char* file, int line, const char* name);
void AbslAnnotateEnableRaceDetection(const char* file, int line, int enable);
void AnnotateThreadName(const char* file, int line, const char* name);
void AnnotateEnableRaceDetection(const char* file, int line, int enable);
ABSL_INTERNAL_END_EXTERN_C
#else // ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 0
......@@ -240,7 +227,7 @@ ABSL_INTERNAL_END_EXTERN_C
// -------------------------------------------------------------------------
// Define memory annotations.
#if ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED == 1
#ifdef ABSL_HAVE_MEMORY_SANITIZER
#include <sanitizer/msan_interface.h>
......@@ -250,9 +237,10 @@ ABSL_INTERNAL_END_EXTERN_C
#define ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \
__msan_allocated_memory(address, size)
#else // ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED == 0
#else // !defined(ABSL_HAVE_MEMORY_SANITIZER)
#if ABSL_DYNAMIC_ANNOTATIONS_ENABLED == 1
// TODO(rogeeff): remove this branch
#ifdef ABSL_HAVE_THREAD_SANITIZER
#define ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \
do { \
(void)(address); \
......@@ -270,7 +258,7 @@ ABSL_INTERNAL_END_EXTERN_C
#endif
#endif // ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED
#endif // ABSL_HAVE_MEMORY_SANITIZER
// -------------------------------------------------------------------------
// Define IGNORE_READS_BEGIN/_END attributes.
......@@ -299,18 +287,18 @@ ABSL_INTERNAL_END_EXTERN_C
// reads, while still checking other reads and all writes.
// See also ABSL_ANNOTATE_UNPROTECTED_READ.
#define ABSL_ANNOTATE_IGNORE_READS_BEGIN() \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateIgnoreReadsBegin)(__FILE__, __LINE__)
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsBegin)(__FILE__, __LINE__)
// Stop ignoring reads.
#define ABSL_ANNOTATE_IGNORE_READS_END() \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateIgnoreReadsEnd)(__FILE__, __LINE__)
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsEnd)(__FILE__, __LINE__)
// Function prototypes of annotations provided by the compiler-based sanitizer
// implementation.
ABSL_INTERNAL_BEGIN_EXTERN_C
void AbslAnnotateIgnoreReadsBegin(const char* file, int line)
void AnnotateIgnoreReadsBegin(const char* file, int line)
ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE;
void AbslAnnotateIgnoreReadsEnd(const char* file,
void AnnotateIgnoreReadsEnd(const char* file,
int line) ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE;
ABSL_INTERNAL_END_EXTERN_C
......@@ -349,17 +337,17 @@ ABSL_INTERNAL_STATIC_INLINE void AbslInternalAnnotateIgnoreReadsEnd()
// Similar to ABSL_ANNOTATE_IGNORE_READS_BEGIN, but ignore writes instead.
#define ABSL_ANNOTATE_IGNORE_WRITES_BEGIN() \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateIgnoreWritesBegin)(__FILE__, __LINE__)
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesBegin)(__FILE__, __LINE__)
// Stop ignoring writes.
#define ABSL_ANNOTATE_IGNORE_WRITES_END() \
ABSL_INTERNAL_GLOBAL_SCOPED(AbslAnnotateIgnoreWritesEnd)(__FILE__, __LINE__)
ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesEnd)(__FILE__, __LINE__)
// Function prototypes of annotations provided by the compiler-based sanitizer
// implementation.
ABSL_INTERNAL_BEGIN_EXTERN_C
void AbslAnnotateIgnoreWritesBegin(const char* file, int line);
void AbslAnnotateIgnoreWritesEnd(const char* file, int line);
void AnnotateIgnoreWritesBegin(const char* file, int line);
void AnnotateIgnoreWritesEnd(const char* file, int line);
ABSL_INTERNAL_END_EXTERN_C
#else
......@@ -465,7 +453,7 @@ ABSL_INTERNAL_END_EXTERN_C
// -------------------------------------------------------------------------
// Address sanitizer annotations
#ifdef ADDRESS_SANITIZER
#ifdef ABSL_HAVE_ADDRESS_SANITIZER
// Describe the current state of a contiguous container such as e.g.
// std::vector or std::string. For more details see
// sanitizer/common_interface_defs.h, which is provided by the compiler.
......@@ -480,16 +468,15 @@ ABSL_INTERNAL_END_EXTERN_C
#else
#define ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid)
#define ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) // empty
#define ABSL_ADDRESS_SANITIZER_REDZONE(name) static_assert(true, "")
#endif // ADDRESS_SANITIZER
#endif // ABSL_HAVE_ADDRESS_SANITIZER
// -------------------------------------------------------------------------
// Undefine the macros intended only for this file.
#undef ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED
#undef ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED
#undef ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED
#undef ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED
#undef ABSL_INTERNAL_ANNOTALYSIS_ENABLED
......
......@@ -41,7 +41,7 @@
#endif
// -----------------------------------------------------------------------------
// Compiler Check
// Toolchain Check
// -----------------------------------------------------------------------------
// We support MSVC++ 14.0 update 2 and later.
......
......@@ -307,7 +307,7 @@
// Disables warnings for a single read operation. This can be used to avoid
// warnings when it is known that the read is not actually involved in a race,
// but the compiler cannot confirm that.
#define ABSL_TS_UNCHECKED_READ(x) absl::base_internal::absl_ts_unchecked_read(x)
#define ABSL_TS_UNCHECKED_READ(x) absl::base_internal::ts_unchecked_read(x)
namespace absl {
ABSL_NAMESPACE_BEGIN
......@@ -317,12 +317,12 @@ namespace base_internal {
// reference.
// Do not used this function directly, use ABSL_TS_UNCHECKED_READ instead.
template <typename T>
inline const T& absl_ts_unchecked_read(const T& v) ABSL_NO_THREAD_SAFETY_ANALYSIS {
inline const T& ts_unchecked_read(const T& v) ABSL_NO_THREAD_SAFETY_ANALYSIS {
return v;
}
template <typename T>
inline T& absl_ts_unchecked_read(T& v) ABSL_NO_THREAD_SAFETY_ANALYSIS {
inline T& ts_unchecked_read(T& v) ABSL_NO_THREAD_SAFETY_ANALYSIS {
return v;
}
......
......@@ -2509,6 +2509,39 @@ TEST(Btree,
EXPECT_THAT(m2,
ElementsAre(Pair(IsEmpty(), 1), Pair(ElementsAre(IsNull()), 2)));
}
TEST(Btree, HeterogeneousTryEmplace) {
absl::btree_map<std::string, int> m;
std::string s = "key";
absl::string_view sv = s;
m.try_emplace(sv, 1);
EXPECT_EQ(m[s], 1);
m.try_emplace(m.end(), sv, 2);
EXPECT_EQ(m[s], 1);
}
TEST(Btree, HeterogeneousOperatorMapped) {
absl::btree_map<std::string, int> m;
std::string s = "key";
absl::string_view sv = s;
m[sv] = 1;
EXPECT_EQ(m[s], 1);
m[sv] = 2;
EXPECT_EQ(m[s], 2);
}
TEST(Btree, HeterogeneousInsertOrAssign) {
absl::btree_map<std::string, int> m;
std::string s = "key";
absl::string_view sv = s;
m.insert_or_assign(sv, 1);
EXPECT_EQ(m[s], 1);
m.insert_or_assign(m.end(), sv, 2);
EXPECT_EQ(m[s], 2);
}
#endif
} // namespace
......
......@@ -268,23 +268,21 @@ class btree_set_container : public btree_container<Tree> {
init_type v(std::forward<Args>(args)...);
return this->tree_.insert_unique(params_type::key(v), std::move(v));
}
iterator insert(const_iterator position, const value_type &v) {
iterator insert(const_iterator hint, const value_type &v) {
return this->tree_
.insert_hint_unique(iterator(position), params_type::key(v), v)
.insert_hint_unique(iterator(hint), params_type::key(v), v)
.first;
}
iterator insert(const_iterator position, value_type &&v) {
iterator insert(const_iterator hint, value_type &&v) {
return this->tree_
.insert_hint_unique(iterator(position), params_type::key(v),
std::move(v))
.insert_hint_unique(iterator(hint), params_type::key(v), std::move(v))
.first;
}
template <typename... Args>
iterator emplace_hint(const_iterator position, Args &&... args) {
iterator emplace_hint(const_iterator hint, Args &&... args) {
init_type v(std::forward<Args>(args)...);
return this->tree_
.insert_hint_unique(iterator(position), params_type::key(v),
std::move(v))
.insert_hint_unique(iterator(hint), params_type::key(v), std::move(v))
.first;
}
template <typename InputIterator>
......@@ -392,111 +390,72 @@ class btree_map_container : public btree_set_container<Tree> {
// Insertion routines.
// Note: the nullptr template arguments and extra `const M&` overloads allow
// for supporting bitfield arguments.
// Note: when we call `std::forward<M>(obj)` twice, it's safe because
// insert_unique/insert_hint_unique are guaranteed to not consume `obj` when
// `ret.second` is false.
template <class M>
std::pair<iterator, bool> insert_or_assign(const key_type &k, const M &obj) {
const std::pair<iterator, bool> ret = this->tree_.insert_unique(k, k, obj);
if (!ret.second) ret.first->second = obj;
return ret;
template <typename K = key_type, class M>
std::pair<iterator, bool> insert_or_assign(const key_arg<K> &k,
const M &obj) {
return insert_or_assign_impl(k, obj);
}
template <class M, key_type * = nullptr>
std::pair<iterator, bool> insert_or_assign(key_type &&k, const M &obj) {
const std::pair<iterator, bool> ret =
this->tree_.insert_unique(k, std::move(k), obj);
if (!ret.second) ret.first->second = obj;
return ret;
template <typename K = key_type, class M, K * = nullptr>
std::pair<iterator, bool> insert_or_assign(key_arg<K> &&k, const M &obj) {
return insert_or_assign_impl(std::forward<K>(k), obj);
}
template <class M, M * = nullptr>
std::pair<iterator, bool> insert_or_assign(const key_type &k, M &&obj) {
const std::pair<iterator, bool> ret =
this->tree_.insert_unique(k, k, std::forward<M>(obj));
if (!ret.second) ret.first->second = std::forward<M>(obj);
return ret;
template <typename K = key_type, class M, M * = nullptr>
std::pair<iterator, bool> insert_or_assign(const key_arg<K> &k, M &&obj) {
return insert_or_assign_impl(k, std::forward<M>(obj));
}
template <class M, key_type * = nullptr, M * = nullptr>
std::pair<iterator, bool> insert_or_assign(key_type &&k, M &&obj) {
const std::pair<iterator, bool> ret =
this->tree_.insert_unique(k, std::move(k), std::forward<M>(obj));
if (!ret.second) ret.first->second = std::forward<M>(obj);
return ret;
template <typename K = key_type, class M, K * = nullptr, M * = nullptr>
std::pair<iterator, bool> insert_or_assign(key_arg<K> &&k, M &&obj) {
return insert_or_assign_impl(std::forward<K>(k), std::forward<M>(obj));
}
template <class M>
iterator insert_or_assign(const_iterator position, const key_type &k,
template <typename K = key_type, class M>
iterator insert_or_assign(const_iterator hint, const key_arg<K> &k,
const M &obj) {
const std::pair<iterator, bool> ret =
this->tree_.insert_hint_unique(iterator(position), k, k, obj);
if (!ret.second) ret.first->second = obj;
return ret.first;
return insert_or_assign_hint_impl(hint, k, obj);
}
template <class M, key_type * = nullptr>
iterator insert_or_assign(const_iterator position, key_type &&k,
const M &obj) {
const std::pair<iterator, bool> ret = this->tree_.insert_hint_unique(
iterator(position), k, std::move(k), obj);
if (!ret.second) ret.first->second = obj;
return ret.first;
template <typename K = key_type, class M, K * = nullptr>
iterator insert_or_assign(const_iterator hint, key_arg<K> &&k, const M &obj) {
return insert_or_assign_hint_impl(hint, std::forward<K>(k), obj);
}
template <class M, M * = nullptr>
iterator insert_or_assign(const_iterator position, const key_type &k,
M &&obj) {
const std::pair<iterator, bool> ret = this->tree_.insert_hint_unique(
iterator(position), k, k, std::forward<M>(obj));
if (!ret.second) ret.first->second = std::forward<M>(obj);
return ret.first;
template <typename K = key_type, class M, M * = nullptr>
iterator insert_or_assign(const_iterator hint, const key_arg<K> &k, M &&obj) {
return insert_or_assign_hint_impl(hint, k, std::forward<M>(obj));
}
template <class M, key_type * = nullptr, M * = nullptr>
iterator insert_or_assign(const_iterator position, key_type &&k, M &&obj) {
const std::pair<iterator, bool> ret = this->tree_.insert_hint_unique(
iterator(position), k, std::move(k), std::forward<M>(obj));
if (!ret.second) ret.first->second = std::forward<M>(obj);
return ret.first;
template <typename K = key_type, class M, K * = nullptr, M * = nullptr>
iterator insert_or_assign(const_iterator hint, key_arg<K> &&k, M &&obj) {
return insert_or_assign_hint_impl(hint, std::forward<K>(k),
std::forward<M>(obj));
}
template <typename... Args>
std::pair<iterator, bool> try_emplace(const key_type &k, Args &&... args) {
return this->tree_.insert_unique(
k, std::piecewise_construct, std::forward_as_tuple(k),
std::forward_as_tuple(std::forward<Args>(args)...));
template <typename K = key_type, typename... Args,
typename absl::enable_if_t<
!std::is_convertible<K, const_iterator>::value, int> = 0>
std::pair<iterator, bool> try_emplace(const key_arg<K> &k, Args &&... args) {
return try_emplace_impl(k, std::forward<Args>(args)...);
}
template <typename... Args>
std::pair<iterator, bool> try_emplace(key_type &&k, Args &&... args) {
// Note: `key_ref` exists to avoid a ClangTidy warning about moving from `k`
// and then using `k` unsequenced. This is safe because the move is into a
// forwarding reference and insert_unique guarantees that `key` is never
// referenced after consuming `args`.
const key_type &key_ref = k;
return this->tree_.insert_unique(
key_ref, std::piecewise_construct, std::forward_as_tuple(std::move(k)),
std::forward_as_tuple(std::forward<Args>(args)...));
template <typename K = key_type, typename... Args,
typename absl::enable_if_t<
!std::is_convertible<K, const_iterator>::value, int> = 0>
std::pair<iterator, bool> try_emplace(key_arg<K> &&k, Args &&... args) {
return try_emplace_impl(std::forward<K>(k), std::forward<Args>(args)...);
}
template <typename... Args>
iterator try_emplace(const_iterator hint, const key_type &k,
template <typename K = key_type, typename... Args>
iterator try_emplace(const_iterator hint, const key_arg<K> &k,
Args &&... args) {
return this->tree_
.insert_hint_unique(iterator(hint), k, std::piecewise_construct,
std::forward_as_tuple(k),
std::forward_as_tuple(std::forward<Args>(args)...))
.first;
return try_emplace_hint_impl(hint, k, std::forward<Args>(args)...);
}
template <typename... Args>
iterator try_emplace(const_iterator hint, key_type &&k, Args &&... args) {
// Note: `key_ref` exists to avoid a ClangTidy warning about moving from `k`
// and then using `k` unsequenced. This is safe because the move is into a
// forwarding reference and insert_hint_unique guarantees that `key` is
// never referenced after consuming `args`.
const key_type &key_ref = k;
return this->tree_
.insert_hint_unique(iterator(hint), key_ref, std::piecewise_construct,
std::forward_as_tuple(std::move(k)),
std::forward_as_tuple(std::forward<Args>(args)...))
.first;
template <typename K = key_type, typename... Args>
iterator try_emplace(const_iterator hint, key_arg<K> &&k, Args &&... args) {
return try_emplace_hint_impl(hint, std::forward<K>(k),
std::forward<Args>(args)...);
}
mapped_type &operator[](const key_type &k) {
template <typename K = key_type>
mapped_type &operator[](const key_arg<K> &k) {
return try_emplace(k).first->second;
}
mapped_type &operator[](key_type &&k) {
return try_emplace(std::move(k)).first->second;
template <typename K = key_type>
mapped_type &operator[](key_arg<K> &&k) {
return try_emplace(std::forward<K>(k)).first->second;
}
template <typename K = key_type>
......@@ -513,6 +472,40 @@ class btree_map_container : public btree_set_container<Tree> {
base_internal::ThrowStdOutOfRange("absl::btree_map::at");
return it->second;
}
private:
// Note: when we call `std::forward<M>(obj)` twice, it's safe because
// insert_unique/insert_hint_unique are guaranteed to not consume `obj` when
// `ret.second` is false.
template <class K, class M>
std::pair<iterator, bool> insert_or_assign_impl(K &&k, M &&obj) {
const std::pair<iterator, bool> ret =
this->tree_.insert_unique(k, std::forward<K>(k), std::forward<M>(obj));
if (!ret.second) ret.first->second = std::forward<M>(obj);
return ret;
}
template <class K, class M>
iterator insert_or_assign_hint_impl(const_iterator hint, K &&k, M &&obj) {
const std::pair<iterator, bool> ret = this->tree_.insert_hint_unique(
iterator(hint), k, std::forward<K>(k), std::forward<M>(obj));
if (!ret.second) ret.first->second = std::forward<M>(obj);
return ret.first;
}
template <class K, class... Args>
std::pair<iterator, bool> try_emplace_impl(K &&k, Args &&... args) {
return this->tree_.insert_unique(
k, std::piecewise_construct, std::forward_as_tuple(std::forward<K>(k)),
std::forward_as_tuple(std::forward<Args>(args)...));
}
template <class K, class... Args>
iterator try_emplace_hint_impl(const_iterator hint, K &&k, Args &&... args) {
return this->tree_
.insert_hint_unique(iterator(hint), k, std::piecewise_construct,
std::forward_as_tuple(std::forward<K>(k)),
std::forward_as_tuple(std::forward<Args>(args)...))
.first;
}
};
// A common base class for btree_multiset and btree_multimap.
......@@ -566,11 +559,11 @@ class btree_multiset_container : public btree_container<Tree> {
iterator insert(value_type &&v) {
return this->tree_.insert_multi(std::move(v));
}
iterator insert(const_iterator position, const value_type &v) {
return this->tree_.insert_hint_multi(iterator(position), v);
iterator insert(const_iterator hint, const value_type &v) {
return this->tree_.insert_hint_multi(iterator(hint), v);
}
iterator insert(const_iterator position, value_type &&v) {
return this->tree_.insert_hint_multi(iterator(position), std::move(v));
iterator insert(const_iterator hint, value_type &&v) {
return this->tree_.insert_hint_multi(iterator(hint), std::move(v));
}
template <typename InputIterator>
void insert(InputIterator b, InputIterator e) {
......@@ -584,9 +577,9 @@ class btree_multiset_container : public btree_container<Tree> {
return this->tree_.insert_multi(init_type(std::forward<Args>(args)...));
}
template <typename... Args>
iterator emplace_hint(const_iterator position, Args &&... args) {
iterator emplace_hint(const_iterator hint, Args &&... args) {
return this->tree_.insert_hint_multi(
iterator(position), init_type(std::forward<Args>(args)...));
iterator(hint), init_type(std::forward<Args>(args)...));
}
iterator insert(node_type &&node) {
if (!node) return this->end();
......
......@@ -81,6 +81,7 @@ list(APPEND ABSL_GCC_FLAGS
"-Wmissing-declarations"
"-Woverlength-strings"
"-Wpointer-arith"
"-Wundef"
"-Wunused-local-typedefs"
"-Wunused-result"
"-Wvarargs"
......
......@@ -82,6 +82,7 @@ ABSL_GCC_FLAGS = [
"-Wmissing-declarations",
"-Woverlength-strings",
"-Wpointer-arith",
"-Wundef",
"-Wunused-local-typedefs",
"-Wunused-result",
"-Wvarargs",
......
......@@ -128,6 +128,7 @@ COPT_VARS = {
"-Wmissing-declarations",
"-Woverlength-strings",
"-Wpointer-arith",
"-Wundef",
"-Wunused-local-typedefs",
"-Wunused-result",
"-Wvarargs",
......
......@@ -17,6 +17,7 @@
#include "absl/memory/memory.h"
#include <sys/types.h>
#include <cstddef>
#include <memory>
#include <string>
......@@ -36,10 +37,10 @@ using ::testing::Return;
// been called, via the instance_count variable.
class DestructorVerifier {
public:
DestructorVerifier() { ++instance_count_; }
DestructorVerifier() { ++instance_count_; }
DestructorVerifier(const DestructorVerifier&) = delete;
DestructorVerifier& operator=(const DestructorVerifier&) = delete;
~DestructorVerifier() { --instance_count_; }
~DestructorVerifier() { --instance_count_; }
// The number of instances of this class currently active.
static int instance_count() { return instance_count_; }
......@@ -156,9 +157,7 @@ struct ArrayWatch {
allocs().push_back(n);
return ::operator new[](n);
}
void operator delete[](void* p) {
return ::operator delete[](p);
}
void operator delete[](void* p) { return ::operator delete[](p); }
static std::vector<size_t>& allocs() {
static auto& v = *new std::vector<size_t>;
return v;
......@@ -171,8 +170,7 @@ TEST(Make_UniqueTest, Array) {
ArrayWatch::allocs().clear();
auto p = absl::make_unique<ArrayWatch[]>(5);
static_assert(std::is_same<decltype(p),
std::unique_ptr<ArrayWatch[]>>::value,
static_assert(std::is_same<decltype(p), std::unique_ptr<ArrayWatch[]>>::value,
"unexpected return type");
EXPECT_THAT(ArrayWatch::allocs(), ElementsAre(5 * sizeof(ArrayWatch)));
}
......@@ -181,7 +179,7 @@ TEST(Make_UniqueTest, NotAmbiguousWithStdMakeUnique) {
// Ensure that absl::make_unique is not ambiguous with std::make_unique.
// In C++14 mode, the below call to make_unique has both types as candidates.
struct TakesStdType {
explicit TakesStdType(const std::vector<int> &vec) {}
explicit TakesStdType(const std::vector<int>& vec) {}
};
using absl::make_unique;
(void)make_unique<TakesStdType>(std::vector<int>());
......@@ -541,8 +539,8 @@ struct MinimalMockAllocator {
MinimalMockAllocator(const MinimalMockAllocator& other)
: value(other.value) {}
using value_type = TestValue;
MOCK_METHOD1(allocate, value_type*(size_t));
MOCK_METHOD2(deallocate, void(value_type*, size_t));
MOCK_METHOD(value_type*, allocate, (size_t));
MOCK_METHOD(void, deallocate, (value_type*, size_t));
int value;
};
......@@ -579,13 +577,14 @@ struct FullMockAllocator {
explicit FullMockAllocator(int value) : value(value) {}
FullMockAllocator(const FullMockAllocator& other) : value(other.value) {}
using value_type = TestValue;
MOCK_METHOD1(allocate, value_type*(size_t));
MOCK_METHOD2(allocate, value_type*(size_t, const void*));
MOCK_METHOD2(construct, void(value_type*, int*));
MOCK_METHOD1(destroy, void(value_type*));
MOCK_CONST_METHOD0(max_size, size_t());
MOCK_CONST_METHOD0(select_on_container_copy_construction,
FullMockAllocator());
MOCK_METHOD(value_type*, allocate, (size_t));
MOCK_METHOD(value_type*, allocate, (size_t, const void*));
MOCK_METHOD(void, construct, (value_type*, int*));
MOCK_METHOD(void, destroy, (value_type*));
MOCK_METHOD(size_t, max_size, (),
(const));
MOCK_METHOD(FullMockAllocator, select_on_container_copy_construction, (),
(const));
int value;
};
......@@ -642,8 +641,7 @@ TEST(AllocatorNoThrowTest, CustomAllocator) {
struct CanThrowAllocator {
using is_nothrow = std::false_type;
};
struct UnspecifiedAllocator {
};
struct UnspecifiedAllocator {};
EXPECT_TRUE(absl::allocator_is_nothrow<NoThrowAllocator>::value);
EXPECT_FALSE(absl::allocator_is_nothrow<CanThrowAllocator>::value);
EXPECT_FALSE(absl::allocator_is_nothrow<UnspecifiedAllocator>::value);
......
......@@ -150,6 +150,7 @@ struct alignas(16) u64x2 {
#include <altivec.h>
// <altivec.h> #defines vector __vector; in C++, this is bad form.
#undef vector
#undef bool
// Rely on the PowerPC AltiVec vector operations for accelerated AES
// instructions. GCC support of the PPC vector types is described in:
......
#!/bin/bash
# This script renames all the functions and the macros defined in
# absl/base/dynamic_annotations.{h,cc} and absl/base/thread_annotations.h.
# absl/base/dynamic_annotations.{h,cc}.
#
# Chromium's dynamic_annotations live in //base/third_party/dynamic_annotations
# and its //base contains a copy of thread_annotations.h which conflict with
# Abseil's versions (ODR violations and macro clashing).
# which conflict with Abseil's versions (ODR violations).
# In order to avoid problems in Chromium, this copy of Abseil has its own
# dynamic_annotations and thread_annotations renamed.
# dynamic_annotations renamed.
# -------------------------- dynamic_annotations -------------------------
for w in \
AnnotateBarrierDestroy \
AnnotateBarrierInit \
AnnotateBarrierWaitAfter \
AnnotateBarrierWaitBefore \
AnnotateBenignRace \
AnnotateBenignRaceSized \
AnnotateCondVarSignal \
AnnotateCondVarSignalAll \
AnnotateCondVarWait \
AnnotateEnableRaceDetection \
AnnotateExpectRace \
AnnotateFlushExpectedRaces \
AnnotateFlushState \
AnnotateHappensAfter \
AnnotateHappensBefore \
AnnotateIgnoreReadsBegin \
AnnotateIgnoreReadsEnd \
AnnotateIgnoreSyncBegin \
AnnotateIgnoreSyncEnd \
AnnotateIgnoreWritesBegin \
AnnotateIgnoreWritesEnd \
AnnotateMemoryIsInitialized \
AnnotateMemoryIsUninitialized \
AnnotateMutexIsNotPHB \
AnnotateMutexIsUsedAsCondVar \
AnnotateNewMemory \
AnnotateNoOp \
AnnotatePCQCreate \
AnnotatePCQDestroy \
AnnotatePCQGet \
AnnotatePCQPut \
AnnotatePublishMemoryRange \
AnnotateRWLockAcquired \
AnnotateRWLockCreate \
AnnotateRWLockCreateStatic \
AnnotateRWLockDestroy \
AnnotateRWLockReleased \
AnnotateThreadName \
AnnotateTraceMemory \
AnnotateUnpublishMemoryRange \
GetRunningOnValgrind \
RunningOnValgrind \
StaticAnnotateIgnoreReadsBegin \
StaticAnnotateIgnoreReadsEnd \
StaticAnnotateIgnoreWritesBegin \
StaticAnnotateIgnoreWritesEnd \
ValgrindSlowdown \
; do
find absl/ -type f -exec sed -i "s/\b$w\b/Absl$w/g" {} \;
done
for w in \
ADDRESS_SANITIZER_REDZONE \
ANNOTALYSIS_ENABLED \
ANNOTATE_BARRIER_DESTROY \
ANNOTATE_BARRIER_INIT \
ANNOTATE_BARRIER_WAIT_AFTER \
ANNOTATE_BARRIER_WAIT_BEFORE \
ANNOTATE_BENIGN_RACE \
ANNOTATE_BENIGN_RACE_SIZED \
ANNOTATE_BENIGN_RACE_STATIC \
ANNOTATE_CONDVAR_LOCK_WAIT \
ANNOTATE_CONDVAR_SIGNAL \
ANNOTATE_CONDVAR_SIGNAL_ALL \
ANNOTATE_CONDVAR_WAIT \
ANNOTATE_CONTIGUOUS_CONTAINER \
ANNOTATE_ENABLE_RACE_DETECTION \
ANNOTATE_EXPECT_RACE \
ANNOTATE_FLUSH_EXPECTED_RACES \
ANNOTATE_FLUSH_STATE \
ANNOTATE_HAPPENS_AFTER \
ANNOTATE_HAPPENS_BEFORE \
ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN ANNOTATE_IGNORE_READS_AND_WRITES_END \
ANNOTATE_IGNORE_READS_BEGIN \
ANNOTATE_IGNORE_READS_END \
ANNOTATE_IGNORE_SYNC_BEGIN \
ANNOTATE_IGNORE_SYNC_END \
ANNOTATE_IGNORE_WRITES_BEGIN \
ANNOTATE_IGNORE_WRITES_END \
ANNOTATE_MEMORY_IS_INITIALIZED \
ANNOTATE_MEMORY_IS_UNINITIALIZED \
ANNOTATE_MUTEX_IS_USED_AS_CONDVAR \
ANNOTATE_NEW_MEMORY \
ANNOTATE_NOT_HAPPENS_BEFORE_MUTEX \
ANNOTATE_NO_OP \
ANNOTATE_PCQ_CREATE ANNOTATE_PCQ_DESTROY \
ANNOTATE_PCQ_GET ANNOTATE_PCQ_PUT \
ANNOTATE_PUBLISH_MEMORY_RANGE \
ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX \
ANNOTATE_RWLOCK_ACQUIRED \
ANNOTATE_RWLOCK_CREATE \
ANNOTATE_RWLOCK_CREATE_STATIC \
ANNOTATE_RWLOCK_DESTROY \
ANNOTATE_RWLOCK_RELEASED \
ANNOTATE_SWAP_MEMORY_RANGE \
ANNOTATE_THREAD_NAME \
ANNOTATE_TRACE_MEMORY \
ANNOTATE_UNPROTECTED_READ \
ANNOTATE_UNPUBLISH_MEMORY_RANGE \
ANNOTATIONS_ENABLED \
ATTRIBUTE_IGNORE_READS_BEGIN \
ATTRIBUTE_IGNORE_READS_END \
DYNAMIC_ANNOTATIONS_ATTRIBUTE_WEAK \
DYNAMIC_ANNOTATIONS_ENABLED \
DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL \
DYNAMIC_ANNOTATIONS_GLUE \
DYNAMIC_ANNOTATIONS_GLUE0 \
DYNAMIC_ANNOTATIONS_IMPL \
DYNAMIC_ANNOTATIONS_NAME \
DYNAMIC_ANNOTATIONS_PREFIX \
DYNAMIC_ANNOTATIONS_PROVIDE_RUNNING_ON_VALGRIND \
DYNAMIC_ANNOTATIONS_WANT_ATTRIBUTE_WEAK \
; do
find absl/ -type f -exec sed -i "s/\b$w\b/ABSL_$w/g" {} \;
done
# -------------------------- thread_annotations -------------------------
for w in \
ts_unchecked_read \
; do
find absl/ -type f -exec sed -i "s/\b$w\b/absl_$w/g" {} \;
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment