[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
This commit is contained in:
Lawrence D'Anna
2019-11-04 12:48:49 -08:00
parent 4312c4afd4
commit adbf64ccc9
5 changed files with 66 additions and 88 deletions

View File

@@ -619,30 +619,12 @@ public:
* function and can accept an arbitrary number */
unsigned max_positional_args;
static constexpr unsigned UNBOUNDED = UINT_MAX; // FIXME c++17 inline
/* the number of positional arguments, including optional ones,
* and excluding varargs. If this is a bound method, then the
* count will still include a +1 for self.
*
* FIXME. That's crazy. This should be replaced with
* an accurate min and max for positional args.
*/
int count;
/* does the callable have positional varargs? */
bool has_varargs : 1; // FIXME delete this
};
static bool Check(PyObject *py_obj);
llvm::Expected<ArgInfo> GetArgInfo() const;
llvm::Expected<ArgInfo> GetInitArgInfo() const;
ArgInfo GetNumArguments() const; // DEPRECATED
// If the callable is a Py_Class, then find the number of arguments
// of the __init__ method.
ArgInfo GetNumInitArguments() const; // DEPRECATED
PythonObject operator()();
PythonObject operator()(std::initializer_list<PyObject *> args);