From b38c02047aed02a2969960ce442ebdb84924929f Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 1 Nov 2017 15:00:58 +0000 Subject: [PATCH] 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 llvm-svn: 317093 --- lldb/include/lldb/Utility/Status.h | 13 ------------- lldb/source/Utility/Status.cpp | 10 ---------- 2 files changed, 23 deletions(-) diff --git a/lldb/include/lldb/Utility/Status.h b/lldb/include/lldb/Utility/Status.h index d520ebd9..8c3e009 100644 --- a/lldb/include/lldb/Utility/Status.h +++ b/lldb/include/lldb/Utility/Status.h @@ -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 diff --git a/lldb/source/Utility/Status.cpp b/lldb/source/Utility/Status.cpp index b11a3db..a6a889a 100644 --- a/lldb/source/Utility/Status.cpp +++ b/lldb/source/Utility/Status.cpp @@ -104,16 +104,6 @@ const Status &Status::operator=(const Status &rhs) { 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; //---------------------------------------------------------------------- -- 2.7.4