Skip to content

Commit a2f7b7f

Browse files
committed
Fix compilation warnings
1 parent adb23f8 commit a2f7b7f

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

lldb/source/Target/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,20 @@ class LLDBMemoryReader : public swift::remote::MemoryReader {
280280
bool queryDataLayout(DataLayoutQueryType type, void *inBuffer,
281281
void *outBuffer) override {
282282
switch (type) {
283+
// FIXME: add support for case DLQ_GetPtrAuthMask:
284+
case DLQ_GetObjCReservedLowBits: {
285+
auto *result = static_cast<uint8_t *>(outBuffer);
286+
auto &triple = m_process.GetTarget().GetArchitecture().GetTriple();
287+
if (triple.isMacOSX() && triple.getArch() == llvm::Triple::x86_64) {
288+
// Obj-C reserves low bit on 64-bit Intel macOS only.
289+
// Other Apple platforms don't reserve this bit (even when
290+
// running on x86_64-based simulators).
291+
*result = 1;
292+
} else {
293+
*result = 0;
294+
}
295+
break;
296+
}
283297
case DLQ_GetPointerSize: {
284298
auto result = static_cast<uint8_t *>(outBuffer);
285299
*result = m_process.GetAddressByteSize();

lldb/unittests/Symbol/TestTypeSystemSwiftTypeRef.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ TEST_F(TestTypeSystemSwiftTypeRef, Function) {
126126
CompilerType void_void = GetCompilerType(b.Mangle(n));
127127
ASSERT_TRUE(void_void.IsFunctionType(nullptr));
128128
ASSERT_TRUE(void_void.IsFunctionPointerType());
129-
ASSERT_EQ(void_void.GetNumberOfFunctionArguments(), 0);
129+
ASSERT_EQ(void_void.GetNumberOfFunctionArguments(), 0UL);
130130
}
131131
{
132132
NodePointer n = b.GlobalType(
133133
b.Node(Node::Kind::ImplFunctionType, b.Node(Node::Kind::ImplEscaping),
134134
b.Node(Node::Kind::ImplConvention, "@callee_guaranteed")));
135135
CompilerType impl_void_void = GetCompilerType(b.Mangle(n));
136136
ASSERT_TRUE(impl_void_void.IsFunctionType(nullptr));
137-
ASSERT_EQ(impl_void_void.GetNumberOfFunctionArguments(), 0);
137+
ASSERT_EQ(impl_void_void.GetNumberOfFunctionArguments(), 0UL);
138138
}
139139
{
140140
NodePointer n = b.GlobalType(b.Node(
@@ -147,7 +147,7 @@ TEST_F(TestTypeSystemSwiftTypeRef, Function) {
147147
b.Node(Node::Kind::Tuple))));
148148
CompilerType impl_two_args = GetCompilerType(b.Mangle(n));
149149
ASSERT_TRUE(impl_two_args.IsFunctionType(nullptr));
150-
ASSERT_EQ(impl_two_args.GetNumberOfFunctionArguments(), 2);
150+
ASSERT_EQ(impl_two_args.GetNumberOfFunctionArguments(), 2UL);
151151
ASSERT_EQ(impl_two_args.GetFunctionArgumentAtIndex(0), int_type);
152152
ASSERT_EQ(impl_two_args.GetFunctionArgumentAtIndex(1), void_type);
153153
ASSERT_EQ(impl_two_args.GetFunctionArgumentTypeAtIndex(0), int_type);
@@ -167,7 +167,7 @@ TEST_F(TestTypeSystemSwiftTypeRef, Function) {
167167
b.Node(Node::Kind::Type, b.Node(Node::Kind::Tuple)))));
168168
CompilerType two_args = GetCompilerType(b.Mangle(n));
169169
ASSERT_TRUE(two_args.IsFunctionType(nullptr));
170-
ASSERT_EQ(two_args.GetNumberOfFunctionArguments(), 2);
170+
ASSERT_EQ(two_args.GetNumberOfFunctionArguments(), 2UL);
171171
ASSERT_EQ(two_args.GetFunctionArgumentAtIndex(0), int_type);
172172
ASSERT_EQ(two_args.GetFunctionArgumentAtIndex(1), void_type);
173173
ASSERT_EQ(two_args.GetFunctionArgumentTypeAtIndex(0), int_type);
@@ -306,7 +306,7 @@ TEST_F(TestTypeSystemSwiftTypeRef, Scalar) {
306306
uint32_t count = 99;
307307
bool is_complex = true;
308308
ASSERT_FALSE(int_type.IsFloatingPointType(count, is_complex));
309-
ASSERT_EQ(count, 0);
309+
ASSERT_EQ(count, 0UL);
310310
ASSERT_EQ(is_complex, false);
311311
bool is_signed = true;
312312
ASSERT_TRUE(int_type.IsIntegerType(is_signed));
@@ -318,7 +318,7 @@ TEST_F(TestTypeSystemSwiftTypeRef, Scalar) {
318318
uint32_t count = 99;
319319
bool is_complex = true;
320320
ASSERT_TRUE(float_type.IsFloatingPointType(count, is_complex));
321-
ASSERT_EQ(count, 1);
321+
ASSERT_EQ(count, 1UL);
322322
ASSERT_EQ(is_complex, false);
323323
bool is_signed = true;
324324
ASSERT_FALSE(float_type.IsIntegerType(is_signed));

0 commit comments

Comments
 (0)