[LLDB][NFC] Fix incorrect return status Some functions always return 'false' for...
authorSlava Gurevich <sgurevich@gmail.com>
Tue, 2 Aug 2022 18:54:52 +0000 (11:54 -0700)
committerSlava Gurevich <sgurevich@gmail.com>
Tue, 2 Aug 2022 22:56:23 +0000 (15:56 -0700)
Differential Revision: https://reviews.llvm.org/D131013

lldb/source/Plugins/Language/ObjC/NSArray.cpp
lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
lldb/source/Plugins/Language/ObjC/NSSet.cpp

index adda04e..876efda 100644 (file)
@@ -532,9 +532,8 @@ lldb_private::formatters::
     process_sp->ReadMemory(data_location, m_data_64, sizeof(D64),
                            error);
   }
-  if (error.Fail())
-    return false;
-  return false;
+
+  return error.Success();
 }
 
 bool
@@ -675,9 +674,8 @@ lldb_private::formatters::GenericNSArrayISyntheticFrontEnd<D32, D64, Inline>::
     process_sp->ReadMemory(data_location, m_data_64, sizeof(D64),
                            error);
   }
-  if (error.Fail())
-    return false;
-  return false;
+
+  return error.Success();
 }
 
 template <typename D32, typename D64, bool Inline>
index e5e62b5..be74338 100644 (file)
@@ -1121,9 +1121,8 @@ lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<D32,D64>::
     process_sp->ReadMemory(data_location, m_data_64, sizeof(D64),
                            error);
   }
-  if (error.Fail())
-    return false;
-  return true;
+
+  return error.Success();
 }
 
 template <typename D32, typename D64>
@@ -1284,9 +1283,8 @@ lldb_private::formatters::Foundation1100::
     process_sp->ReadMemory(data_location, m_data_64, sizeof(DataDescriptor_64),
                            error);
   }
-  if (error.Fail())
-    return false;
-  return false;
+
+  return error.Success();
 }
 
 bool
index b5c8e84..fac8594 100644 (file)
@@ -461,7 +461,7 @@ bool lldb_private::formatters::NSSetISyntheticFrontEnd::Update() {
   if (error.Fail())
     return false;
   m_data_ptr = data_location + m_ptr_size;
-  return false;
+  return true;
 }
 
 bool lldb_private::formatters::NSSetISyntheticFrontEnd::MightHaveChildren() {
@@ -735,9 +735,7 @@ lldb_private::formatters::
     process_sp->ReadMemory(data_location, m_data_64, sizeof(D64),
                            error);
   }
-  if (error.Fail())
-    return false;
-  return false;
+  return error.Success();
 }
 
 template <typename D32, typename D64>