summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api/thread/main.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-04-02 10:18:46 +0000
committerPavel Labath <pavel@labath.sk>2019-04-02 10:18:46 +0000
commit4bc0500635436dca11d18f1385ff668eb36307b8 (patch)
tree0d677161171629138dfab879ba7e28dfaafc782f /lldb/packages/Python/lldbsuite/test/python_api/thread/main.cpp
parent76f2259dde8d5dbafa9283615befd7d002c89f75 (diff)
downloadbcm5719-llvm-4bc0500635436dca11d18f1385ff668eb36307b8.tar.gz
bcm5719-llvm-4bc0500635436dca11d18f1385ff668eb36307b8.zip
Make operator==s consistent between c++ and python APIs
Summary: modify-python-lldb.py had code to insert python equality operators to some classes. Some of those classes already had c++ equality operators, and some didn't. This makes the situation more consistent, by removing all equality handilng from modify-python-lldb. Instead, I add c++ operators to classes where they were missing, and expose them in the swig interface files so that they are available to python too. The only tricky case was the SBAddress class, which had an operator== defined as a free function, which is not handled by swig. This function cannot be removed without breaking ABI, and we cannot add an extra operator== member, as that would make equality comparisons ambiguous. For this class, I define a python __eq__ function by hand and have it delegate to the operator!=, which I have defined as a member function. This isn't fully NFC, as the semantics of some equality functions in python changes slightly, but I believe it changes for the better (e.g., previously SBBreakpoint.__eq__ would consider two breakpoints with the same ID as equal, even if they belonged to different targets; now they are only equal if they belong to the same target). Reviewers: jingham, clayborg, zturner Subscribers: jdoerfert, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D59819 llvm-svn: 357463
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/thread/main.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud