diff options
author | Zachary Turner <zturner@google.com> | 2015-10-14 16:59:32 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-10-14 16:59:32 +0000 |
commit | 60c24f70fe1f7f37ae34e0ff47cd60db39094a88 (patch) | |
tree | 9af3c416fc69ee4d6093a24896b0cd30cad752cc /lldb/source/Plugins/ScriptInterpreter/Python | |
parent | a5b9ad22b39c8aec39d3bd06efcdc13f4b0f9da8 (diff) | |
download | bcm5719-llvm-60c24f70fe1f7f37ae34e0ff47cd60db39094a88.tar.gz bcm5719-llvm-60c24f70fe1f7f37ae34e0ff47cd60db39094a88.zip |
Change swig interface files to use PythonDataObjects.
llvm-svn: 250303
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h | 15 | ||||
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h index 8872b11488d..17ece25c9d3 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -122,7 +122,7 @@ public: { // Avoid calling the virtual method if it's not necessary // to actually validate the type of the PyObject. - if (!rhs.get()) + if (!rhs.IsValid()) Reset(); else Reset(PyRefType::Borrowed, rhs.m_py_obj); @@ -167,12 +167,21 @@ public: Dump (Stream &strm) const; PyObject* - get () const + get() const { return m_py_obj; } - PyObjectType GetObjectType() const; + PyObject* + release() + { + PyObject *result = m_py_obj; + m_py_obj = nullptr; + return result; + } + + PyObjectType + GetObjectType() const; PythonString Repr (); diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 48fd4087bbf..83334e9c1a9 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -478,7 +478,7 @@ PyFile_FromFile_Const(FILE *fp, const char *mode) int fd = fileno(fp); #endif - return PyRef(PyRefType::Owned, + return PythonObject(PyRefType::Owned, PyFile_FromFd(fd, nullptr, cmode, -1, nullptr, "ignore", nullptr, 0)); #else // Read through the Python source, doesn't seem to modify these strings |