Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lldb/source/Target/SwiftLanguageRuntimeDynamicTypeResolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,20 @@ class LLDBMemoryReader : public swift::remote::MemoryReader {
bool queryDataLayout(DataLayoutQueryType type, void *inBuffer,
void *outBuffer) override {
switch (type) {
// FIXME: add support for case DLQ_GetPtrAuthMask:
case DLQ_GetObjCReservedLowBits: {
Comment on lines +283 to +284

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice I was wondering what to do about this, but I figured it's good that the warning is there to tell us that it's a todo.

auto *result = static_cast<uint8_t *>(outBuffer);
auto &triple = m_process.GetTarget().GetArchitecture().GetTriple();
if (triple.isMacOSX() && triple.getArch() == llvm::Triple::x86_64) {
// Obj-C reserves low bit on 64-bit Intel macOS only.
// Other Apple platforms don't reserve this bit (even when
// running on x86_64-based simulators).
*result = 1;
} else {
*result = 0;
}
break;
}
case DLQ_GetPointerSize: {
auto result = static_cast<uint8_t *>(outBuffer);
*result = m_process.GetAddressByteSize();
Expand Down
12 changes: 6 additions & 6 deletions lldb/unittests/Symbol/TestTypeSystemSwiftTypeRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ TEST_F(TestTypeSystemSwiftTypeRef, Function) {
CompilerType void_void = GetCompilerType(b.Mangle(n));
ASSERT_TRUE(void_void.IsFunctionType(nullptr));
ASSERT_TRUE(void_void.IsFunctionPointerType());
ASSERT_EQ(void_void.GetNumberOfFunctionArguments(), 0);
ASSERT_EQ(void_void.GetNumberOfFunctionArguments(), 0UL);
}
{
NodePointer n = b.GlobalType(
b.Node(Node::Kind::ImplFunctionType, b.Node(Node::Kind::ImplEscaping),
b.Node(Node::Kind::ImplConvention, "@callee_guaranteed")));
CompilerType impl_void_void = GetCompilerType(b.Mangle(n));
ASSERT_TRUE(impl_void_void.IsFunctionType(nullptr));
ASSERT_EQ(impl_void_void.GetNumberOfFunctionArguments(), 0);
ASSERT_EQ(impl_void_void.GetNumberOfFunctionArguments(), 0UL);
}
{
NodePointer n = b.GlobalType(b.Node(
Expand All @@ -147,7 +147,7 @@ TEST_F(TestTypeSystemSwiftTypeRef, Function) {
b.Node(Node::Kind::Tuple))));
CompilerType impl_two_args = GetCompilerType(b.Mangle(n));
ASSERT_TRUE(impl_two_args.IsFunctionType(nullptr));
ASSERT_EQ(impl_two_args.GetNumberOfFunctionArguments(), 2);
ASSERT_EQ(impl_two_args.GetNumberOfFunctionArguments(), 2UL);
ASSERT_EQ(impl_two_args.GetFunctionArgumentAtIndex(0), int_type);
ASSERT_EQ(impl_two_args.GetFunctionArgumentAtIndex(1), void_type);
ASSERT_EQ(impl_two_args.GetFunctionArgumentTypeAtIndex(0), int_type);
Expand All @@ -167,7 +167,7 @@ TEST_F(TestTypeSystemSwiftTypeRef, Function) {
b.Node(Node::Kind::Type, b.Node(Node::Kind::Tuple)))));
CompilerType two_args = GetCompilerType(b.Mangle(n));
ASSERT_TRUE(two_args.IsFunctionType(nullptr));
ASSERT_EQ(two_args.GetNumberOfFunctionArguments(), 2);
ASSERT_EQ(two_args.GetNumberOfFunctionArguments(), 2UL);
ASSERT_EQ(two_args.GetFunctionArgumentAtIndex(0), int_type);
ASSERT_EQ(two_args.GetFunctionArgumentAtIndex(1), void_type);
ASSERT_EQ(two_args.GetFunctionArgumentTypeAtIndex(0), int_type);
Expand Down Expand Up @@ -306,7 +306,7 @@ TEST_F(TestTypeSystemSwiftTypeRef, Scalar) {
uint32_t count = 99;
bool is_complex = true;
ASSERT_FALSE(int_type.IsFloatingPointType(count, is_complex));
ASSERT_EQ(count, 0);
ASSERT_EQ(count, 0UL);
ASSERT_EQ(is_complex, false);
bool is_signed = true;
ASSERT_TRUE(int_type.IsIntegerType(is_signed));
Expand All @@ -318,7 +318,7 @@ TEST_F(TestTypeSystemSwiftTypeRef, Scalar) {
uint32_t count = 99;
bool is_complex = true;
ASSERT_TRUE(float_type.IsFloatingPointType(count, is_complex));
ASSERT_EQ(count, 1);
ASSERT_EQ(count, 1UL);
ASSERT_EQ(is_complex, false);
bool is_signed = true;
ASSERT_FALSE(float_type.IsIntegerType(is_signed));
Expand Down