Skip to content

Commit bec4b4a

Browse files
committed
sync phmap and llvm
1 parent 290e8f6 commit bec4b4a

File tree

8 files changed

+31
-20
lines changed

8 files changed

+31
-20
lines changed

.github/workflows/cmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
target: [win64, win32, arm64]
2424
steps:
2525
- uses: lukka/get-cmake@latest
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
with:
2828
fetch-depth: 1
2929
- name: compile-bela

include/bela/__phmap/VERSION

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-
946ebad67a21212d11a0dd4deb7cdedc297d47bc
2+
65775fa09fecaa65d0b0022ab6bf091c0e509445

include/bela/__phmap/phmap_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
#define PHMAP_VERSION_MAJOR 1
3838
#define PHMAP_VERSION_MINOR 3
39-
#define PHMAP_VERSION_PATCH 11
39+
#define PHMAP_VERSION_PATCH 12
4040

4141
// Included for the __GLIBC__ macro (or similar macros on other systems).
4242
#include <limits.h>

src/belaund/llvm/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
llvm-project:946ebad67a21212d11a0dd4deb7cdedc297d47bc
1+
llvm-project:e7ec0c972e6f5ddd01099fd05ca24352cb992b44

src/belaund/llvm/include/llvm/Demangle/Demangle.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ enum : int {
3232
/// Returns a non-NULL pointer to a NUL-terminated C style string
3333
/// that should be explicitly freed, if successful. Otherwise, may return
3434
/// nullptr if mangled_name is not a valid mangling or is nullptr.
35-
char *itaniumDemangle(std::string_view mangled_name);
35+
char *itaniumDemangle(std::string_view mangled_name, bool ParseParams = true);
3636

3737
enum MSDemangleFlags {
3838
MSDF_None = 0,
@@ -68,7 +68,8 @@ char *dlangDemangle(std::string_view MangledName);
6868
std::string demangle(std::string_view MangledName);
6969

7070
bool nonMicrosoftDemangle(std::string_view MangledName, std::string &Result,
71-
bool CanHaveLeadingDot = true);
71+
bool CanHaveLeadingDot = true,
72+
bool ParseParams = true);
7273

7374
/// "Partial" demangler. This supports demangling a string into an AST
7475
/// (typically an intermediate stage in itaniumDemangle) and querying certain

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

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@
3838
DEMANGLE_NAMESPACE_BEGIN
3939

4040
template <class T, size_t N> class PODSmallVector {
41-
static_assert(std::is_pod<T>::value,
42-
"T is required to be a plain old data type");
43-
41+
static_assert(std::is_trivial<T>::value,
42+
"T is required to be a trivial type");
4443
T *First = nullptr;
4544
T *Last = nullptr;
4645
T *Cap = nullptr;
47-
T Inline[N] = {0};
46+
T Inline[N] = {};
4847

4948
bool isInline() const { return First == Inline; }
5049

@@ -2793,7 +2792,7 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {
27932792
Node *parseClassEnumType();
27942793
Node *parseQualifiedType();
27952794

2796-
Node *parseEncoding();
2795+
Node *parseEncoding(bool ParseParams = true);
27972796
bool parseCallOffset();
27982797
Node *parseSpecialName();
27992798

@@ -2910,7 +2909,7 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {
29102909
Node *parseDestructorName();
29112910

29122911
/// Top-level entry point into the parser.
2913-
Node *parse();
2912+
Node *parse(bool ParseParams = true);
29142913
};
29152914

29162915
const char* parse_discriminator(const char* first, const char* last);
@@ -5404,7 +5403,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseSpecialName() {
54045403
// ::= <data name>
54055404
// ::= <special-name>
54065405
template <typename Derived, typename Alloc>
5407-
Node *AbstractManglingParser<Derived, Alloc>::parseEncoding() {
5406+
Node *AbstractManglingParser<Derived, Alloc>::parseEncoding(bool ParseParams) {
54085407
// The template parameters of an encoding are unrelated to those of the
54095408
// enclosing context.
54105409
SaveTemplateParams SaveTemplateParamsScope(this);
@@ -5430,6 +5429,16 @@ Node *AbstractManglingParser<Derived, Alloc>::parseEncoding() {
54305429
if (IsEndOfEncoding())
54315430
return Name;
54325431

5432+
// ParseParams may be false at the top level only, when called from parse().
5433+
// For example in the mangled name _Z3fooILZ3BarEET_f, ParseParams may be
5434+
// false when demangling 3fooILZ3BarEET_f but is always true when demangling
5435+
// 3Bar.
5436+
if (!ParseParams) {
5437+
while (consume())
5438+
;
5439+
return Name;
5440+
}
5441+
54335442
Node *Attrs = nullptr;
54345443
if (consumeIf("Ua9enable_ifI")) {
54355444
size_t BeforeArgs = Names.size();
@@ -5894,9 +5903,9 @@ AbstractManglingParser<Derived, Alloc>::parseTemplateArgs(bool TagTemplates) {
58945903
// extension ::= ___Z <encoding> _block_invoke<decimal-digit>+
58955904
// extension ::= ___Z <encoding> _block_invoke_<decimal-digit>+
58965905
template <typename Derived, typename Alloc>
5897-
Node *AbstractManglingParser<Derived, Alloc>::parse() {
5906+
Node *AbstractManglingParser<Derived, Alloc>::parse(bool ParseParams) {
58985907
if (consumeIf("_Z") || consumeIf("__Z")) {
5899-
Node *Encoding = getDerived().parseEncoding();
5908+
Node *Encoding = getDerived().parseEncoding(ParseParams);
59005909
if (Encoding == nullptr)
59015910
return nullptr;
59025911
if (look() == '.') {
@@ -5910,7 +5919,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parse() {
59105919
}
59115920

59125921
if (consumeIf("___Z") || consumeIf("____Z")) {
5913-
Node *Encoding = getDerived().parseEncoding();
5922+
Node *Encoding = getDerived().parseEncoding(ParseParams);
59145923
if (Encoding == nullptr || !consumeIf("_block_invoke"))
59155924
return nullptr;
59165925
bool RequireNumber = consumeIf('_');

src/belaund/llvm/lib/Demangle/Demangle.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ static bool isRustEncoding(std::string_view S) { return starts_with(S, "_R"); }
4747
static bool isDLangEncoding(std::string_view S) { return starts_with(S, "_D"); }
4848

4949
bool llvm::nonMicrosoftDemangle(std::string_view MangledName,
50-
std::string &Result, bool CanHaveLeadingDot) {
50+
std::string &Result, bool CanHaveLeadingDot,
51+
bool ParseParams) {
5152
char *Demangled = nullptr;
5253

5354
// Do not consider the dot prefix as part of the demangled symbol name.
@@ -57,7 +58,7 @@ bool llvm::nonMicrosoftDemangle(std::string_view MangledName,
5758
}
5859

5960
if (isItaniumEncoding(MangledName))
60-
Demangled = itaniumDemangle(MangledName);
61+
Demangled = itaniumDemangle(MangledName, ParseParams);
6162
else if (isRustEncoding(MangledName))
6263
Demangled = rustDemangle(MangledName);
6364
else if (isDLangEncoding(MangledName))

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,13 @@ class DefaultAllocator {
366366

367367
using Demangler = itanium_demangle::ManglingParser<DefaultAllocator>;
368368

369-
char *llvm::itaniumDemangle(std::string_view MangledName) {
369+
char *llvm::itaniumDemangle(std::string_view MangledName, bool ParseParams) {
370370
if (MangledName.empty())
371371
return nullptr;
372372

373373
Demangler Parser(MangledName.data(),
374374
MangledName.data() + MangledName.length());
375-
Node *AST = Parser.parse();
375+
Node *AST = Parser.parse(ParseParams);
376376
if (!AST)
377377
return nullptr;
378378

0 commit comments

Comments
 (0)