Page MenuHomePhabricator

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

Authored by lawrence_danna on Fri, Nov 1, 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

Diff Detail

Event Timeline

lawrence_danna created this revision.Fri, Nov 1, 5:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptFri, Nov 1, 5:38 PM
lawrence_danna edited the summary of this revision. (Show Details)Fri, Nov 1, 5:39 PM
labath accepted this revision.Mon, Nov 4, 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.Mon, Nov 4, 9:23 AM
JDevlieghere accepted this revision.Mon, Nov 4, 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.Mon, Nov 4, 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.Mon, Nov 4, 10:50 AM
lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
764

Makes sense, sorry for the noise!

lawrence_danna marked 2 inline comments as done.Mon, Nov 4, 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.