diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2020-01-08 13:34:55 -0800 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2020-01-08 13:37:07 -0800 |
commit | 0341c11e08504acef8c16ab07210bc253dadf2d9 (patch) | |
tree | a49c8fd69f16d9cc8aa6cd6558f8778fdb54fbe6 /lldb/scripts/Python/python-extensions.swig | |
parent | 0b8ce37d64747ba7d8908626256e2b5e58f7b396 (diff) | |
download | bcm5719-llvm-0341c11e08504acef8c16ab07210bc253dadf2d9.tar.gz bcm5719-llvm-0341c11e08504acef8c16ab07210bc253dadf2d9.zip |
[lldb/SWIG] Refactor extensions to be non Python-specific
The current SWIG extensions for the string conversion operator is Python
specific because it uses the PythonObjects. This means that the code
cannot be reused for other SWIG supported languages such as Lua.
This reimplements the extensions in a more generic way that can be
reused.
Differential revision: https://reviews.llvm.org/D72377
Diffstat (limited to 'lldb/scripts/Python/python-extensions.swig')
-rw-r--r-- | lldb/scripts/Python/python-extensions.swig | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index c10c32b4487..dbd4b1d79d0 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -1,4 +1,3 @@ - %extend lldb::SBAddress { %nothreadallow; PyObject *lldb::SBAddress::__str__ (){ @@ -502,18 +501,6 @@ } %extend lldb::SBTarget { - %nothreadallow; - PyObject *lldb::SBTarget::__str__ (){ - lldb::SBStream description; - $self->GetDescription (description, lldb::eDescriptionLevelBrief); - const char *desc = description.GetData(); - size_t desc_len = description.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) - --desc_len; - return PythonString(llvm::StringRef(desc, desc_len)).release(); - } - %clearnothreadallow; - %pythoncode %{ def __eq__(self, rhs): if not isinstance(rhs, type(self)): |