Skip to content

Commit 77f22d7

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 <[email protected]>
1 parent ee137e4 commit 77f22d7

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
@@ -26,14 +26,6 @@ ScriptedPythonInterface::ScriptedPythonInterface(
2626
ScriptInterpreterPythonImpl &interpreter)
2727
: ScriptedInterface(), m_interpreter(interpreter) {}
2828

29-
Status
30-
ScriptedPythonInterface::GetStatusFromMethod(llvm::StringRef method_name) {
31-
Status error;
32-
Dispatch<Status>(method_name, error);
33-
34-
return error;
35-
}
36-
3729
template <>
3830
StructuredData::ArraySP
3931
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
@@ -99,7 +99,13 @@ class ScriptedPythonInterface : virtual public ScriptedInterface {
9999
return ExtractValueFromPythonObject<T>(py_return, error);
100100
}
101101

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

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

0 commit comments

Comments
 (0)