llvm-project/lldb/scripts
Pavel Labath 01b595c0cb Fix/unify SBType comparison
Summary:
In my next step at cleaning up modify-python-lldb.py, I started focusing
on equality comparison. To my surprise, I found out that both python and
c++ versions of the SBType class implement equality comparison, but each
one does it differently. While the python version was implemented in
terms of type name equality, the C++ one used a deep comparison on the
underlying objects.

Removing the python version caused one test to fail (TestTypeList). This
happened because the c++ version of operator== boiled down to
TypePair::operator==, which contains two items: the compiler_type and
type_sp. In this case, the compiler_type was identical, but one of the
objects had the type_sp field unset.

I tried fixing the code so that both objects keep their type_sp member,
but it wasn't easy, because there are so many operations which just work
with the CompilerType types, and so any operation on the SBType (the
test in question was doing GetPointeeType on the type of one variable
and expecting it to match the type of another variable), cause that
second member to be lost.

So instead, here I relax the equality comparison on the TypePair
class. Now, this class ignores the type_sp for the purposes of
comparison, and uses the CompilerType only. This seems reasonable, as
each TypeSP is able to convert itself to a CompilerType.

Reviewers: clayborg, aprantl, serge-sans-paille

Subscribers: jdoerfert, lldb-commits

Differential Revision: https://reviews.llvm.org/D59217

llvm-svn: 356048
2019-03-13 13:45:14 +00:00
..
Python Fix/unify SBType comparison 2019-03-13 13:45:14 +00:00
Xcode [build] Rename clang-headers to clang-resource-headers 2019-03-04 21:19:53 +00:00
interface Fix/unify SBType comparison 2019-03-13 13:45:14 +00:00
swig_bot_lib *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CMakeLists.txt [CMake] Python bindings generation polishing 2019-01-04 12:47:02 +00:00
analyze-project-deps.py Make scripts/analyzer-project-deps compatible with python3 2018-12-06 10:27:38 +00:00
build-lldb-llvm-clang Change build-llvm.py and build-lldb-llvm-clang's patching mechanisms to 2017-09-27 23:44:54 +00:00
buildbot.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
checkpoint-llvm.pl
disasm-gdb-remote.pl
finish-swig-wrapper-classes.sh
finishSwigWrapperClasses.py Install six.py conditionally 2017-02-04 00:20:24 +00:00
framework-header-fix.sh Update framework-header-fix to force system sed 2018-11-04 15:55:28 +00:00
generate-vers.pl
get_relative_lib_dir.py
install-lldb.sh
install_custom_python.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
lldb.swig Add "operator bool" to SB APIs 2019-03-11 13:58:46 +00:00
macos-setup-codesign.sh Add a script to setup codesigning on macOS. 2018-06-14 18:04:13 +00:00
prepare_bindings.py Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
sed-sources
shush
sort-pbxproj.rb Change sort-pbxproj.rb to find the project.pbxproj in the 2018-07-23 23:34:50 +00:00
swig_bot.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
use_lldb_suite.py use_lldb_suite.py: Fix potential infinite loop 2019-02-07 14:03:43 +00:00
utilsArgsParse.py Install six.py conditionally 2017-02-04 00:20:24 +00:00
utilsDebug.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
utilsOsType.py The Python 3 part of the script was missed when adding OpenBSD support. 2018-10-04 20:34:58 +00:00
verify_api.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00