mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Implement reflection support for Symbolic Extended Existential types.
This patch adds a new SymbolicExtendedExistentialTypeRef kind, and wires it up in TypeDecoder, TypeRefBuilder, TypeLowering, and ASTDemangler. This is tested indirectly via the matching LLDB commit.
This commit is contained in:
@@ -193,6 +193,7 @@ public:
|
||||
};
|
||||
|
||||
using IndexType = uint64_t;
|
||||
using RemoteAddressType = std::pair<uint64_t, uint8_t>;
|
||||
|
||||
friend class NodeFactory;
|
||||
|
||||
@@ -209,14 +210,20 @@ private:
|
||||
IndexType Index;
|
||||
NodePointer InlineChildren[2];
|
||||
NodeVector Children;
|
||||
RemoteAddressType RemoteAddress;
|
||||
};
|
||||
|
||||
|
||||
Kind NodeKind;
|
||||
|
||||
enum class PayloadKind : uint8_t {
|
||||
None = 0, OneChild = 1, TwoChildren = 2,
|
||||
Text, Index, ManyChildren
|
||||
None = 0,
|
||||
OneChild = 1,
|
||||
TwoChildren = 2,
|
||||
Text,
|
||||
Index,
|
||||
ManyChildren,
|
||||
RemoteAddress
|
||||
};
|
||||
PayloadKind NodePayloadKind;
|
||||
|
||||
@@ -231,6 +238,10 @@ private:
|
||||
: NodeKind(k), NodePayloadKind(PayloadKind::Index) {
|
||||
Index = index;
|
||||
}
|
||||
Node(Kind k, uint64_t remoteAddress, uint8_t addressSpace)
|
||||
: NodeKind(k), NodePayloadKind(PayloadKind::RemoteAddress) {
|
||||
RemoteAddress = {remoteAddress, addressSpace};
|
||||
}
|
||||
Node(const Node &) = delete;
|
||||
Node &operator=(const Node &) = delete;
|
||||
|
||||
@@ -284,6 +295,14 @@ public:
|
||||
return Index;
|
||||
}
|
||||
|
||||
bool hasRemoteAddress() const {
|
||||
return NodePayloadKind == PayloadKind::RemoteAddress;
|
||||
}
|
||||
std::pair<uint64_t, uint8_t> getRemoteAddress() const {
|
||||
assert(hasRemoteAddress());
|
||||
return RemoteAddress;
|
||||
}
|
||||
|
||||
using iterator = const NodePointer *;
|
||||
|
||||
size_t getNumChildren() const {
|
||||
|
||||
Reference in New Issue
Block a user