[lldb] Remove unneeded .get() NFC

This commit is contained in:
Fangrui Song 2023-01-04 22:05:40 -08:00
parent 665e47777d
commit 4215a84559
8 changed files with 9 additions and 9 deletions

View File

@ -2704,7 +2704,7 @@ protected:
};
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);

View File

@ -254,5 +254,5 @@ EvaluateExpressionOptions *SBExpressionOptions::get() const {
}
EvaluateExpressionOptions &SBExpressionOptions::ref() const {
return *(m_opaque_up.get());
return *m_opaque_up;
}

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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;
}

View File

@ -67,7 +67,7 @@ private:
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);

View File

@ -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) {

View File

@ -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);
}
}