[Lldb-commits] [lldb] r317093 - Remove uint32_t assignment operator from Status

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 1 08:00:58 PDT 2017


Author: labath
Date: Wed Nov  1 08:00:58 2017
New Revision: 317093

URL: http://llvm.org/viewvc/llvm-project?rev=317093&view=rev
Log:
Remove uint32_t assignment operator from Status

Summary:
It is not presently used, and it's quite dangerous to use -- it assumes the
integer is an osx kern_return_t, but very few of the integers we have lying
around are mach kernel error codes. The error can still be used to a
mach error using a slightly longer (but more explicit) syntax.

Reviewers: jingham

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D35305

Modified:
    lldb/trunk/include/lldb/Utility/Status.h
    lldb/trunk/source/Utility/Status.cpp

Modified: lldb/trunk/include/lldb/Utility/Status.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Status.h?rev=317093&r1=317092&r2=317093&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Utility/Status.h (original)
+++ lldb/trunk/include/lldb/Utility/Status.h Wed Nov  1 08:00:58 2017
@@ -88,19 +88,6 @@ public:
   //------------------------------------------------------------------
   const Status &operator=(const Status &rhs);
 
-  //------------------------------------------------------------------
-  /// Assignment operator from a kern_return_t.
-  ///
-  /// Sets the type to \c MachKernel and the error code to \a err.
-  ///
-  /// @param[in] err
-  ///     A mach error code.
-  ///
-  /// @return
-  ///     A const reference to this object.
-  //------------------------------------------------------------------
-  const Status &operator=(uint32_t err);
-
   ~Status();
 
   // llvm::Error support

Modified: lldb/trunk/source/Utility/Status.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Status.cpp?rev=317093&r1=317092&r2=317093&view=diff
==============================================================================
--- lldb/trunk/source/Utility/Status.cpp (original)
+++ lldb/trunk/source/Utility/Status.cpp Wed Nov  1 08:00:58 2017
@@ -104,16 +104,6 @@ const Status &Status::operator=(const St
   return *this;
 }
 
-//----------------------------------------------------------------------
-// Assignment operator
-//----------------------------------------------------------------------
-const Status &Status::operator=(uint32_t err) {
-  m_code = err;
-  m_type = eErrorTypeMachKernel;
-  m_string.clear();
-  return *this;
-}
-
 Status::~Status() = default;
 
 //----------------------------------------------------------------------




More information about the lldb-commits mailing list