[Lldb-commits] [lldb] 4215a84 - [lldb] Remove unneeded .get() NFC

Fangrui Song via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 4 22:05:45 PST 2023


Author: Fangrui Song
Date: 2023-01-04T22:05:40-08:00
New Revision: 4215a84559bb872363eaa4ac724be8ef86c2e683

URL: https://github.com/llvm/llvm-project/commit/4215a84559bb872363eaa4ac724be8ef86c2e683
DIFF: https://github.com/llvm/llvm-project/commit/4215a84559bb872363eaa4ac724be8ef86c2e683.diff

LOG: [lldb] Remove unneeded .get() NFC

Added: 
    

Modified: 
    lldb/include/lldb/Target/Process.h
    lldb/source/API/SBExpressionOptions.cpp
    lldb/source/API/SBSourceManager.cpp
    lldb/source/Interpreter/ScriptInterpreter.cpp
    lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
    lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
    lldb/source/Target/Thread.cpp
    lldb/source/Target/ThreadPlanStack.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 47040137078f6..8bb8b85e22fbc 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2704,7 +2704,7 @@ void PruneThreadPlans();
   };
 
   void SetNextEventAction(Process::NextEventAction *next_event_action) {
-    if (m_next_event_action_up.get())
+    if (m_next_event_action_up)
       m_next_event_action_up->HandleBeingUnshipped();
 
     m_next_event_action_up.reset(next_event_action);

diff  --git a/lldb/source/API/SBExpressionOptions.cpp b/lldb/source/API/SBExpressionOptions.cpp
index d07acbc0aa2db..6ae57f24606af 100644
--- a/lldb/source/API/SBExpressionOptions.cpp
+++ b/lldb/source/API/SBExpressionOptions.cpp
@@ -254,5 +254,5 @@ EvaluateExpressionOptions *SBExpressionOptions::get() const {
 }
 
 EvaluateExpressionOptions &SBExpressionOptions::ref() const {
-  return *(m_opaque_up.get());
+  return *m_opaque_up;
 }

diff  --git a/lldb/source/API/SBSourceManager.cpp b/lldb/source/API/SBSourceManager.cpp
index 7729f5d9d69f8..68815026c464d 100644
--- a/lldb/source/API/SBSourceManager.cpp
+++ b/lldb/source/API/SBSourceManager.cpp
@@ -88,14 +88,14 @@ SBSourceManager::SBSourceManager(const SBSourceManager &rhs) {
   if (&rhs == this)
     return;
 
-  m_opaque_up = std::make_unique<SourceManagerImpl>(*(rhs.m_opaque_up.get()));
+  m_opaque_up = std::make_unique<SourceManagerImpl>(*rhs.m_opaque_up);
 }
 
 const lldb::SBSourceManager &SBSourceManager::
 operator=(const lldb::SBSourceManager &rhs) {
   LLDB_INSTRUMENT_VA(this, rhs);
 
-  m_opaque_up = std::make_unique<SourceManagerImpl>(*(rhs.m_opaque_up.get()));
+  m_opaque_up = std::make_unique<SourceManagerImpl>(*rhs.m_opaque_up);
   return *this;
 }
 

diff  --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp
index 0820755545622..9572176fdf7be 100644
--- a/lldb/source/Interpreter/ScriptInterpreter.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreter.cpp
@@ -82,7 +82,7 @@ ScriptInterpreter::GetDataExtractorFromSBData(const lldb::SBData &data) const {
 Status
 ScriptInterpreter::GetStatusFromSBError(const lldb::SBError &error) const {
   if (error.m_opaque_up)
-    return *error.m_opaque_up.get();
+    return *error.m_opaque_up;
 
   return Status();
 }

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
index 5f7bb1262f8cf..cba8191887900 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
@@ -116,7 +116,7 @@ std::shared_ptr<ClangModulesDeclVendor>
 ClangPersistentVariables::GetClangModulesDeclVendor() {
   if (!m_modules_decl_vendor_sp) {
     m_modules_decl_vendor_sp.reset(
-        ClangModulesDeclVendor::Create(*m_target_sp.get()));
+        ClangModulesDeclVendor::Create(*m_target_sp));
   }
   return m_modules_decl_vendor_sp;
 }

diff  --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
index 796e7e50a8b90..d03a8ce4e9241 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
@@ -67,7 +67,7 @@ class UnwindAssemblyInstEmulation : public lldb_private::UnwindAssembly {
         m_initial_sp(0), m_cfa_reg_info(), m_fp_is_cfa(false),
         m_register_values(), m_pushed_regs(), m_curr_row_modified(false),
         m_forward_branch_offset(0) {
-    if (m_inst_emulator_up.get()) {
+    if (m_inst_emulator_up) {
       m_inst_emulator_up->SetBaton(this);
       m_inst_emulator_up->SetCallbacks(ReadMemory, WriteMemory, ReadRegister,
                                        WriteRegister);

diff  --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 5b4c5db2d9286..10bdb51540616 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -1084,7 +1084,7 @@ ThreadPlanStack &Thread::GetPlans() const {
   // queries GetDescription makes, and only assert if you try to run the thread.
   if (!m_null_plan_stack_up)
     m_null_plan_stack_up = std::make_unique<ThreadPlanStack>(*this, true);
-  return *(m_null_plan_stack_up.get());
+  return *m_null_plan_stack_up;
 }
 
 void Thread::PushPlan(ThreadPlanSP thread_plan_sp) {

diff  --git a/lldb/source/Target/ThreadPlanStack.cpp b/lldb/source/Target/ThreadPlanStack.cpp
index ac7b44cef37d4..1572931429071 100644
--- a/lldb/source/Target/ThreadPlanStack.cpp
+++ b/lldb/source/Target/ThreadPlanStack.cpp
@@ -406,7 +406,7 @@ void ThreadPlanStackMap::Update(ThreadList &current_threads,
     for (auto thread : current_threads.Threads()) {
       lldb::tid_t cur_tid = thread->GetID();
       if (!Find(cur_tid)) {
-        AddThread(*thread.get());
+        AddThread(*thread);
         thread->QueueBasePlan(true);
       }
     }


        


More information about the lldb-commits mailing list