This is an archive of the discontinued LLVM Phabricator instance.

Create a `PythonModule` class and add a root-level method for name lookup
ClosedPublic

Authored by zturner on Nov 9 2015, 5:22 PM.

Details

Summary

The goal here is to eventually replace some code in python-wrapper.swig with this code. This way it can be properly unit tested and we can easily deal with Python version differences.

the first set of patches will focus on just getting the classes in with unit tests to confirm they work, and then I will replace the code in python-wrapper.swig with this code.

Note that the implementation of ResolveName here differs from the implementation of ResolvePythonName in python-wrapper.swig. The two methods seem equivalent to me, with this one being more straightforward, generic, and efficient.

Diff Detail

Event Timeline

zturner updated this revision to Diff 39775.Nov 9 2015, 5:22 PM
zturner updated this revision to Diff 39776.
zturner retitled this revision from to Create a `PythonModule` class and add a root-level method for name lookup.
zturner updated this object.
zturner added a subscriber: lldb-commits.

Fix some indentation

granata.enrico edited edge metadata.Nov 9 2015, 6:45 PM

This seems reasonable to me. I would wait for Greg to OK it, just to be safe.

zturner added inline comments.Nov 9 2015, 7:25 PM
source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
369–374

I need to delete this method. This was left in by accident. The real implementation is in the base class.

tfiala resigned from this revision.Nov 10 2015, 12:41 PM
tfiala removed a reviewer: tfiala.

Zachary, I am going to defer to Enrico on this. He has better context.

tfiala added a subscriber: tfiala.Nov 10 2015, 12:41 PM

(Which I guess means Greg, seeing Enrico's comment earlier!)

Okay Greg's not had a chance to look at this. I just had a look at it. I'm okay with it, Zachary. Feel free to check it in.

clayborg accepted this revision.Nov 11 2015, 10:34 AM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Nov 11 2015, 10:34 AM
zturner closed this revision.Nov 11 2015, 12:20 PM