This is an archive of the discontinued LLVM Phabricator instance.

[LLDB][Python] remove ArgInfo::count
ClosedPublic

Authored by lawrence_danna on Nov 1 2019, 5:38 PM.

Details

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

Event Timeline

lawrence_danna created this revision.Nov 1 2019, 5:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 1 2019, 5:38 PM
lawrence_danna edited the summary of this revision. (Show Details)Nov 1 2019, 5:39 PM
labath accepted this revision.Nov 4 2019, 9:23 AM

At this point, should we just delete the ArgInfo struct altogether, and replace it with a plain unsigned?

This revision is now accepted and ready to land.Nov 4 2019, 9:23 AM
JDevlieghere accepted this revision.Nov 4 2019, 9:27 AM

LGTM modulo inline comment.

lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
764

Should we check has_varargs here as well?

lawrence_danna marked 2 inline comments as done.Nov 4 2019, 10:47 AM
lawrence_danna added inline comments.
lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
764

nope, it's an implementation detail now. not available here.

JDevlieghere added inline comments.Nov 4 2019, 10:50 AM
lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
764

Makes sense, sorry for the noise!

lawrence_danna marked 2 inline comments as done.Nov 4 2019, 12:46 PM

At this point, should we just delete the ArgInfo struct altogether, and replace it with a plain unsigned?

Sounds like a good idea to me. Maybe I'll do that in a followon patch.

This revision was automatically updated to reflect the committed changes.