diff options
52 files changed, 187 insertions, 191 deletions
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp index 0b315c427dd..1232b6e21e9 100644 --- a/lldb/source/Breakpoint/Breakpoint.cpp +++ b/lldb/source/Breakpoint/Breakpoint.cpp @@ -59,7 +59,7 @@ Breakpoint::Breakpoint(Target &target, SearchFilterSP &filter_sp, Breakpoint::Breakpoint(Target &new_target, Breakpoint &source_bp) : m_being_created(true), m_hardware(source_bp.m_hardware), m_target(new_target), m_name_list(source_bp.m_name_list), - m_options_up(new BreakpointOptions(*source_bp.m_options_up.get())), + m_options_up(new BreakpointOptions(*source_bp.m_options_up)), m_locations(*this), m_resolve_indirect_symbols(source_bp.m_resolve_indirect_symbols), m_hit_count(0) { diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp index 99a9982be9a..d59272c70d6 100644 --- a/lldb/source/Breakpoint/BreakpointLocation.cpp +++ b/lldb/source/Breakpoint/BreakpointLocation.cpp @@ -71,7 +71,7 @@ Target &BreakpointLocation::GetTarget() { return m_owner.GetTarget(); } bool BreakpointLocation::IsEnabled() const { if (!m_owner.IsEnabled()) return false; - else if (m_options_ap.get() != nullptr) + else if (m_options_ap != nullptr) return m_options_ap->IsEnabled(); else return true; @@ -107,7 +107,7 @@ void BreakpointLocation::SetThreadID(lldb::tid_t thread_id) { else { // If we're resetting this to an invalid thread id, then don't make an // options pointer just to do that. - if (m_options_ap.get() != nullptr) + if (m_options_ap != nullptr) m_options_ap->SetThreadID(thread_id); } SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged); @@ -129,7 +129,7 @@ void BreakpointLocation::SetThreadIndex(uint32_t index) { else { // If we're resetting this to an invalid thread id, then don't make an // options pointer just to do that. - if (m_options_ap.get() != nullptr) + if (m_options_ap != nullptr) m_options_ap->GetThreadSpec()->SetIndex(index); } SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged); @@ -151,7 +151,7 @@ void BreakpointLocation::SetThreadName(const char *thread_name) { else { // If we're resetting this to an invalid thread id, then don't make an // options pointer just to do that. - if (m_options_ap.get() != nullptr) + if (m_options_ap != nullptr) m_options_ap->GetThreadSpec()->SetName(thread_name); } SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged); @@ -173,7 +173,7 @@ void BreakpointLocation::SetQueueName(const char *queue_name) { else { // If we're resetting this to an invalid thread id, then don't make an // options pointer just to do that. - if (m_options_ap.get() != nullptr) + if (m_options_ap != nullptr) m_options_ap->GetThreadSpec()->SetQueueName(queue_name); } SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged); @@ -190,7 +190,7 @@ const char *BreakpointLocation::GetQueueName() const { } bool BreakpointLocation::InvokeCallback(StoppointCallbackContext *context) { - if (m_options_ap.get() != nullptr && m_options_ap->HasCallback()) + if (m_options_ap != nullptr && m_options_ap->HasCallback()) return m_options_ap->InvokeCallback(context, m_owner.GetID(), GetID()); else return m_owner.InvokeCallback(context, GetID()); @@ -344,7 +344,7 @@ void BreakpointLocation::SetIgnoreCount(uint32_t n) { } void BreakpointLocation::DecrementIgnoreCount() { - if (m_options_ap.get() != nullptr) { + if (m_options_ap != nullptr) { uint32_t loc_ignore = m_options_ap->GetIgnoreCount(); if (loc_ignore != 0) m_options_ap->SetIgnoreCount(loc_ignore - 1); @@ -352,7 +352,7 @@ void BreakpointLocation::DecrementIgnoreCount() { } bool BreakpointLocation::IgnoreCountShouldStop() { - if (m_options_ap.get() != nullptr) { + if (m_options_ap != nullptr) { uint32_t loc_ignore = m_options_ap->GetIgnoreCount(); if (loc_ignore != 0) { m_owner.DecrementIgnoreCount(); @@ -369,7 +369,7 @@ BreakpointOptions *BreakpointLocation::GetLocationOptions() { // If we make the copy we don't copy the callbacks because that is // potentially expensive and we don't want to do that for the simple case // where someone is just disabling the location. - if (m_options_ap.get() == nullptr) + if (m_options_ap == nullptr) m_options_ap.reset( new BreakpointOptions(false)); @@ -603,7 +603,7 @@ void BreakpointLocation::GetDescription(Stream *s, s->Indent(); s->Printf("hit count = %-4u\n", GetHitCount()); - if (m_options_ap.get()) { + if (m_options_ap) { s->Indent(); m_options_ap->GetDescription(s, level); s->EOL(); @@ -612,7 +612,7 @@ void BreakpointLocation::GetDescription(Stream *s, } else if (level != eDescriptionLevelInitial) { s->Printf(", %sresolved, hit count = %u ", (IsResolved() ? "" : "un"), GetHitCount()); - if (m_options_ap.get()) { + if (m_options_ap) { m_options_ap->GetDescription(s, level); } } @@ -624,18 +624,18 @@ void BreakpointLocation::Dump(Stream *s) const { lldb::tid_t tid = GetOptionsSpecifyingKind(BreakpointOptions::eThreadSpec) ->GetThreadSpecNoCreate()->GetTID(); - s->Printf( - "BreakpointLocation %u: tid = %4.4" PRIx64 " load addr = 0x%8.8" PRIx64 - " state = %s type = %s breakpoint " - "hw_index = %i hit_count = %-4u ignore_count = %-4u", - GetID(), tid, - (uint64_t)m_address.GetOpcodeLoadAddress(&m_owner.GetTarget()), - (m_options_ap.get() ? m_options_ap->IsEnabled() : m_owner.IsEnabled()) - ? "enabled " - : "disabled", - IsHardware() ? "hardware" : "software", GetHardwareIndex(), GetHitCount(), - GetOptionsSpecifyingKind(BreakpointOptions::eIgnoreCount) - ->GetIgnoreCount()); + s->Printf("BreakpointLocation %u: tid = %4.4" PRIx64 + " load addr = 0x%8.8" PRIx64 " state = %s type = %s breakpoint " + "hw_index = %i hit_count = %-4u ignore_count = %-4u", + GetID(), tid, + (uint64_t)m_address.GetOpcodeLoadAddress(&m_owner.GetTarget()), + (m_options_ap ? m_options_ap->IsEnabled() : m_owner.IsEnabled()) + ? "enabled " + : "disabled", + IsHardware() ? "hardware" : "software", GetHardwareIndex(), + GetHitCount(), + GetOptionsSpecifyingKind(BreakpointOptions::eIgnoreCount) + ->GetIgnoreCount()); } void BreakpointLocation::SendBreakpointLocationChangedEvent( diff --git a/lldb/source/Breakpoint/BreakpointLocationList.cpp b/lldb/source/Breakpoint/BreakpointLocationList.cpp index 577dcdf808a..ee586127ee7 100644 --- a/lldb/source/Breakpoint/BreakpointLocationList.cpp +++ b/lldb/source/Breakpoint/BreakpointLocationList.cpp @@ -129,7 +129,7 @@ void BreakpointLocationList::Dump(Stream *s) const { s->IndentMore(); collection::const_iterator pos, end = m_locations.end(); for (pos = m_locations.begin(); pos != end; ++pos) - (*pos).get()->Dump(s); + (*pos)->Dump(s); s->IndentLess(); } diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp index 6467d261961..8bd732e776d 100644 --- a/lldb/source/Breakpoint/BreakpointOptions.cpp +++ b/lldb/source/Breakpoint/BreakpointOptions.cpp @@ -158,8 +158,8 @@ BreakpointOptions::BreakpointOptions(const BreakpointOptions &rhs) m_ignore_count(rhs.m_ignore_count), m_thread_spec_ap(), m_auto_continue(rhs.m_auto_continue), m_set_flags(rhs.m_set_flags) { - if (rhs.m_thread_spec_ap.get() != nullptr) - m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap.get())); + if (rhs.m_thread_spec_ap != nullptr) + m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap)); m_condition_text = rhs.m_condition_text; m_condition_text_hash = rhs.m_condition_text_hash; } @@ -176,8 +176,8 @@ operator=(const BreakpointOptions &rhs) { m_enabled = rhs.m_enabled; m_one_shot = rhs.m_one_shot; m_ignore_count = rhs.m_ignore_count; - if (rhs.m_thread_spec_ap.get() != nullptr) - m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap.get())); + if (rhs.m_thread_spec_ap != nullptr) + m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap)); m_condition_text = rhs.m_condition_text; m_condition_text_hash = rhs.m_condition_text_hash; m_auto_continue = rhs.m_auto_continue; @@ -231,9 +231,9 @@ void BreakpointOptions::CopyOverSetOptions(const BreakpointOptions &incoming) if (incoming.m_set_flags.Test(eThreadSpec) && incoming.m_thread_spec_ap) { if (!m_thread_spec_ap) - m_thread_spec_ap.reset(new ThreadSpec(*incoming.m_thread_spec_ap.get())); + m_thread_spec_ap.reset(new ThreadSpec(*incoming.m_thread_spec_ap)); else - *m_thread_spec_ap.get() = *incoming.m_thread_spec_ap.get(); + *m_thread_spec_ap = *incoming.m_thread_spec_ap; m_set_flags.Set(eThreadSpec); } } @@ -327,7 +327,7 @@ std::unique_ptr<BreakpointOptions> BreakpointOptions::CreateFromStructuredData( auto bp_options = llvm::make_unique<BreakpointOptions>( condition_ref.str().c_str(), enabled, ignore_count, one_shot, auto_continue); - if (cmd_data_up.get()) { + if (cmd_data_up) { if (cmd_data_up->interpreter == eScriptLanguageNone) bp_options->SetCommandDataCallback(cmd_data_up); else { @@ -525,8 +525,7 @@ const ThreadSpec *BreakpointOptions::GetThreadSpecNoCreate() const { } ThreadSpec *BreakpointOptions::GetThreadSpec() { - if (m_thread_spec_ap.get() == nullptr) - { + if (m_thread_spec_ap == nullptr) { m_set_flags.Set(eThreadSpec); m_thread_spec_ap.reset(new ThreadSpec()); } @@ -573,7 +572,7 @@ void BreakpointOptions::GetDescription(Stream *s, if (m_auto_continue) s->Printf("auto-continue "); - if (m_thread_spec_ap.get()) + if (m_thread_spec_ap) m_thread_spec_ap->GetDescription(s, level); if (level == lldb::eDescriptionLevelFull) { diff --git a/lldb/source/Breakpoint/BreakpointSiteList.cpp b/lldb/source/Breakpoint/BreakpointSiteList.cpp index 579c933d99f..7a986fd8398 100644 --- a/lldb/source/Breakpoint/BreakpointSiteList.cpp +++ b/lldb/source/Breakpoint/BreakpointSiteList.cpp @@ -85,7 +85,7 @@ public: BreakpointSiteIDMatches(lldb::break_id_t break_id) : m_break_id(break_id) {} bool operator()(std::pair<lldb::addr_t, BreakpointSiteSP> val_pair) const { - return m_break_id == val_pair.second.get()->GetID(); + return m_break_id == val_pair.second->GetID(); } private: @@ -157,7 +157,7 @@ void BreakpointSiteList::Dump(Stream *s) const { collection::const_iterator pos; collection::const_iterator end = m_bp_site_list.end(); for (pos = m_bp_site_list.begin(); pos != end; ++pos) - pos->second.get()->Dump(s); + pos->second->Dump(s); s->IndentLess(); } diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp index 77e98632e67..844d8bb5839 100644 --- a/lldb/source/Breakpoint/Watchpoint.cpp +++ b/lldb/source/Breakpoint/Watchpoint.cpp @@ -272,7 +272,7 @@ bool Watchpoint::InvokeCallback(StoppointCallbackContext *context) { void Watchpoint::SetCondition(const char *condition) { if (condition == nullptr || condition[0] == '\0') { - if (m_condition_ap.get()) + if (m_condition_ap) m_condition_ap.reset(); } else { // Pass nullptr for expr_prefix (no translation-unit level definitions). @@ -290,7 +290,7 @@ void Watchpoint::SetCondition(const char *condition) { } const char *Watchpoint::GetConditionText() const { - if (m_condition_ap.get()) + if (m_condition_ap) return m_condition_ap->GetUserText(); else return nullptr; diff --git a/lldb/source/Breakpoint/WatchpointOptions.cpp b/lldb/source/Breakpoint/WatchpointOptions.cpp index 1898486221b..8c796b7de51 100644 --- a/lldb/source/Breakpoint/WatchpointOptions.cpp +++ b/lldb/source/Breakpoint/WatchpointOptions.cpp @@ -39,8 +39,8 @@ WatchpointOptions::WatchpointOptions(const WatchpointOptions &rhs) : m_callback(rhs.m_callback), m_callback_baton_sp(rhs.m_callback_baton_sp), m_callback_is_synchronous(rhs.m_callback_is_synchronous), m_thread_spec_ap() { - if (rhs.m_thread_spec_ap.get() != nullptr) - m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap.get())); + if (rhs.m_thread_spec_ap != nullptr) + m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap)); } //---------------------------------------------------------------------- @@ -51,8 +51,8 @@ operator=(const WatchpointOptions &rhs) { m_callback = rhs.m_callback; m_callback_baton_sp = rhs.m_callback_baton_sp; m_callback_is_synchronous = rhs.m_callback_is_synchronous; - if (rhs.m_thread_spec_ap.get() != nullptr) - m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap.get())); + if (rhs.m_thread_spec_ap != nullptr) + m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap)); return *this; } @@ -117,7 +117,7 @@ const ThreadSpec *WatchpointOptions::GetThreadSpecNoCreate() const { } ThreadSpec *WatchpointOptions::GetThreadSpec() { - if (m_thread_spec_ap.get() == nullptr) + if (m_thread_spec_ap == nullptr) m_thread_spec_ap.reset(new ThreadSpec()); return m_thread_spec_ap.get(); @@ -152,7 +152,7 @@ void WatchpointOptions::GetDescription(Stream *s, } else s->PutCString(" Options: "); - if (m_thread_spec_ap.get()) + if (m_thread_spec_ap) m_thread_spec_ap->GetDescription(s, level); else if (level == eDescriptionLevelBrief) s->PutCString("thread spec: no "); diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp index c0431848f4f..db28b58bca9 100644 --- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp +++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp @@ -141,7 +141,7 @@ void ValueObjectSynthetic::CreateSynthFilter() { } } m_synth_filter_ap = (m_synth_sp->GetFrontEnd(*valobj_for_frontend)); - if (!m_synth_filter_ap.get()) + if (!m_synth_filter_ap) m_synth_filter_ap = llvm::make_unique<DummySyntheticFrontEnd>(*m_parent); } @@ -235,7 +235,7 @@ lldb::ValueObjectSP ValueObjectSynthetic::GetChildAtIndex(size_t idx, ValueObject *valobj; if (!m_children_byindex.GetValueForKey(idx, valobj)) { - if (can_create && m_synth_filter_ap.get() != nullptr) { + if (can_create && m_synth_filter_ap != nullptr) { if (log) log->Printf("[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at " "index %zu not cached and will be created", @@ -301,13 +301,13 @@ size_t ValueObjectSynthetic::GetIndexOfChildWithName(const ConstString &name) { uint32_t found_index = UINT32_MAX; bool did_find = m_name_toindex.GetValueForKey(name.GetCString(), found_index); - if (!did_find && m_synth_filter_ap.get() != nullptr) { + if (!did_find && m_synth_filter_ap != nullptr) { uint32_t index = m_synth_filter_ap->GetIndexOfChildWithName(name); if (index == UINT32_MAX) return index; m_name_toindex.SetValueForKey(name.GetCString(), index); return index; - } else if (!did_find && m_synth_filter_ap.get() == nullptr) + } else if (!did_find && m_synth_filter_ap == nullptr) return UINT32_MAX; else /*if (iter != m_name_toindex.end())*/ return found_index; diff --git a/lldb/source/DataFormatters/TypeCategoryMap.cpp b/lldb/source/DataFormatters/TypeCategoryMap.cpp index 51bb01afcc8..92ee065835f 100644 --- a/lldb/source/DataFormatters/TypeCategoryMap.cpp +++ b/lldb/source/DataFormatters/TypeCategoryMap.cpp @@ -111,7 +111,7 @@ void TypeCategoryMap::EnableAllCategories() { decltype(sorted_categories)::iterator viter = sorted_categories.begin(), vend = sorted_categories.end(); for (; viter != vend; viter++) - if (viter->get()) + if (*viter) Enable(*viter, Last); } diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp index 4420979279e..19b3d076d32 100644 --- a/lldb/source/Expression/IRExecutionUnit.cpp +++ b/lldb/source/Expression/IRExecutionUnit.cpp @@ -294,7 +294,7 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr, m_strip_underscore = (m_execution_engine_ap->getDataLayout().getGlobalPrefix() == '_'); - if (!m_execution_engine_ap.get()) { + if (!m_execution_engine_ap) { error.SetErrorToGenericError(); error.SetErrorStringWithFormat("Couldn't JIT the function: %s", error_string.c_str()); diff --git a/lldb/source/Expression/LLVMUserExpression.cpp b/lldb/source/Expression/LLVMUserExpression.cpp index 3b628243507..9ee9c04ada9 100644 --- a/lldb/source/Expression/LLVMUserExpression.cpp +++ b/lldb/source/Expression/LLVMUserExpression.cpp @@ -115,10 +115,9 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager, function_stack_bottom = m_stack_frame_bottom; function_stack_top = m_stack_frame_top; - IRInterpreter::Interpret(*module, *function, args, - *m_execution_unit_sp.get(), interpreter_error, - function_stack_bottom, function_stack_top, - exe_ctx); + IRInterpreter::Interpret(*module, *function, args, *m_execution_unit_sp, + interpreter_error, function_stack_bottom, + function_stack_top, exe_ctx); if (!interpreter_error.Success()) { diagnostic_manager.Printf(eDiagnosticSeverityError, diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp index 512e7c58702..04fbf17ff6e 100644 --- a/lldb/source/Host/common/File.cpp +++ b/lldb/source/Host/common/File.cpp @@ -532,7 +532,7 @@ Status File::Read(size_t &num_bytes, off_t &offset, bool null_terminate, data_heap_ap.reset(new DataBufferHeap()); data_heap_ap->SetByteSize(num_bytes_plus_nul_char); - if (data_heap_ap.get()) { + if (data_heap_ap) { error = Read(data_heap_ap->GetBytes(), num_bytes, offset); if (error.Success()) { // Make sure we read exactly what we asked for and if we got diff --git a/lldb/source/Host/common/Terminal.cpp b/lldb/source/Host/common/Terminal.cpp index f61d755ddef..b6d6f56704c 100644 --- a/lldb/source/Host/common/Terminal.cpp +++ b/lldb/source/Host/common/Terminal.cpp @@ -118,7 +118,7 @@ bool TerminalState::Save(int fd, bool save_process_group) { m_tflags = ::fcntl(fd, F_GETFL, 0); #endif #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED - if (m_termios_ap.get() == NULL) + if (m_termios_ap == NULL) m_termios_ap.reset(new struct termios); int err = ::tcgetattr(fd, m_termios_ap.get()); if (err != 0) @@ -191,7 +191,7 @@ bool TerminalState::TFlagsIsValid() const { return m_tflags != -1; } //---------------------------------------------------------------------- bool TerminalState::TTYStateIsValid() const { #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED - return m_termios_ap.get() != 0; + return m_termios_ap != 0; #else return false; #endif diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 2ec59565438..77883b389e2 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -554,7 +554,7 @@ void CommandInterpreter::LoadCommandDictionary() { CommandCompletions::eSourceFileCompletion, false)); - if (break_regex_cmd_ap.get()) { + if (break_regex_cmd_ap) { bool success = true; for (size_t i = 0; i < num_regexes; i++) { success = break_regex_cmd_ap->AddRegexCommand(break_regexes[i][0], @@ -603,7 +603,7 @@ void CommandInterpreter::LoadCommandDictionary() { CommandCompletions::eSourceFileCompletion, false)); - if (tbreak_regex_cmd_ap.get()) { + if (tbreak_regex_cmd_ap) { bool success = true; for (size_t i = 0; i < num_regexes; i++) { // If you add a resultant command string longer than 1024 characters be @@ -632,7 +632,7 @@ void CommandInterpreter::LoadCommandDictionary() { new CommandObjectRegexCommand( *this, "_regexp-attach", "Attach to process by ID or name.", "_regexp-attach <pid> | <process-name>", 2, 0, false)); - if (attach_regex_cmd_ap.get()) { + if (attach_regex_cmd_ap) { if (attach_regex_cmd_ap->AddRegexCommand("^([0-9]+)[[:space:]]*$", "process attach --pid %1") && attach_regex_cmd_ap->AddRegexCommand( @@ -654,7 +654,7 @@ void CommandInterpreter::LoadCommandDictionary() { "moving one frame, a numeric argument can " "specify an arbitrary number.", "_regexp-down [<count>]", 2, 0, false)); - if (down_regex_cmd_ap.get()) { + if (down_regex_cmd_ap) { if (down_regex_cmd_ap->AddRegexCommand("^$", "frame select -r -1") && down_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", "frame select -r -%1")) { @@ -669,7 +669,7 @@ void CommandInterpreter::LoadCommandDictionary() { "Select an older stack frame. Defaults to moving one " "frame, a numeric argument can specify an arbitrary number.", "_regexp-up [<count>]", 2, 0, false)); - if (up_regex_cmd_ap.get()) { + if (up_regex_cmd_ap) { if (up_regex_cmd_ap->AddRegexCommand("^$", "frame select -r 1") && up_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", "frame select -r %1")) { CommandObjectSP up_regex_cmd_sp(up_regex_cmd_ap.release()); @@ -682,7 +682,7 @@ void CommandInterpreter::LoadCommandDictionary() { *this, "_regexp-display", "Evaluate an expression at every stop (see 'help target stop-hook'.)", "_regexp-display expression", 2, 0, false)); - if (display_regex_cmd_ap.get()) { + if (display_regex_cmd_ap) { if (display_regex_cmd_ap->AddRegexCommand( "^(.+)$", "target stop-hook add -o \"expr -- %1\"")) { CommandObjectSP display_regex_cmd_sp(display_regex_cmd_ap.release()); @@ -696,7 +696,7 @@ void CommandInterpreter::LoadCommandDictionary() { *this, "_regexp-undisplay", "Stop displaying expression at every " "stop (specified by stop-hook index.)", "_regexp-undisplay stop-hook-number", 2, 0, false)); - if (undisplay_regex_cmd_ap.get()) { + if (undisplay_regex_cmd_ap) { if (undisplay_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", "target stop-hook delete %1")) { CommandObjectSP undisplay_regex_cmd_sp(undisplay_regex_cmd_ap.release()); @@ -710,7 +710,7 @@ void CommandInterpreter::LoadCommandDictionary() { *this, "gdb-remote", "Connect to a process via remote GDB server. " "If no host is specifed, localhost is assumed.", "gdb-remote [<hostname>:]<portnum>", 2, 0, false)); - if (connect_gdb_remote_cmd_ap.get()) { + if (connect_gdb_remote_cmd_ap) { if (connect_gdb_remote_cmd_ap->AddRegexCommand( "^([^:]+|\\[[0-9a-fA-F:]+.*\\]):([0-9]+)$", "process connect --plugin gdb-remote connect://%1:%2") && @@ -728,7 +728,7 @@ void CommandInterpreter::LoadCommandDictionary() { "If no UDP port is specified, port 41139 is " "assumed.", "kdp-remote <hostname>[:<portnum>]", 2, 0, false)); - if (connect_kdp_remote_cmd_ap.get()) { + if (connect_kdp_remote_cmd_ap) { if (connect_kdp_remote_cmd_ap->AddRegexCommand( "^([^:]+:[[:digit:]]+)$", "process connect --plugin kdp-remote udp://%1") && @@ -746,7 +746,7 @@ void CommandInterpreter::LoadCommandDictionary() { "displays at most that many " "frames. The argument 'all' displays all threads.", "bt [<digit> | all]", 2, 0, false)); - if (bt_regex_cmd_ap.get()) { + if (bt_regex_cmd_ap) { // accept but don't document "bt -c <number>" -- before bt was a regex // command if you wanted to backtrace three frames you would do "bt -c 3" // but the intention is to have this emulate the gdb "bt" command and so @@ -775,7 +775,7 @@ void CommandInterpreter::LoadCommandDictionary() { "_regexp-list -[<count>] // List previous <count> lines\n" "_regexp-list // List subsequent lines", 2, CommandCompletions::eSourceFileCompletion, false)); - if (list_regex_cmd_ap.get()) { + if (list_regex_cmd_ap) { if (list_regex_cmd_ap->AddRegexCommand("^([0-9]+)[[:space:]]*$", "source list --line %1") && list_regex_cmd_ap->AddRegexCommand( @@ -806,7 +806,7 @@ void CommandInterpreter::LoadCommandDictionary() { "_regexp-env // Show enrivonment\n" "_regexp-env <name>=<value> // Set an environment variable", 2, 0, false)); - if (env_regex_cmd_ap.get()) { + if (env_regex_cmd_ap) { if (env_regex_cmd_ap->AddRegexCommand("^$", "settings show target.env-vars") && env_regex_cmd_ap->AddRegexCommand("^([A-Za-z_][A-Za-z_0-9]*=.*)$", @@ -825,7 +825,7 @@ void CommandInterpreter::LoadCommandDictionary() { "_regexp-jump <file>:<line>\n" "_regexp-jump *<addr>\n", 2, 0, false)); - if (jump_regex_cmd_ap.get()) { + if (jump_regex_cmd_ap) { if (jump_regex_cmd_ap->AddRegexCommand("^\\*(.*)$", "thread jump --addr %1") && jump_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp index b90ba241749..24a42d7baf0 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -637,7 +637,7 @@ addr_t DynamicLoaderPOSIXDYLD::GetEntryPoint() { if (m_entry_point != LLDB_INVALID_ADDRESS) return m_entry_point; - if (m_auxv.get() == NULL) + if (m_auxv == NULL) return LLDB_INVALID_ADDRESS; AuxVector::iterator I = m_auxv->FindEntry(AuxVector::AUXV_AT_ENTRY); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp index cc85ff36b73..24ca970d9fc 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -132,7 +132,7 @@ void ClangExpressionDeclMap::DidParse() { if (log) ClangASTMetrics::DumpCounters(log); - if (m_parser_vars.get()) { + if (m_parser_vars) { for (size_t entity_index = 0, num_entities = m_found_entities.GetSize(); entity_index < num_entities; ++entity_index) { ExpressionVariableSP var_sp( diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp index a2231307381..f19eff64374 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -486,7 +486,7 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope, m_file_manager.reset(new clang::FileManager(file_system_options)); if (!m_compiler->hasSourceManager()) - m_compiler->createSourceManager(*m_file_manager.get()); + m_compiler->createSourceManager(*m_file_manager); m_compiler->createFileManager(); m_compiler->createPreprocessor(TU_Complete); @@ -1051,7 +1051,7 @@ lldb_private::Status ClangExpressionParser::PrepareForExecution( std::unique_ptr<llvm::Module> llvm_module_ap( m_code_generator->ReleaseModule()); - if (!llvm_module_ap.get()) { + if (!llvm_module_ap) { err.SetErrorToGenericError(); err.SetErrorString("IR doesn't contain a module"); return err; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp index f9672378350..fb72d673e98 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp @@ -63,11 +63,9 @@ ClangUserExpression::ClangUserExpression( ValueObject *ctx_obj) : LLVMUserExpression(exe_scope, expr, prefix, language, desired_type, options), - m_type_system_helper(*m_target_wp.lock().get(), - options.GetExecutionPolicy() == - eExecutionPolicyTopLevel), - m_result_delegate(exe_scope.CalculateTarget()), - m_ctx_obj(ctx_obj) { + m_type_system_helper(*m_target_wp.lock(), options.GetExecutionPolicy() == + eExecutionPolicyTopLevel), + m_result_delegate(exe_scope.CalculateTarget()), m_ctx_obj(ctx_obj) { switch (m_language) { case lldb::eLanguageTypeC_plus_plus: m_allow_cxx = true; @@ -824,7 +822,7 @@ ClangUserExpression::ClangUserExpressionHelper::ASTTransformer( } void ClangUserExpression::ClangUserExpressionHelper::CommitPersistentDecls() { - if (m_result_synthesizer_up.get()) { + if (m_result_synthesizer_up) { m_result_synthesizer_up->CommitPersistentDecls(); } } diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp index dae19f2dbdc..fb54aaaf259 100644 --- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -742,13 +742,13 @@ EmulateInstructionARM::CreateInstance(const ArchSpec &arch, std::unique_ptr<EmulateInstructionARM> emulate_insn_ap( new EmulateInstructionARM(arch)); - if (emulate_insn_ap.get()) + if (emulate_insn_ap) return emulate_insn_ap.release(); } else if (arch.GetTriple().getArch() == llvm::Triple::thumb) { std::unique_ptr<EmulateInstructionARM> emulate_insn_ap( new EmulateInstructionARM(arch)); - if (emulate_insn_ap.get()) + if (emulate_insn_ap) return emulate_insn_ap.release(); } } diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index 81059eb95bd..6081af6464f 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -217,7 +217,7 @@ lldb::ModuleSP AppleObjCRuntime::GetObjCModule() { } Address *AppleObjCRuntime::GetPrintForDebuggerAddr() { - if (!m_PrintForDebugger_addr.get()) { + if (!m_PrintForDebugger_addr) { const ModuleList &modules = m_process->GetTarget().GetImages(); SymbolContextList contexts; @@ -329,7 +329,7 @@ bool AppleObjCRuntime::ReadObjCLibrary(const ModuleSP &module_sp) { // reread it? m_objc_trampoline_handler_ap.reset( new AppleObjCTrampolineHandler(m_process->shared_from_this(), module_sp)); - if (m_objc_trampoline_handler_ap.get() != NULL) { + if (m_objc_trampoline_handler_ap != NULL) { m_read_objc_library = true; return true; } else @@ -339,7 +339,7 @@ bool AppleObjCRuntime::ReadObjCLibrary(const ModuleSP &module_sp) { ThreadPlanSP AppleObjCRuntime::GetStepThroughTrampolinePlan(Thread &thread, bool stop_others) { ThreadPlanSP thread_plan_sp; - if (m_objc_trampoline_handler_ap.get()) + if (m_objc_trampoline_handler_ap) thread_plan_sp = m_objc_trampoline_handler_ap->GetStepThroughDispatchPlan( thread, stop_others); return thread_plan_sp; @@ -470,8 +470,8 @@ ValueObjectSP AppleObjCRuntime::GetExceptionObjectForThread( if (!cpp_runtime) return ValueObjectSP(); auto cpp_exception = cpp_runtime->GetExceptionObjectForThread(thread_sp); if (!cpp_exception) return ValueObjectSP(); - - auto descriptor = GetClassDescriptor(*cpp_exception.get()); + + auto descriptor = GetClassDescriptor(*cpp_exception); if (!descriptor || !descriptor->IsValid()) return ValueObjectSP(); while (descriptor) { diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index cd7f332c61e..85ffc79966c 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -1148,7 +1148,7 @@ bool AppleObjCRuntimeV2::HashTableSignature::NeedsUpdate( ObjCLanguageRuntime::ClassDescriptorSP AppleObjCRuntimeV2::GetClassDescriptorFromISA(ObjCISA isa) { ObjCLanguageRuntime::ClassDescriptorSP class_descriptor_sp; - if (m_non_pointer_isa_cache_ap.get()) + if (m_non_pointer_isa_cache_ap) class_descriptor_sp = m_non_pointer_isa_cache_ap->GetClassDescriptor(isa); if (!class_descriptor_sp) class_descriptor_sp = ObjCLanguageRuntime::GetClassDescriptorFromISA(isa); @@ -1310,7 +1310,7 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic( ValueList arguments; FunctionCaller *get_class_info_function = nullptr; - if (!m_get_class_info_code.get()) { + if (!m_get_class_info_code) { Status error; m_get_class_info_code.reset(GetTargetRef().GetUtilityFunctionForLanguage( g_get_dynamic_class_info_body, eLanguageTypeObjC, @@ -1332,7 +1332,7 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic( m_get_class_info_code.reset(); } } - if (!m_get_class_info_code.get()) + if (!m_get_class_info_code) return DescriptorMapUpdateResult::Fail(); // Next make the runner function for our implementation utility function. @@ -1565,7 +1565,7 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() { ValueList arguments; FunctionCaller *get_shared_cache_class_info_function = nullptr; - if (!m_get_shared_cache_class_info_code.get()) { + if (!m_get_shared_cache_class_info_code) { Status error; m_get_shared_cache_class_info_code.reset( GetTargetRef().GetUtilityFunctionForLanguage( @@ -1589,7 +1589,7 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() { } } - if (!m_get_shared_cache_class_info_code.get()) + if (!m_get_shared_cache_class_info_code) return DescriptorMapUpdateResult::Fail(); // Next make the function caller for our implementation utility function. @@ -1946,7 +1946,7 @@ AppleObjCRuntimeV2::GetActualTypeName(ObjCLanguageRuntime::ObjCISA isa) { } DeclVendor *AppleObjCRuntimeV2::GetDeclVendor() { - if (!m_decl_vendor_ap.get()) + if (!m_decl_vendor_ap) m_decl_vendor_ap.reset(new AppleObjCDeclVendor(*this)); return m_decl_vendor_ap.get(); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp index bd748448336..4270d2a7c4b 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -749,7 +749,7 @@ AppleObjCTrampolineHandler::AppleObjCTrampolineHandler( // Build our vtable dispatch handler here: m_vtables_ap.reset(new AppleObjCVTables(process_sp, m_objc_module_sp)); - if (m_vtables_ap.get()) + if (m_vtables_ap) m_vtables_ap->ReadRegions(); } @@ -770,7 +770,7 @@ AppleObjCTrampolineHandler::SetupDispatchFunction(Thread &thread, // First stage is to make the ClangUtility to hold our injected function: - if (!m_impl_code.get()) { + if (!m_impl_code) { if (m_lookup_implementation_function_code != NULL) { Status error; m_impl_code.reset(exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage( @@ -864,7 +864,7 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread, if (!found_it) { uint32_t flags; - if (m_vtables_ap.get()) { + if (m_vtables_ap) { found_it = m_vtables_ap->IsAddressInVTables(curr_pc, flags); if (found_it) { this_dispatch.name = "vtable"; diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index 3e32d15984b..64de171549e 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -325,7 +325,7 @@ ObjectContainer *ObjectContainerBSDArchive::CreateInstance( archive_data_offset, file, file_offset, length)); - if (container_ap.get()) { + if (container_ap) { if (archive_sp) { // We already have this archive in our cache, use it container_ap->SetArchive(archive_sp); @@ -344,7 +344,7 @@ ObjectContainer *ObjectContainerBSDArchive::CreateInstance( new ObjectContainerBSDArchive(module_sp, data_sp, data_offset, file, file_offset, length)); - if (container_ap.get()) { + if (container_ap) { // We already have this archive in our cache, use it container_ap->SetArchive(archive_sp); return container_ap.release(); diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 521e8750858..eaafa84db03 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1057,7 +1057,7 @@ Address ObjectFileELF::GetBaseAddress() { // ParseDependentModules //---------------------------------------------------------------------- size_t ObjectFileELF::ParseDependentModules() { - if (m_filespec_ap.get()) + if (m_filespec_ap) return m_filespec_ap->GetSize(); m_filespec_ap.reset(new FileSpecList()); @@ -2805,7 +2805,7 @@ Symtab *ObjectFileELF::GetSymtab() { if (module_obj_file && module_obj_file != this) return module_obj_file->GetSymtab(); - if (m_symtab_ap.get() == NULL) { + if (m_symtab_ap == NULL) { SectionList *section_list = module_sp->GetSectionList(); if (!section_list) return NULL; diff --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp index ec5500622a4..46daa5e9c21 100644 --- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp +++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp @@ -115,7 +115,7 @@ Symtab *ObjectFileJIT::GetSymtab() { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_symtab_ap.get() == NULL) { + if (m_symtab_ap == NULL) { m_symtab_ap.reset(new Symtab(this)); std::lock_guard<std::recursive_mutex> symtab_guard( m_symtab_ap->GetMutex()); @@ -134,7 +134,7 @@ bool ObjectFileJIT::IsStripped() { } void ObjectFileJIT::CreateSections(SectionList &unified_section_list) { - if (!m_sections_ap.get()) { + if (!m_sections_ap) { m_sections_ap.reset(new SectionList()); ObjectFileJITDelegateSP delegate_sp(m_delegate_wp.lock()); if (delegate_sp) { @@ -161,7 +161,7 @@ void ObjectFileJIT::Dump(Stream *s) { if (sections) sections->Dump(s, NULL, true, UINT32_MAX); - if (m_symtab_ap.get()) + if (m_symtab_ap) m_symtab_ap->Dump(s, NULL, eSortOrderNone); } } diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index dc583815d65..22839990da8 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1312,7 +1312,7 @@ Symtab *ObjectFileMachO::GetSymtab() { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_symtab_ap.get() == NULL) { + if (m_symtab_ap == NULL) { m_symtab_ap.reset(new Symtab(this)); std::lock_guard<std::recursive_mutex> symtab_guard( m_symtab_ap->GetMutex()); @@ -4842,7 +4842,7 @@ void ObjectFileMachO::Dump(Stream *s) { if (sections) sections->Dump(s, NULL, true, UINT32_MAX); - if (m_symtab_ap.get()) + if (m_symtab_ap) m_symtab_ap->Dump(s, NULL, eSortOrderNone); } } diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index dc7f61068a5..5ad6abe4d22 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -552,7 +552,7 @@ Symtab *ObjectFilePECOFF::GetSymtab() { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_symtab_ap.get() == NULL) { + if (m_symtab_ap == NULL) { SectionList *sect_list = GetSectionList(); m_symtab_ap.reset(new Symtab(this)); std::lock_guard<std::recursive_mutex> guard(m_symtab_ap->GetMutex()); @@ -948,7 +948,7 @@ void ObjectFilePECOFF::Dump(Stream *s) { if (sections) sections->Dump(s, NULL, true, UINT32_MAX); - if (m_symtab_ap.get()) + if (m_symtab_ap) m_symtab_ap->Dump(s, NULL, eSortOrderNone); if (m_dos_header.e_magic) diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index 32cee742e48..dd5f4339fc9 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -116,7 +116,7 @@ OperatingSystemPython::OperatingSystemPython(lldb_private::Process *process, OperatingSystemPython::~OperatingSystemPython() {} DynamicRegisterInfo *OperatingSystemPython::GetDynamicRegisterInfo() { - if (m_register_info_ap.get() == NULL) { + if (m_register_info_ap == NULL) { if (!m_interpreter || !m_python_object_sp) return NULL; Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OS)); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index f95dc23c3d8..b2955902967 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -233,7 +233,7 @@ Status ProcessKDP::DoConnectRemote(Stream *strm, llvm::StringRef remote_url) { std::unique_ptr<ConnectionFileDescriptor> conn_ap( new ConnectionFileDescriptor()); - if (conn_ap.get()) { + if (conn_ap) { // Only try once for now. // TODO: check if we should be retrying? const uint32_t max_retry_count = 1; diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index c588b022ac8..57c28d54698 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1022,7 +1022,7 @@ Status ProcessGDBRemote::ConnectToDebugserver(llvm::StringRef connect_url) { connect_url.str().c_str()); std::unique_ptr<ConnectionFileDescriptor> conn_ap( new ConnectionFileDescriptor()); - if (conn_ap.get()) { + if (conn_ap) { const uint32_t max_retry_count = 50; uint32_t retry_count = 0; while (!m_gdb_comm.IsConnected()) { diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp index 5b6c9e5e26b..4cd8f0a4144 100644 --- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp @@ -856,7 +856,7 @@ protected: // that logging be enabled for a process before libtrace is initialized // results in a scenario where no errors occur, but no logging is // captured, either. This step is to eliminate that possibility. - plugin.AddInitCompletionHook(*process_sp.get()); + plugin.AddInitCompletionHook(*process_sp); } // Send configuration to the feature by way of the process. Construct the @@ -1634,8 +1634,8 @@ bool StructuredDataDarwinLog::InitCompletionHookCallback( } // Queue the thread plan. - auto thread_plan_sp = ThreadPlanSP( - new ThreadPlanCallOnFunctionExit(*thread_sp.get(), callback)); + auto thread_plan_sp = + ThreadPlanSP(new ThreadPlanCallOnFunctionExit(*thread_sp, callback)); const bool abort_other_plans = false; thread_sp->QueueThreadPlan(thread_plan_sp, abort_other_plans); if (log) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index 5b50e92a157..936111b3d42 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -1938,7 +1938,7 @@ public: m_property_getter_name = rhs.m_property_getter_name; m_property_attributes = rhs.m_property_attributes; - if (rhs.m_metadata_ap.get()) { + if (rhs.m_metadata_ap) { m_metadata_ap.reset(new ClangASTMetadata()); *m_metadata_ap = *rhs.m_metadata_ap; } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp index 41f3f07c681..d36208999c5 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -43,7 +43,7 @@ void DWARFDebugInfo::SetDwarfData(SymbolFileDWARF *dwarf2Data) { } DWARFDebugAranges &DWARFDebugInfo::GetCompileUnitAranges() { - if (m_cu_aranges_ap.get() == NULL && m_dwarf2Data) { + if (m_cu_aranges_ap == NULL && m_dwarf2Data) { Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES)); m_cu_aranges_ap.reset(new DWARFDebugAranges()); @@ -60,8 +60,8 @@ DWARFDebugAranges &DWARFDebugInfo::GetCompileUnitAranges() { // Make a list of all CUs represented by the arange data in the file. std::set<dw_offset_t> cus_with_data; - for (size_t n = 0; n < m_cu_aranges_ap.get()->GetNumRanges(); n++) { - dw_offset_t offset = m_cu_aranges_ap.get()->OffsetAtIndex(n); + for (size_t n = 0; n < m_cu_aranges_ap->GetNumRanges(); n++) { + dw_offset_t offset = m_cu_aranges_ap->OffsetAtIndex(n); if (offset != DW_INVALID_OFFSET) cus_with_data.insert(offset); } @@ -89,7 +89,7 @@ DWARFDebugAranges &DWARFDebugInfo::GetCompileUnitAranges() { const bool minimize = true; m_cu_aranges_ap->Sort(minimize); } - return *m_cu_aranges_ap.get(); + return *m_cu_aranges_ap; } void DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp index cdfd672b2aa..c9ece8a9f27 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -843,7 +843,7 @@ SymbolFileDWARFDwo *DWARFUnit::GetDwoSymbolFile() const { dw_offset_t DWARFUnit::GetBaseObjOffset() const { return m_base_obj_offset; } const DWARFDebugAranges &DWARFUnit::GetFunctionAranges() { - if (m_func_aranges_ap.get() == NULL) { + if (m_func_aranges_ap == NULL) { m_func_aranges_ap.reset(new DWARFDebugAranges()); Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES)); @@ -870,6 +870,6 @@ const DWARFDebugAranges &DWARFUnit::GetFunctionAranges() { const bool minimize = false; m_func_aranges_ap->Sort(minimize); } - return *m_func_aranges_ap.get(); + return *m_func_aranges_ap; } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 90572c02e13..24e5cfc7e98 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -659,11 +659,11 @@ const DWARFDataExtractor &SymbolFileDWARF::get_gnu_debugaltlink() { } DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() { - if (m_abbr.get() == NULL) { + if (m_abbr == NULL) { const DWARFDataExtractor &debug_abbrev_data = get_debug_abbrev_data(); if (debug_abbrev_data.GetByteSize() > 0) { m_abbr.reset(new DWARFDebugAbbrev()); - if (m_abbr.get()) + if (m_abbr) m_abbr->Parse(debug_abbrev_data); } } @@ -675,13 +675,13 @@ const DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() const { } DWARFDebugInfo *SymbolFileDWARF::DebugInfo() { - if (m_info.get() == NULL) { + if (m_info == NULL) { static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION, static_cast<void *>(this)); if (get_debug_info_data().GetByteSize() > 0) { m_info.reset(new DWARFDebugInfo()); - if (m_info.get()) { + if (m_info) { m_info->SetDwarfData(this); } } @@ -713,7 +713,7 @@ SymbolFileDWARF::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) { } DWARFDebugRangesBase *SymbolFileDWARF::DebugRanges() { - if (m_ranges.get() == NULL) { + if (m_ranges == NULL) { static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION, static_cast<void *>(this)); @@ -723,7 +723,7 @@ DWARFDebugRangesBase *SymbolFileDWARF::DebugRanges() { else if (get_debug_rnglists_data().GetByteSize() > 0) m_ranges.reset(new DWARFDebugRngLists()); - if (m_ranges.get()) + if (m_ranges) m_ranges->Extract(this); } return m_ranges.get(); @@ -972,7 +972,7 @@ static void ParseDWARFLineTableCallback(dw_offset_t offset, LineTable *line_table = info->line_table; // If this is our first time here, we need to create a sequence container. - if (!info->sequence_ap.get()) { + if (!info->sequence_ap) { info->sequence_ap.reset(line_table->CreateLineSequenceContainer()); assert(info->sequence_ap.get()); } @@ -1003,7 +1003,7 @@ bool SymbolFileDWARF::ParseLineTable(CompileUnit &comp_unit) { DW_INVALID_OFFSET); if (cu_line_offset != DW_INVALID_OFFSET) { std::unique_ptr<LineTable> line_table_ap(new LineTable(&comp_unit)); - if (line_table_ap.get()) { + if (line_table_ap) { ParseDWARFLineTableCallbackInfo info; info.line_table = line_table_ap.get(); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp index 92e2b24d848..261a291049d 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp @@ -142,7 +142,7 @@ lldb::addr_t AppleGetItemInfoHandler::SetupGetItemInfoFunction( // First stage is to make the UtilityFunction to hold our injected // function: - if (!m_get_item_info_impl_code.get()) { + if (!m_get_item_info_impl_code) { if (g_get_item_info_function_code != NULL) { Status error; m_get_item_info_impl_code.reset( diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp index 00f3961d9a1..01e80f09471 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp @@ -146,7 +146,7 @@ lldb::addr_t AppleGetPendingItemsHandler::SetupGetPendingItemsFunction( // First stage is to make the ClangUtility to hold our injected function: - if (!m_get_pending_items_impl_code.get()) { + if (!m_get_pending_items_impl_code) { if (g_get_pending_items_function_code != NULL) { Status error; m_get_pending_items_impl_code.reset( diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp index 53bc918c7a9..e6a7448c80d 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp @@ -157,7 +157,7 @@ AppleGetQueuesHandler::SetupGetQueuesFunction(Thread &thread, // First stage is to make the ClangUtility to hold our injected function: - if (!m_get_queues_impl_code_up.get()) { + if (!m_get_queues_impl_code_up) { if (g_get_current_queues_function_code != NULL) { Status error; m_get_queues_impl_code_up.reset( diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp index 809e2fca2c9..a2343e10801 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp @@ -152,7 +152,7 @@ lldb::addr_t AppleGetThreadItemInfoHandler::SetupGetThreadItemInfoFunction( // First stage is to make the ClangUtility to hold our injected function: - if (!m_get_thread_item_info_impl_code.get()) { + if (!m_get_thread_item_info_impl_code) { Status error; if (g_get_thread_item_info_function_code != NULL) { m_get_thread_item_info_impl_code.reset( diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp index dc16e0c9123..b6b0f98ddeb 100644 --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp @@ -300,7 +300,7 @@ UnwindAssemblyInstEmulation::CreateInstance(const ArchSpec &arch) { EmulateInstruction::FindPlugin(arch, eInstructionTypePrologueEpilogue, NULL)); // Make sure that all prologue instructions are handled - if (inst_emulator_ap.get()) + if (inst_emulator_ap) return new UnwindAssemblyInstEmulation(arch, inst_emulator_ap.release()); return NULL; } diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index cc30e635248..424401a5149 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -763,7 +763,7 @@ void ClangASTContext::Terminate() { } void ClangASTContext::Finalize() { - if (m_ast_ap.get()) { + if (m_ast_ap) { GetASTMap().Erase(m_ast_ap.get()); if (!m_ast_owned) m_ast_ap.release(); @@ -843,7 +843,7 @@ void ClangASTContext::setASTContext(clang::ASTContext *ast_ctx) { } ASTContext *ClangASTContext::getASTContext() { - if (m_ast_ap.get() == nullptr) { + if (m_ast_ap == nullptr) { m_ast_owned = true; m_ast_ap.reset(new ASTContext(*getLanguageOptions(), *getSourceManager(), *getIdentifierTable(), *getSelectorTable(), @@ -881,20 +881,20 @@ ClangASTContext *ClangASTContext::GetASTContext(clang::ASTContext *ast) { } Builtin::Context *ClangASTContext::getBuiltinContext() { - if (m_builtins_ap.get() == nullptr) + if (m_builtins_ap == nullptr) m_builtins_ap.reset(new Builtin::Context()); return m_builtins_ap.get(); } IdentifierTable *ClangASTContext::getIdentifierTable() { - if (m_identifier_table_ap.get() == nullptr) + if (m_identifier_table_ap == nullptr) m_identifier_table_ap.reset( new IdentifierTable(*ClangASTContext::getLanguageOptions(), nullptr)); return m_identifier_table_ap.get(); } LangOptions *ClangASTContext::getLanguageOptions() { - if (m_language_options_ap.get() == nullptr) { + if (m_language_options_ap == nullptr) { m_language_options_ap.reset(new LangOptions()); ParseLangArgs(*m_language_options_ap, InputKind::ObjCXX, GetTargetTriple()); // InitializeLangOptions(*m_language_options_ap, InputKind::ObjCXX); @@ -903,13 +903,13 @@ LangOptions *ClangASTContext::getLanguageOptions() { } SelectorTable *ClangASTContext::getSelectorTable() { - if (m_selector_table_ap.get() == nullptr) + if (m_selector_table_ap == nullptr) m_selector_table_ap.reset(new SelectorTable()); return m_selector_table_ap.get(); } clang::FileManager *ClangASTContext::getFileManager() { - if (m_file_manager_ap.get() == nullptr) { + if (m_file_manager_ap == nullptr) { clang::FileSystemOptions file_system_options; m_file_manager_ap.reset(new clang::FileManager(file_system_options)); } @@ -917,14 +917,14 @@ clang::FileManager *ClangASTContext::getFileManager() { } clang::SourceManager *ClangASTContext::getSourceManager() { - if (m_source_manager_ap.get() == nullptr) + if (m_source_manager_ap == nullptr) m_source_manager_ap.reset( new clang::SourceManager(*getDiagnosticsEngine(), *getFileManager())); return m_source_manager_ap.get(); } clang::DiagnosticsEngine *ClangASTContext::getDiagnosticsEngine() { - if (m_diagnostics_engine_ap.get() == nullptr) { + if (m_diagnostics_engine_ap == nullptr) { llvm::IntrusiveRefCntPtr<DiagnosticIDs> diag_id_sp(new DiagnosticIDs()); m_diagnostics_engine_ap.reset( new DiagnosticsEngine(diag_id_sp, new DiagnosticOptions())); @@ -933,7 +933,7 @@ clang::DiagnosticsEngine *ClangASTContext::getDiagnosticsEngine() { } clang::MangleContext *ClangASTContext::getMangleContext() { - if (m_mangle_ctx_ap.get() == nullptr) + if (m_mangle_ctx_ap == nullptr) m_mangle_ctx_ap.reset(getASTContext()->createMangleContext()); return m_mangle_ctx_ap.get(); } @@ -963,16 +963,16 @@ private: }; DiagnosticConsumer *ClangASTContext::getDiagnosticConsumer() { - if (m_diagnostic_consumer_ap.get() == nullptr) + if (m_diagnostic_consumer_ap == nullptr) m_diagnostic_consumer_ap.reset(new NullDiagnosticConsumer); return m_diagnostic_consumer_ap.get(); } std::shared_ptr<clang::TargetOptions> &ClangASTContext::getTargetOptions() { - if (m_target_options_rp.get() == nullptr && !m_target_triple.empty()) { + if (m_target_options_rp == nullptr && !m_target_triple.empty()) { m_target_options_rp = std::make_shared<clang::TargetOptions>(); - if (m_target_options_rp.get() != nullptr) + if (m_target_options_rp != nullptr) m_target_options_rp->Triple = m_target_triple; } return m_target_options_rp; @@ -980,7 +980,7 @@ std::shared_ptr<clang::TargetOptions> &ClangASTContext::getTargetOptions() { TargetInfo *ClangASTContext::getTargetInfo() { // target_triple should be something like "x86_64-apple-macosx" - if (m_target_info_ap.get() == nullptr && !m_target_triple.empty()) + if (m_target_info_ap == nullptr && !m_target_triple.empty()) m_target_info_ap.reset(TargetInfo::CreateTargetInfo(*getDiagnosticsEngine(), getTargetOptions())); return m_target_info_ap.get(); diff --git a/lldb/source/Symbol/CompileUnit.cpp b/lldb/source/Symbol/CompileUnit.cpp index 6b98d48d326..c0246b7edc5 100644 --- a/lldb/source/Symbol/CompileUnit.cpp +++ b/lldb/source/Symbol/CompileUnit.cpp @@ -189,7 +189,7 @@ lldb::LanguageType CompileUnit::GetLanguage() { } LineTable *CompileUnit::GetLineTable() { - if (m_line_table_ap.get() == nullptr) { + if (m_line_table_ap == nullptr) { if (m_flags.IsClear(flagsParsedLineTable)) { m_flags.Set(flagsParsedLineTable); SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor(); diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp index c5b02e2ff22..b85d806bef8 100644 --- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp +++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp @@ -230,7 +230,7 @@ DWARFCallFrameInfo::GetCIE(dw_offset_t cie_offset) { if (pos != m_cie_map.end()) { // Parse and cache the CIE - if (pos->second.get() == nullptr) + if (pos->second == nullptr) pos->second = ParseCIE(cie_offset); return pos->second.get(); diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp index 1e6a64c3de1..8d9545029a4 100644 --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -61,7 +61,7 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file, data_offset, file, file_offset, file_size)); - if (object_container_ap.get()) + if (object_container_ap) object_file_sp = object_container_ap->GetObjectFile(file); if (object_file_sp.get()) @@ -110,7 +110,7 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file, data_offset, file, file_offset, file_size)); - if (object_container_ap.get()) + if (object_container_ap) object_file_sp = object_container_ap->GetObjectFile(file); if (object_file_sp.get()) @@ -151,7 +151,7 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file, create_object_container_callback(module_sp, data_sp, data_offset, file, file_offset, file_size)); - if (object_container_ap.get()) + if (object_container_ap) object_file_sp = object_container_ap->GetObjectFile(file); if (object_file_sp.get()) @@ -607,7 +607,7 @@ void ObjectFile::ClearSymtab() { } SectionList *ObjectFile::GetSectionList(bool update_module_section_list) { - if (m_sections_ap.get() == nullptr) { + if (m_sections_ap == nullptr) { if (update_module_section_list) { ModuleSP module_sp(GetModule()); if (module_sp) { diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index 5cbffad4603..2749286768c 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -1070,7 +1070,7 @@ bool SymbolContextSpecifier::SymbolContextMatches(SymbolContext &sc) { } } if (m_type & eFileSpecified) { - if (m_file_spec_ap.get()) { + if (m_file_spec_ap) { // If we don't have a block or a comp_unit, then we aren't going to match // a source file. if (sc.block == nullptr && sc.comp_unit == nullptr) @@ -1165,7 +1165,7 @@ void SymbolContextSpecifier::GetDescription( s->Printf("Module: %s\n", m_module_spec.c_str()); } - if (m_type == eFileSpecified && m_file_spec_ap.get() != nullptr) { + if (m_type == eFileSpecified && m_file_spec_ap != nullptr) { m_file_spec_ap->GetPath(path_str, PATH_MAX); s->Indent(); s->Printf("File: %s", path_str); @@ -1203,7 +1203,7 @@ void SymbolContextSpecifier::GetDescription( s->Printf("Class name: %s.\n", m_class_name.c_str()); } - if (m_type == eAddressRangeSpecified && m_address_range_ap.get() != nullptr) { + if (m_type == eAddressRangeSpecified && m_address_range_ap != nullptr) { s->Indent(); s->PutCString("Address range: "); m_address_range_ap->Dump(s, m_target_sp.get(), diff --git a/lldb/source/Symbol/SymbolFile.cpp b/lldb/source/Symbol/SymbolFile.cpp index f29149d3bb2..4576bcfd10c 100644 --- a/lldb/source/Symbol/SymbolFile.cpp +++ b/lldb/source/Symbol/SymbolFile.cpp @@ -59,7 +59,7 @@ SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) { ++idx) { std::unique_ptr<SymbolFile> curr_symfile_ap(create_callback(obj_file)); - if (curr_symfile_ap.get()) { + if (curr_symfile_ap) { const uint32_t sym_file_abilities = curr_symfile_ap->GetAbilities(); if (sym_file_abilities > best_symfile_abilities) { best_symfile_abilities = sym_file_abilities; @@ -71,7 +71,7 @@ SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) { } } } - if (best_symfile_ap.get()) { + if (best_symfile_ap) { // Let the winning symbol file parser initialize itself more completely // now that it has been chosen best_symfile_ap->InitializeObject(); diff --git a/lldb/source/Symbol/SymbolVendor.cpp b/lldb/source/Symbol/SymbolVendor.cpp index 90393b14c98..583f1b16832 100644 --- a/lldb/source/Symbol/SymbolVendor.cpp +++ b/lldb/source/Symbol/SymbolVendor.cpp @@ -36,7 +36,7 @@ SymbolVendor *SymbolVendor::FindPlugin(const lldb::ModuleSP &module_sp, ++idx) { instance_ap.reset(create_callback(module_sp, feedback_strm)); - if (instance_ap.get()) { + if (instance_ap) { return instance_ap.release(); } } @@ -112,7 +112,7 @@ size_t SymbolVendor::GetNumCompileUnits() { if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); if (m_compile_units.empty()) { - if (m_sym_file_ap.get()) { + if (m_sym_file_ap) { // Resize our array of compile unit shared pointers -- which will each // remain NULL until someone asks for the actual compile unit // information. When this happens, the symbol file will be asked to @@ -128,7 +128,7 @@ lldb::LanguageType SymbolVendor::ParseLanguage(CompileUnit &comp_unit) { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ParseLanguage(comp_unit); } return eLanguageTypeUnknown; @@ -138,7 +138,7 @@ size_t SymbolVendor::ParseFunctions(CompileUnit &comp_unit) { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ParseFunctions(comp_unit); } return 0; @@ -148,7 +148,7 @@ bool SymbolVendor::ParseLineTable(CompileUnit &comp_unit) { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ParseLineTable(comp_unit); } return false; @@ -158,7 +158,7 @@ bool SymbolVendor::ParseDebugMacros(CompileUnit &comp_unit) { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ParseDebugMacros(comp_unit); } return false; @@ -168,7 +168,7 @@ bool SymbolVendor::ParseSupportFiles(CompileUnit &comp_unit, ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ParseSupportFiles(comp_unit, support_files); } return false; @@ -178,7 +178,7 @@ bool SymbolVendor::ParseIsOptimized(CompileUnit &comp_unit) { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ParseIsOptimized(comp_unit); } return false; @@ -189,7 +189,7 @@ bool SymbolVendor::ParseImportedModules( ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ParseImportedModules(sc, imported_modules); } return false; @@ -199,7 +199,7 @@ size_t SymbolVendor::ParseBlocksRecursive(Function &func) { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ParseBlocksRecursive(func); } return 0; @@ -209,7 +209,7 @@ size_t SymbolVendor::ParseTypes(CompileUnit &comp_unit) { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ParseTypes(comp_unit); } return 0; @@ -219,7 +219,7 @@ size_t SymbolVendor::ParseVariablesForContext(const SymbolContext &sc) { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ParseVariablesForContext(sc); } return 0; @@ -229,7 +229,7 @@ Type *SymbolVendor::ResolveTypeUID(lldb::user_id_t type_uid) { ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ResolveTypeUID(type_uid); } return nullptr; @@ -241,7 +241,7 @@ uint32_t SymbolVendor::ResolveSymbolContext(const Address &so_addr, ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ResolveSymbolContext(so_addr, resolve_scope, sc); } return 0; @@ -254,7 +254,7 @@ uint32_t SymbolVendor::ResolveSymbolContext(const FileSpec &file_spec, ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->ResolveSymbolContext(file_spec, line, check_inlines, resolve_scope, sc_list); } @@ -268,7 +268,7 @@ SymbolVendor::FindGlobalVariables(const ConstString &name, ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->FindGlobalVariables(name, parent_decl_ctx, max_matches, variables); } @@ -281,7 +281,7 @@ size_t SymbolVendor::FindGlobalVariables(const RegularExpression ®ex, ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->FindGlobalVariables(regex, max_matches, variables); } return 0; @@ -295,7 +295,7 @@ size_t SymbolVendor::FindFunctions(const ConstString &name, ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->FindFunctions(name, parent_decl_ctx, name_type_mask, include_inlines, append, sc_list); } @@ -308,7 +308,7 @@ size_t SymbolVendor::FindFunctions(const RegularExpression ®ex, ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->FindFunctions(regex, include_inlines, append, sc_list); } @@ -323,7 +323,7 @@ size_t SymbolVendor::FindTypes( ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->FindTypes(name, parent_decl_ctx, append, max_matches, searched_symbol_files, types); @@ -338,7 +338,7 @@ size_t SymbolVendor::FindTypes(const std::vector<CompilerContext> &context, ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->FindTypes(context, append, types); } if (!append) @@ -351,7 +351,7 @@ size_t SymbolVendor::GetTypes(SymbolContextScope *sc_scope, TypeClass type_mask, ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) return m_sym_file_ap->GetTypes(sc_scope, type_mask, type_list); } return 0; @@ -364,7 +364,7 @@ SymbolVendor::FindNamespace(const ConstString &name, ModuleSP module_sp(GetModule()); if (module_sp) { std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); - if (m_sym_file_ap.get()) + if (m_sym_file_ap) namespace_decl_ctx = m_sym_file_ap->FindNamespace(name, parent_decl_ctx); } return namespace_decl_ctx; @@ -380,7 +380,7 @@ void SymbolVendor::Dump(Stream *s) { s->Printf("%p: ", static_cast<void *>(this)); s->Indent(); s->PutCString("SymbolVendor"); - if (m_sym_file_ap.get()) { + if (m_sym_file_ap) { *s << " " << m_sym_file_ap->GetPluginName(); ObjectFile *objfile = m_sym_file_ap->GetObjectFile(); if (objfile) { @@ -402,7 +402,7 @@ void SymbolVendor::Dump(Stream *s) { cu_end = m_compile_units.end(); for (cu_pos = m_compile_units.begin(); cu_pos != cu_end; ++cu_pos) { // We currently only dump the compile units that have been parsed - if (cu_pos->get()) + if (*cu_pos) (*cu_pos)->Dump(s, show_context); } @@ -431,7 +431,7 @@ CompUnitSP SymbolVendor::GetCompileUnitAtIndex(size_t idx) { } FileSpec SymbolVendor::GetMainFileSpec() const { - if (m_sym_file_ap.get()) { + if (m_sym_file_ap) { const ObjectFile *symfile_objfile = m_sym_file_ap->GetObjectFile(); if (symfile_objfile) return symfile_objfile->GetFileSpec(); @@ -476,7 +476,7 @@ void SymbolVendor::SectionFileAddressesChanged() { ModuleSP module_sp(GetModule()); if (module_sp) { ObjectFile *module_objfile = module_sp->GetObjectFile(); - if (m_sym_file_ap.get()) { + if (m_sym_file_ap) { ObjectFile *symfile_objfile = m_sym_file_ap->GetObjectFile(); if (symfile_objfile != module_objfile) symfile_objfile->SectionFileAddressesChanged(); diff --git a/lldb/source/Target/Language.cpp b/lldb/source/Target/Language.cpp index c2c50a3057c..0b701305a9e 100644 --- a/lldb/source/Target/Language.cpp +++ b/lldb/source/Target/Language.cpp @@ -390,7 +390,7 @@ bool Language::ImageListTypeScavenger::Find_Impl( images.FindTypes(nullptr, cs_key, false, UINT32_MAX, searched_sym_files, matches); for (const auto &match : matches.Types()) { - if (match.get()) { + if (match) { CompilerType compiler_type(match->GetFullCompilerType()); compiler_type = AdjustForInclusion(compiler_type); if (!compiler_type) diff --git a/lldb/source/Target/SectionLoadHistory.cpp b/lldb/source/Target/SectionLoadHistory.cpp index 46e1c690e5d..391a6c22f7f 100644 --- a/lldb/source/Target/SectionLoadHistory.cpp +++ b/lldb/source/Target/SectionLoadHistory.cpp @@ -80,7 +80,7 @@ SectionLoadHistory::GetSectionLoadListForStopID(uint32_t stop_id, StopIDToSectionLoadList::reverse_iterator rpos = m_stop_id_to_section_load_list.rbegin(); SectionLoadListSP section_load_list_sp( - new SectionLoadList(*rpos->second.get())); + new SectionLoadList(*rpos->second)); m_stop_id_to_section_load_list[stop_id] = section_load_list_sp; return section_load_list_sp.get(); } diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 9fbd9fb3683..cf9f454c170 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -3150,7 +3150,7 @@ Target::StopHook::StopHook(const StopHook &rhs) m_commands(rhs.m_commands), m_specifier_sp(rhs.m_specifier_sp), m_thread_spec_ap(), m_active(rhs.m_active) { if (rhs.m_thread_spec_ap) - m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap.get())); + m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap)); } Target::StopHook::~StopHook() = default; diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index ed9b4092e84..2bb3582357e 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -562,7 +562,7 @@ bool Thread::RestoreRegisterStateFromCheckpoint( // Clear out all stack frames as our world just changed. ClearStackFrames(); reg_ctx_sp->InvalidateIfNeeded(true); - if (m_unwinder_ap.get()) + if (m_unwinder_ap) m_unwinder_ap->Clear(); return ret; } diff --git a/lldb/unittests/Editline/EditlineTest.cpp b/lldb/unittests/Editline/EditlineTest.cpp index 626d0cb1956..1a4bd37e767 100644 --- a/lldb/unittests/Editline/EditlineTest.cpp +++ b/lldb/unittests/Editline/EditlineTest.cpp @@ -62,7 +62,7 @@ public: void CloseInput(); - bool IsValid() const { return _editline_sp.get() != nullptr; } + bool IsValid() const { return _editline_sp != nullptr; } lldb_private::Editline &GetEditline() { return *_editline_sp; } |