summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorLawrence D'Anna <lawrence_danna@apple.com>2019-11-04 12:48:49 -0800
committerLawrence D'Anna <lawrence_danna@apple.com>2019-11-04 12:48:49 -0800
commitadbf64ccc9e18278600ebaeadd8f0117eb8e64b1 (patch)
tree4dd857d012749bea97dd4ddbbaeb0d28ff006621 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent4312c4afd43209400df53ca541b4b19919f797af (diff)
downloadbcm5719-llvm-adbf64ccc9e18278600ebaeadd8f0117eb8e64b1.tar.gz
bcm5719-llvm-adbf64ccc9e18278600ebaeadd8f0117eb8e64b1.zip
[LLDB][Python] remove ArgInfo::count
Summary: This patch updates the last user of ArgInfo::count and deletes it. I also delete `GetNumInitArguments()` and `GetInitArgInfo()`. Classess are callables and `GetArgInfo()` should work on them. On python 3 it already works, of course. `inspect` is good. On python 2 we have to add yet another special case. But hey if python 2 wasn't crufty we wouln't need python 3. I also delete `is_bound_method` becuase it is unused. This path is tested in `TestStepScripted.py` Reviewers: labath, mgorny, JDevlieghere Reviewed By: labath, JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69742
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 15843feae57..e7d9443c5fd 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -807,8 +807,10 @@ ScriptInterpreterPythonImpl::GetMaxPositionalArgumentsForCallable(
llvm::inconvertibleErrorCode(),
"can't find callable: %s", callable_name.str().c_str());
}
- PythonCallable::ArgInfo arg_info = pfunc.GetNumArguments();
- return arg_info.max_positional_args;
+ llvm::Expected<PythonCallable::ArgInfo> arg_info = pfunc.GetArgInfo();
+ if (!arg_info)
+ return arg_info.takeError();
+ return arg_info.get().max_positional_args;
}
static std::string GenerateUniqueName(const char *base_name_wanted,
OpenPOWER on IntegriCloud