Skip to content

Commit

Permalink
Update LLVM lib/Demangle 2dea832ef064bb86...3a4c7cc56c07b2db
Browse files Browse the repository at this point in the history
New:

- [ms] Two demangling fixes for non-type template parameters
- [itanium] Demangling for built-in type transformations
- [itanium] Demangling rules for C++20 concepts and requires-expressions
- [itanium] Demangle explicitly named object parameters

(...and some minor tweaks.)

Ran:

    cp ~/src/llvm-project/llvm/include/llvm/Demangle/*.{h,def} third_party/llvm/include/llvm/Demangle/
    cp ~/src/llvm-project/llvm/lib/Demangle/*.cpp third_party/llvm/lib/Demangle/
    cp ~/src/llvm-project/llvm/LICENSE.TXT third_party/llvm/LICENSE.txt
  • Loading branch information
nico committed Aug 4, 2024
1 parent 18534b7 commit 77f83c7
Show file tree
Hide file tree
Showing 9 changed files with 634 additions and 137 deletions.
8 changes: 5 additions & 3 deletions third_party/llvm/include/llvm/Demangle/Demangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ enum : int {
/// Returns a non-NULL pointer to a NUL-terminated C style string
/// that should be explicitly freed, if successful. Otherwise, may return
/// nullptr if mangled_name is not a valid mangling or is nullptr.
char *itaniumDemangle(std::string_view mangled_name);
char *itaniumDemangle(std::string_view mangled_name, bool ParseParams = true);

enum MSDemangleFlags {
MSDF_None = 0,
Expand Down Expand Up @@ -67,7 +67,9 @@ char *dlangDemangle(std::string_view MangledName);
/// demangling occurred.
std::string demangle(std::string_view MangledName);

bool nonMicrosoftDemangle(std::string_view MangledName, std::string &Result);
bool nonMicrosoftDemangle(std::string_view MangledName, std::string &Result,
bool CanHaveLeadingDot = true,
bool ParseParams = true);

/// "Partial" demangler. This supports demangling a string into an AST
/// (typically an intermediate stage in itaniumDemangle) and querying certain
Expand Down Expand Up @@ -102,7 +104,7 @@ struct ItaniumPartialDemangler {
char *getFunctionParameters(char *Buf, size_t *N) const;
char *getFunctionReturnType(char *Buf, size_t *N) const;

/// If this function has any any cv or reference qualifiers. These imply that
/// If this function has any cv or reference qualifiers. These imply that
/// the function is a non-static member function.
bool hasFunctionQualifiers() const;

Expand Down
5 changes: 5 additions & 0 deletions third_party/llvm/include/llvm/Demangle/DemangleConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
#define DEMANGLE_FALLTHROUGH
#endif

#ifndef DEMANGLE_ASSERT
#include <cassert>
#define DEMANGLE_ASSERT(__expr, __msg) assert((__expr) && (__msg))
#endif

#define DEMANGLE_NAMESPACE_BEGIN namespace llvm { namespace itanium_demangle {
#define DEMANGLE_NAMESPACE_END } }

Expand Down
Loading

0 comments on commit 77f83c7

Please sign in to comment.