Skip to content

Fix compilation warnings #2053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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: {
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