Skip to content

Commit

Permalink
Update Repository metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
fantexi023 committed Jul 18, 2024
1 parent eaae91f commit 0570aeb
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 44 deletions.
3 changes: 3 additions & 0 deletions symbolic-demangle/tests/test_swift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,5 +291,8 @@ fn test_demangle_swift_no_args() {

// Swift 5.5.1
"$s10Speediness17NetworkQualityCLIO3run10sequentialAC6ResultVSb_tYaKFZTf4nd_nTQ0_" => "(1) await resume partial function for specialized static NetworkQualityCLI.run",

// Swift 5.10
"_$s16HDFileDownloader14HDFDURLSessionC11postRequest11request_url6params12headerFields9callBlockySS_SDySSypGSDyS2SGy10Foundation4DataVSg_s5Error_pSgtctFyAN_So13NSURLResponseCSgAPtYbcfU_TATm" => "partial apply for closure #1 @Sendable (Foundation.Data?, __C.NSURLResponse?, Swift.Error?) -> () in HDFileDownloader.HDFDURLSession.postRequest(request_url: Swift.String, params: [Swift.String : Any], headerFields: [Swift.String : Swift.String], callBlock: (Foundation.Data?, Swift.Error?) -> ()) -> ()",
});
}
174 changes: 132 additions & 42 deletions symbolic-demangle/vendor/swift/1-arguments.patch
Original file line number Diff line number Diff line change
@@ -1,45 +1,135 @@
commit 43fca7dd2617ac93f338b5257a2e57c43dcb8154
Author: Sebastian Zivota <[email protected]>
Date: Thu Dec 2 16:15:35 2021 +0100
commit eaae91fd522031a2aaafed367414f942f1c83d22
Author: fantexi023 <[email protected]>
Date: Thu Jul 18 17:04:45 2024 +0800

Apply patch
pass cargo build

