[Lldb-commits] [PATCH] D139248: [lldb/Interpreter] Improve ScriptedPythonInterface::GetStatusFromMethod

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 21 04:14:49 PST 2022


mib updated this revision to Diff 484527.
mib marked an inline comment as done.
mib added a comment.

Use `std::forward`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139248/new/

https://reviews.llvm.org/D139248

Files:
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h


Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h
===================================================================
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h
@@ -99,7 +99,13 @@
     return ExtractValueFromPythonObject<T>(py_return, error);
   }
 
-  Status GetStatusFromMethod(llvm::StringRef method_name);
+  template <typename... Args>
+  Status GetStatusFromMethod(llvm::StringRef method_name, Args &&...args) {
+    Status error;
+    Dispatch<Status>(method_name, error, std::forward<Args>(args)...);
+
+    return error;
+  }
 
   template <typename T> T Transform(T object) {
     // No Transformation for generic usage
Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp
===================================================================
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp
@@ -26,14 +26,6 @@
     ScriptInterpreterPythonImpl &interpreter)
     : ScriptedInterface(), m_interpreter(interpreter) {}
 
-Status
-ScriptedPythonInterface::GetStatusFromMethod(llvm::StringRef method_name) {
-  Status error;
-  Dispatch<Status>(method_name, error);
-
-  return error;
-}
-
 template <>
 StructuredData::ArraySP
 ScriptedPythonInterface::ExtractValueFromPythonObject<StructuredData::ArraySP>(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139248.484527.patch
Type: text/x-patch
Size: 1479 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221221/476535d9/attachment-0001.bin>


More information about the lldb-commits mailing list