Skip to content

Commit 3fbc890

Browse files
committed
[lldb/Interpreter] Improve ScriptedPythonInterface::GetStatusFromMethod
This patch makes `ScriptedPythonInterface::GetStatusFromMethod` take a parameter pack as an argument. That will allow it to pass arbitrary arguments to the python method. Differential Revision: https://reviews.llvm.org/D139248 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
1 parent d9f4d1b commit 3fbc890

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ ScriptedPythonInterface::ScriptedPythonInterface(
2727
ScriptInterpreterPythonImpl &interpreter)
2828
: ScriptedInterface(), m_interpreter(interpreter) {}
2929

30-
Status
31-
ScriptedPythonInterface::GetStatusFromMethod(llvm::StringRef method_name) {
32-
Status error;
33-
Dispatch<Status>(method_name, error);
34-
35-
return error;
36-
}
37-
3830
template <>
3931
StructuredData::ArraySP
4032
ScriptedPythonInterface::ExtractValueFromPythonObject<StructuredData::ArraySP>(

lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ class ScriptedPythonInterface : virtual public ScriptedInterface {
100100
return ExtractValueFromPythonObject<T>(py_return, error);
101101
}
102102

103-
Status GetStatusFromMethod(llvm::StringRef method_name);
103+
template <typename... Args>
104+
Status GetStatusFromMethod(llvm::StringRef method_name, Args &&...args) {
105+
Status error;
106+
Dispatch<Status>(method_name, error, std::forward<Args>(args)...);
107+
108+
return error;
109+
}
104110

105111
template <typename T> T Transform(T object) {
106112
// No Transformation for generic usage

0 commit comments

Comments
 (0)