Author: Jonas Devlieghere Date: 2020-07-24T16:28:34-07:00 New Revision: 99996213ebd9655bb0488387f906d5438bcd37f8
URL: https://github.com/llvm/llvm-project/commit/99996213ebd9655bb0488387f906d5438bcd37f8 DIFF: https://github.com/llvm/llvm-project/commit/99996213ebd9655bb0488387f906d5438bcd37f8.diff LOG: [lldb] Don't wrap and release raw pointer in unique_ptr (NFC) Added: Modified: lldb/source/Target/LanguageRuntime.cpp Removed: ################################################################################ diff --git a/lldb/source/Target/LanguageRuntime.cpp b/lldb/source/Target/LanguageRuntime.cpp index 58ad70c2b902..f8143839bb64 100644 --- a/lldb/source/Target/LanguageRuntime.cpp +++ b/lldb/source/Target/LanguageRuntime.cpp @@ -202,20 +202,15 @@ class ExceptionBreakpointResolver : public BreakpointResolver { LanguageRuntime *LanguageRuntime::FindPlugin(Process *process, lldb::LanguageType language) { - std::unique_ptr<LanguageRuntime> language_runtime_up; LanguageRuntimeCreateInstance create_callback; - for (uint32_t idx = 0; (create_callback = PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(idx)) != nullptr; ++idx) { - language_runtime_up.reset(create_callback(process, language)); - - if (language_runtime_up) - return language_runtime_up.release(); + if (LanguageRuntime *runtime = create_callback(process, language)) + return runtime; } - return nullptr; } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits