[Lldb-commits] [lldb] Fix return value of 'PluginManager::RegisterPlugin()'. (PR #114120)

Miro Bucko via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 25 11:37:06 PST 2024


https://github.com/mbucko updated https://github.com/llvm/llvm-project/pull/114120

>From 362d6f52709ddf303d9d9fa256526182ba60fa53 Mon Sep 17 00:00:00 2001
From: Miro Bucko <mbucko at meta.com>
Date: Tue, 29 Oct 2024 13:02:21 -0700
Subject: [PATCH] Fix return value of 'PluginManager::RegisterPlugin()'.

---
 lldb/source/Core/PluginManager.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp
index a5219025495a91..80c9465f9af721 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -206,10 +206,9 @@ template <typename Instance> class PluginInstances {
     if (!callback)
       return false;
     assert(!name.empty());
-    Instance instance =
-        Instance(name, description, callback, std::forward<Args>(args)...);
-    m_instances.push_back(instance);
-    return false;
+    m_instances.emplace_back(name, description, callback,
+                             std::forward<Args>(args)...);
+    return true;
   }
 
   bool UnregisterPlugin(typename Instance::CallbackType callback) {



More information about the lldb-commits mailing list