diff --git a/symbolic-demangle/vendor/swift/include/swift/Demangling/Demangle.h b/symbolic-demangle/vendor/swift/include/swift/Demangling/Demangle.h
index db32dbd..f48e1c2 100644
--- a/symbolic-demangle/vendor/swift/include/swift/Demangling/Demangle.h
+++ b/symbolic-demangle/vendor/swift/include/swift/Demangling/Demangle.h
@@ -59,6 +59,7 @@ struct DemangleOptions {
bool ShortenArchetype = false;
bool ShowPrivateDiscriminators = true;
bool ShowFunctionArgumentTypes = true;
+ bool ShowFunctionReturnType = true;
bool DisplayDebuggerGeneratedModule = true;
bool DisplayStdlibModule = true;
bool DisplayObjCModule = true;
@@ -90,6 +91,7 @@ struct DemangleOptions {
Opt.ShortenArchetype = true;
Opt.ShowPrivateDiscriminators = false;
Opt.ShowFunctionArgumentTypes = false;
+ Opt.ShowFunctionReturnType = false;
return Opt;
};
diff --git a/symbolic-demangle/build.rs b/symbolic-demangle/build.rs
index 4ce782eb..15246da7 100644
--- a/symbolic-demangle/build.rs
+++ b/symbolic-demangle/build.rs
@@ -15,7 +15,7 @@ fn main() {
"vendor/swift/lib/Demangling/Punycode.cpp",
"vendor/swift/lib/Demangling/Remangler.cpp",
])
- .flag_if_supported("-std=c++14")
+ .flag_if_supported("-std=c++17")
.flag("-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1")
.warnings(false)
.include("vendor/swift/include")
diff --git a/symbolic-demangle/src/swiftdemangle.cpp b/symbolic-demangle/src/swiftdemangle.cpp
index 843a2a59..85c1fecc 100644
--- a/symbolic-demangle/src/swiftdemangle.cpp
+++ b/symbolic-demangle/src/swiftdemangle.cpp
@@ -12,10 +12,11 @@ extern "C" int symbolic_demangle_swift(const char *symbol,

if (features < SYMBOLIC_SWIFT_FEATURE_ALL) {
opts = swift::Demangle::DemangleOptions::SimplifiedUIDemangleOptions();
- bool return_type = features & SYMBOLIC_SWIFT_FEATURE_RETURN_TYPE;
+ // bool return_type = features & SYMBOLIC_SWIFT_FEATURE_RETURN_TYPE;
bool argument_types = features & SYMBOLIC_SWIFT_FEATURE_PARAMETERS;

- opts.ShowFunctionReturnType = return_type;
+ // No ShowFunctionReturnType property in DemangleOptions any more
+ // opts.ShowFunctionReturnType = return_type;
opts.ShowFunctionArgumentTypes = argument_types;
}

diff --git a/symbolic-demangle/vendor/swift/include/llvm/Support/type_traits.h b/symbolic-demangle/vendor/swift/include/llvm/Support/type_traits.h
index 3fd158de..a6046de8 100644
--- a/symbolic-demangle/vendor/swift/include/llvm/Support/type_traits.h
+++ b/symbolic-demangle/vendor/swift/include/llvm/Support/type_traits.h
@@ -32,11 +32,11 @@ template <typename T> class is_integral_or_enum {

public:
static const bool value =
- !std::is_class_v<UnderlyingT> && // Filter conversion operators.
- !std::is_pointer_v<UnderlyingT> &&
- !std::is_floating_point_v<UnderlyingT> &&
- (std::is_enum_v<UnderlyingT> ||
- std::is_convertible_v<UnderlyingT, unsigned long long>);
+ !std::is_class<UnderlyingT>::value && // Filter conversion operators.
+ !std::is_pointer<UnderlyingT>::value &&
+ !std::is_floating_point<UnderlyingT>::value &&
+ (std::is_enum<UnderlyingT>::value ||
+ std::is_convertible<UnderlyingT, unsigned long long>::value);
};

/// If T is a pointer, just return it. If it is not, return T&.
@@ -45,7 +45,7 @@ struct add_lvalue_reference_if_not_pointer { using type = T &; };

template <typename T>
struct add_lvalue_reference_if_not_pointer<
- T, std::enable_if_t<std::is_pointer_v<T>>> {
+ T, std::enable_if_t<std::is_pointer<T>::value>> {
using type = T;
};

@@ -55,7 +55,7 @@ template<typename T, typename Enable = void>
struct add_const_past_pointer { using type = const T; };

template <typename T>
-struct add_const_past_pointer<T, std::enable_if_t<std::is_pointer_v<T>>> {
+struct add_const_past_pointer<T, std::enable_if_t<std::is_pointer<T>::value>> {
using type = const std::remove_pointer_t<T> *;
};

@@ -64,11 +64,27 @@ struct const_pointer_or_const_ref {
using type = const T &;
};
diff --git a/symbolic-demangle/vendor/swift/lib/Demangling/NodePrinter.cpp b/symbolic-demangle/vendor/swift/lib/Demangling/NodePrinter.cpp
index 2a9c0dc..34fa785 100644
--- a/symbolic-demangle/vendor/swift/lib/Demangling/NodePrinter.cpp
+++ b/symbolic-demangle/vendor/swift/lib/Demangling/NodePrinter.cpp
@@ -863,10 +863,11 @@ private:
if (isSendable)
Printer << "@Sendable ";

- printFunctionParameters(LabelList, node->getChild(startIndex),
- Options.ShowFunctionArgumentTypes);
+ if (Options.ShowFunctionArgumentTypes) {
+ printFunctionParameters(LabelList, node->getChild(startIndex), true);
+ }

- if (!Options.ShowFunctionArgumentTypes)
+ if (!Options.ShowFunctionReturnType)
return;

if (isAsync)
template <typename T>
-struct const_pointer_or_const_ref<T, std::enable_if_t<std::is_pointer_v<T>>> {
+struct const_pointer_or_const_ref<T,
+ std::enable_if_t<std::is_pointer<T>::value>> {
using type = typename add_const_past_pointer<T>::type;
};

namespace detail {
+/// Internal utility to detect trivial copy construction.
+template<typename T> union copy_construction_triviality_helper {
+ T t;
+ copy_construction_triviality_helper() = default;
+ copy_construction_triviality_helper(const copy_construction_triviality_helper&) = default;
+ ~copy_construction_triviality_helper() = default;
+};
+/// Internal utility to detect trivial move construction.
+template<typename T> union move_construction_triviality_helper {
+ T t;
+ move_construction_triviality_helper() = default;
+ move_construction_triviality_helper(move_construction_triviality_helper&&) = default;
+ ~move_construction_triviality_helper() = default;
+};
+
template<class T>
union trivial_helper {
T t;
@@ -76,6 +92,29 @@ union trivial_helper {

} // end namespace detail

+/// An implementation of `std::is_trivially_copy_constructible` since we have
+/// users with STLs that don't yet include it.
+template <typename T>
+struct is_trivially_copy_constructible
+ : std::is_copy_constructible<
+ ::llvm::detail::copy_construction_triviality_helper<T>> {};
+template <typename T>
+struct is_trivially_copy_constructible<T &> : std::true_type {};
+template <typename T>
+struct is_trivially_copy_constructible<T &&> : std::false_type {};
+
+/// An implementation of `std::is_trivially_move_constructible` since we have
+/// users with STLs that don't yet include it.
+template <typename T>
+struct is_trivially_move_constructible
+ : std::is_move_constructible<
+ ::llvm::detail::move_construction_triviality_helper<T>> {};
+template <typename T>
+struct is_trivially_move_constructible<T &> : std::true_type {};
+template <typename T>
+struct is_trivially_move_constructible<T &&> : std::true_type {};
+
+
template <typename T>
struct is_copy_assignable {
template<class F>
4 changes: 2 additions & 2 deletions symbolic-demangle/vendor/swift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This folder contains a vendored subset of the [Swift Programming Language]. The Swift library is
reduced to the demangler only to reduce the size of this package.

The current version is **Swift 5.5.1**.
The current version is **Swift 5.10**.

## Sentry Modifications

Expand All @@ -28,7 +28,7 @@ patch is maintained in `1-arguments.patch`.
4. Check out the release branch of the latest release:
```
$ cd swift
$ git checkout swift-5.5.1-RELEASE
$ git checkout swift-5.10-RELEASE
```
5. Build the complete swift project (be very patient, this may take long):
```
Expand Down

0 comments on commit 0570aeb

Please sign in to comment.