Skip to content

Commit e9a5cd3

Browse files
committed
sync bela
1 parent 7e1d15a commit e9a5cd3

File tree

10 files changed

+73
-33
lines changed

10 files changed

+73
-33
lines changed

vendor/bela.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/fcharlie/bela/tree/b90164e04799c805a675c41de9ec081c67b1f5ba
1+
https://github.com/fcharlie/bela/tree/57c258b6414a09a413fd2054fe0f0b19fd2132d8
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
https://github.com/greg7mdp/parallel-hashmap.git
2-
79cbd2dafd5aab3829064d1b48b71137623d8ff2
2+
77cab8192a879e5d27188f97e8f2080dd7e36ca8

vendor/bela/include/bela/__phmap/btree.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ namespace phmap {
108108
bool, std::is_copy_constructible<
109109
type_traits_internal::SingleMemberUnion<T>>::value &&
110110
std::is_trivially_destructible<T>::value> {};
111-
111+
#if 0
112112
template <class T>
113113
struct IsTriviallyMoveAssignableReference : std::false_type {};
114114

@@ -119,7 +119,7 @@ namespace phmap {
119119
template <class T>
120120
struct IsTriviallyMoveAssignableReference<T&&>
121121
: std::is_trivially_move_assignable<T>::type {};
122-
122+
#endif
123123
} // namespace type_traits_internal
124124

125125

@@ -148,8 +148,8 @@ namespace phmap {
148148

149149
public:
150150
static constexpr bool kValue =
151-
(std::is_trivially_copyable<ExtentsRemoved>::value || !kIsCopyOrMoveConstructible) &&
152-
(std::is_trivially_copy_assignable<ExtentsRemoved>::value || !kIsCopyOrMoveAssignable) &&
151+
(phmap::is_trivially_copyable<ExtentsRemoved>::value || !kIsCopyOrMoveConstructible) &&
152+
(phmap::is_trivially_copy_assignable<ExtentsRemoved>::value || !kIsCopyOrMoveAssignable) &&
153153
(kIsCopyOrMoveConstructible || kIsCopyOrMoveAssignable) &&
154154
std::is_trivially_destructible<ExtentsRemoved>::value &&
155155
// We need to check for this explicitly because otherwise we'll say
@@ -3321,8 +3321,8 @@ namespace priv {
33213321
// ----------------
33223322
template <typename K = key_type>
33233323
size_type count(const key_arg<K> &key) const {
3324-
auto equal_range = this->equal_range(key);
3325-
return std::distance(equal_range.first, equal_range.second);
3324+
auto er = this->equal_range(key);
3325+
return std::distance(er.first, er.second);
33263326
}
33273327
template <typename K = key_type>
33283328
iterator find(const key_arg<K> &key) {
@@ -3362,8 +3362,8 @@ namespace priv {
33623362
}
33633363
template <typename K = key_type>
33643364
size_type erase(const key_arg<K> &key) {
3365-
auto equal_range = this->equal_range(key);
3366-
return tree_.erase_range(equal_range.first, equal_range.second).first;
3365+
auto er = this->equal_range(key);
3366+
return tree_.erase_range(er.first, er.second).first;
33673367
}
33683368
node_type extract(iterator position) {
33693369
// Use Move instead of Transfer, because the rebalancing code expects to

vendor/bela/include/bela/__phmap/phmap.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,14 +2271,14 @@ class raw_hash_set
22712271
}
22722272

22732273
// Reset all ctrl bytes back to kEmpty, except the sentinel.
2274-
void reset_ctrl(size_t capacity) {
2275-
std::memset(ctrl_, kEmpty, capacity + Group::kWidth);
2276-
ctrl_[capacity] = kSentinel;
2277-
SanitizerPoisonMemoryRegion(slots_, sizeof(slot_type) * capacity);
2274+
void reset_ctrl(size_t new_capacity) {
2275+
std::memset(ctrl_, kEmpty, new_capacity + Group::kWidth);
2276+
ctrl_[new_capacity] = kSentinel;
2277+
SanitizerPoisonMemoryRegion(slots_, sizeof(slot_type) * new_capacity);
22782278
}
22792279

2280-
void reset_growth_left(size_t capacity) {
2281-
growth_left() = CapacityToGrowth(capacity) - size_;
2280+
void reset_growth_left(size_t new_capacity) {
2281+
growth_left() = CapacityToGrowth(new_capacity) - size_;
22822282
}
22832283

22842284
size_t& growth_left() { return std::get<0>(settings_); }

vendor/bela/include/bela/__phmap/phmap_base.h

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,36 @@ struct disjunction<> : std::false_type {};
223223
template <typename T>
224224
struct negation : std::integral_constant<bool, !T::value> {};
225225

226+
#if defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__) && !defined(_MSC_VER) && !defined(__INTEL_COMPILER)
227+
#define PHMAP_OLD_GCC 1
228+
#else
229+
#define PHMAP_OLD_GCC 0
230+
#endif
231+
232+
#if PHMAP_OLD_GCC
233+
template <typename T>
234+
struct is_trivially_copy_constructible
235+
: std::integral_constant<bool,
236+
__has_trivial_copy(typename std::remove_reference<T>::type) &&
237+
std::is_copy_constructible<T>::value &&
238+
std::is_trivially_destructible<T>::value> {};
239+
240+
template <typename T>
241+
struct is_trivially_copy_assignable :
242+
std::integral_constant<bool,
243+
__has_trivial_assign(typename std::remove_reference<T>::type) &&
244+
phmap::is_copy_assignable<T>::value> {};
245+
246+
template <typename T>
247+
struct is_trivially_copyable :
248+
std::integral_constant<bool, __has_trivial_copy(typename std::remove_reference<T>::type)> {};
249+
250+
#else
251+
template <typename T> using is_trivially_copy_constructible = std::is_trivially_copy_constructible<T>;
252+
template <typename T> using is_trivially_copy_assignable = std::is_trivially_copy_assignable<T>;
253+
template <typename T> using is_trivially_copyable = std::is_trivially_copyable<T>;
254+
#endif
255+
226256
// -----------------------------------------------------------------------------
227257
// C++14 "_t" trait aliases
228258
// -----------------------------------------------------------------------------
@@ -1788,8 +1818,8 @@ class optional_data_base : public optional_data_dtor_base<T>
17881818
// supported now, so we use is_trivially_* traits instead.
17891819
template <typename T,
17901820
bool unused =
1791-
std::is_trivially_copy_constructible<T>::value &&
1792-
std::is_trivially_copy_assignable<typename std::remove_cv<T>::type>::value &&
1821+
phmap::is_trivially_copy_constructible<T>::value &&
1822+
phmap::is_trivially_copy_assignable<typename std::remove_cv<T>::type>::value &&
17931823
std::is_trivially_destructible<T>::value>
17941824
class optional_data;
17951825

@@ -2021,6 +2051,11 @@ struct optional_hash_base<T, decltype(std::hash<phmap::remove_const_t<T> >()(
20212051
// -----------------------------------------------------------------------------
20222052
// phmap::optional class definition
20232053
// -----------------------------------------------------------------------------
2054+
#if PHMAP_OLD_GCC
2055+
#define PHMAP_OPTIONAL_NOEXCEPT
2056+
#else
2057+
#define PHMAP_OPTIONAL_NOEXCEPT noexcept
2058+
#endif
20242059

20252060
template <typename T>
20262061
class optional : private optional_internal::optional_data<T>,
@@ -2047,7 +2082,7 @@ class optional : private optional_internal::optional_data<T>,
20472082
optional(const optional& src) = default;
20482083

20492084
// Move constructor, standard semantics
2050-
optional(optional&& src) noexcept = default;
2085+
optional(optional&& src) PHMAP_OPTIONAL_NOEXCEPT = default;
20512086

20522087
// Constructs a non-empty `optional` direct-initialized value of type `T` from
20532088
// the arguments `std::forward<Args>(args)...` within the `optional`.
@@ -2187,7 +2222,7 @@ class optional : private optional_internal::optional_data<T>,
21872222
optional& operator=(const optional& src) = default;
21882223

21892224
// Move assignment operator, standard semantics
2190-
optional& operator=(optional&& src) noexcept = default;
2225+
optional& operator=(optional&& src) PHMAP_OPTIONAL_NOEXCEPT = default;
21912226

21922227
// Value assignment operators
21932228
template <

vendor/bela/include/bela/__phmap/phmap_config.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@
120120
#define PHMAP_HAVE_BUILTIN(x) 0
121121
#endif
122122

123-
#if (defined(_MSVC_LANG) && _MSVC_LANG >= 201703) || __cplusplus >= 201703
123+
#if (!defined(__GNUC__) || defined(__clang__) || __GNUC__ >= 5) && \
124+
((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
124125
#define PHMAP_HAVE_CC17 1
125126
#else
126127
#define PHMAP_HAVE_CC17 0
@@ -313,8 +314,12 @@
313314
#endif
314315
#endif
315316

316-
#if PHMAP_HAVE_CC17 && (!defined(__has_include) || __has_include(<shared_mutex>))
317-
#define PHMAP_HAVE_SHARED_MUTEX 1
317+
#if PHMAP_HAVE_CC17
318+
#ifdef __has_include
319+
#if __has_include(<shared_mutex>)
320+
#define PHMAP_HAVE_SHARED_MUTEX 1
321+
#endif
322+
#endif
318323
#endif
319324

320325
#ifndef PHMAP_HAVE_STD_STRING_VIEW
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
llvm-project:54210573ae918f6e0cab59bc5955a66bc34b5f6c
1+
llvm-project:8be07adfb42d8d5d060b807d5445b6fefc949bee

vendor/bela/src/belaund/llvm/include/llvm/Demangle/ItaniumDemangle.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2336,7 +2336,7 @@ template <class Float> class FloatLiteralImpl : public Node {
23362336
Float value;
23372337
char buf[sizeof(Float)];
23382338
};
2339-
const char *t = &*Contents.begin();
2339+
const char *t = Contents.data();
23402340
const char *last = t + N;
23412341
char *e = buf;
23422342
for (; t != last; ++t, ++e) {
@@ -3714,8 +3714,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseQualifiedType() {
37143714
std::string_view ProtoSourceName(Qual.data() + Len, Qual.size() - Len);
37153715
std::string_view Proto;
37163716
{
3717-
ScopedOverride<const char *> SaveFirst(First,
3718-
&*ProtoSourceName.begin()),
3717+
ScopedOverride<const char *> SaveFirst(First, ProtoSourceName.data()),
37193718
SaveLast(Last, &*ProtoSourceName.rbegin() + 1);
37203719
Proto = parseBareSourceName();
37213720
}

vendor/bela/src/belaund/llvm/lib/Demangle/ItaniumDemangle.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <cstdio>
1919
#include <cstdlib>
2020
#include <cstring>
21+
#include <exception>
2122
#include <functional>
2223
#include <utility>
2324

@@ -79,7 +80,7 @@ struct DumpVisitor {
7980

8081
void printStr(const char *S) { fprintf(stderr, "%s", S); }
8182
void print(std::string_view SV) {
82-
fprintf(stderr, "\"%.*s\"", (int)SV.size(), &*SV.begin());
83+
fprintf(stderr, "\"%.*s\"", (int)SV.size(), SV.data());
8384
}
8485
void print(const Node *N) {
8586
if (N)

vendor/bela/src/belaund/llvm/lib/Demangle/MicrosoftDemangle.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ std::string_view Demangler::copyString(std::string_view Borrowed) {
268268
// This is not a micro-optimization, it avoids UB, should Borrowed be an null
269269
// buffer.
270270
if (Borrowed.size())
271-
std::memcpy(Stable, &*Borrowed.begin(), Borrowed.size());
271+
std::memcpy(Stable, Borrowed.data(), Borrowed.size());
272272

273273
return {Stable, Borrowed.size()};
274274
}
@@ -792,7 +792,7 @@ SymbolNode *Demangler::demangleMD5Name(std::string_view &MangledName) {
792792
Error = true;
793793
return nullptr;
794794
}
795-
const char *Start = &*MangledName.begin();
795+
const char *Start = MangledName.data();
796796
const size_t StartSize = MangledName.size();
797797
MangledName.remove_prefix(MD5Last + 1);
798798

@@ -2382,7 +2382,7 @@ void Demangler::dumpBackReferences() {
23822382
T->output(OB, OF_Default);
23832383

23842384
std::string_view B = OB;
2385-
std::printf(" [%d] - %.*s\n", (int)I, (int)B.size(), &*B.begin());
2385+
std::printf(" [%d] - %.*s\n", (int)I, (int)B.size(), B.data());
23862386
}
23872387
std::free(OB.getBuffer());
23882388

@@ -2391,7 +2391,7 @@ void Demangler::dumpBackReferences() {
23912391
std::printf("%d name backreferences\n", (int)Backrefs.NamesCount);
23922392
for (size_t I = 0; I < Backrefs.NamesCount; ++I) {
23932393
std::printf(" [%d] - %.*s\n", (int)I, (int)Backrefs.Names[I]->Name.size(),
2394-
&*Backrefs.Names[I]->Name.begin());
2394+
Backrefs.Names[I]->Name.data());
23952395
}
23962396
if (Backrefs.NamesCount > 0)
23972397
std::printf("\n");
@@ -2404,7 +2404,7 @@ char *llvm::microsoftDemangle(std::string_view MangledName, size_t *NMangled,
24042404
std::string_view Name{MangledName};
24052405
SymbolNode *AST = D.parse(Name);
24062406
if (!D.Error && NMangled)
2407-
*NMangled = Name.empty() ? 0 : &*Name.begin() - &*MangledName.begin();
2407+
*NMangled = MangledName.size() - Name.size();
24082408

24092409
if (Flags & MSDF_DumpBackrefs)
24102410
D.dumpBackReferences();

0 commit comments

Comments
 (0)