This is an archive of the discontinued LLVM Phabricator instance.

Insert random blocks of python code with swig instead of modify-python-lldb.py
ClosedPublic

Authored by labath on Feb 18 2019, 6:39 AM.

Details

Summary

Swig is perfectly capable of inserting blocks of python code into its
output (and we use those fascilities already), so there's no need for
this to be done in a post-process step.

lldb_iter is a general-purpose utility used from many classes, so I add
it to the main swig file. The other two blocks are tied to a specific
class, so I add it to the interface file of that class.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Feb 18 2019, 6:39 AM
jingham accepted this revision.Feb 26 2019, 11:48 AM

LGTM.

I don't remember why this was inserted as separate pass. Maybe we were still early on learning what SWIG could do? That was a long time ago now...

This revision is now accepted and ready to land.Feb 26 2019, 11:48 AM

One comment seems to have wandered out of place.

scripts/lldb.swig
95 ↗(On Diff #187240)

Should this comment have been deleted?

zturner accepted this revision.Feb 26 2019, 11:54 AM

Also lgtm. Don't call the commit message "Insert random blocks of python code" though. Hopefully the code we're inserting is not actually random :)

clayborg accepted this revision.Feb 26 2019, 2:52 PM
labath marked an inline comment as done.Feb 27 2019, 6:12 AM
labath added inline comments.
scripts/lldb.swig
95 ↗(On Diff #187240)

I deliberately kept it because it's still true (we still do some post-processing), and I thought it would be useful to readers of both this file and lldb.py if they start wondering what is going on. I can delete it though, if you think its confusing.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2019, 6:16 AM