diff options
author | Enrico Granata <egranata@apple.com> | 2013-05-03 01:29:27 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-05-03 01:29:27 +0000 |
commit | c3387333ced81f6ef83b9022c5bde4a42bba05fa (patch) | |
tree | 4278e4f4cb83ae061635238e4a9563d251b4bb6a /lldb/scripts/Python/interface/SBCompileUnit.i | |
parent | 57f745ec96f14847e13de25d664ac8e9b5b59509 (diff) | |
download | bcm5719-llvm-c3387333ced81f6ef83b9022c5bde4a42bba05fa.tar.gz bcm5719-llvm-c3387333ced81f6ef83b9022c5bde4a42bba05fa.zip |
<rdar://problem/11742979>
SWIG is smart enough to recognize that C++ operators == and != mean __eq__ and __ne__ in Python and do the appropriate translation
But it is not smart enough to recognize that mySBObject == None should return False instead of erroring out
The %pythoncode blocks are meant to provide those extra smarts (and they play some SWIG&Python magic to find the right function to call behind the scenes with no risk of typos :-)
Lastly, SBBreakpoint provides an == but never provided a != operator - common courtesy is to provide both
llvm-svn: 180987
Diffstat (limited to 'lldb/scripts/Python/interface/SBCompileUnit.i')
-rw-r--r-- | lldb/scripts/Python/interface/SBCompileUnit.i | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/scripts/Python/interface/SBCompileUnit.i b/lldb/scripts/Python/interface/SBCompileUnit.i index 95d68a640b8..3bfaf70b997 100644 --- a/lldb/scripts/Python/interface/SBCompileUnit.i +++ b/lldb/scripts/Python/interface/SBCompileUnit.i @@ -89,6 +89,12 @@ public: bool GetDescription (lldb::SBStream &description); + bool + operator == (const lldb::SBCompileUnit &rhs) const; + + bool + operator != (const lldb::SBCompileUnit &rhs) const; + %pythoncode %{ __swig_getmethods__["file"] = GetFileSpec if _newclass: file = property(GetFileSpec, None, doc='''A read only property that returns the same result an lldb object that represents the source file (lldb.SBFileSpec) for the compile unit.''') |