Go to file
Zachary Turner c22811bbcc Python 3 - Use __bool__() instead of __nonzero__() for truthiness.
Python has a complicated mechanism of checking an objects truthity.
This involves a number of steps, which end with calling two private
methods on an object (if they are implemented).  In Python 2 these
two methods are `__nonzero__` and `__len__`, and in Python 3 they
are `__bool__` and `__len__`.  Because we *also* define a __len__
method for certain iterable types, this was triggering a situation
in Python 3 where `__nonzero__` wasn't defined, so it was calling
`__len__`, which was returning 0 (for example an SBDebugger with
no targets), and as a result the truthosity was determined to be
False.

We fix this by correctly using ` __bool__` for Python 3, and leave
the behavior under Python 2 unchanged.

Note that this fix is only implemented in the SWIG generation
python script, and not the SWIG generation shell script.  Someone
more familiar than me with shell scripts will need to fix them
to support this for Python 3 if desired.

llvm-svn: 252382
2015-11-07 01:08:25 +00:00
clang Use regex in test case. 2015-11-07 00:48:18 +00:00
clang-tools-extra Allow the alias to be of a different type. 2015-11-06 15:47:04 +00:00
compiler-rt [CMake] Need to filter ${arch}/*.c builtins as well as ${arch}/*.S builtins. 2015-11-06 23:19:29 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc integer: remove explicit casts from _MIN definitions 2015-10-06 19:12:12 +00:00
libcxx Allow deque to handle incomplete types. 2015-11-06 22:02:29 +00:00
libcxxabi Fix LIBCXXABI_HAS_NO_THREADS configuration. 2015-10-14 19:21:38 +00:00
libunwind Add FreeBSD _Unwind_Ptr typedef 2015-10-16 19:40:09 +00:00
lld Round up the memsize of PT_TLS. 2015-11-06 22:14:44 +00:00
lldb Python 3 - Use __bool__() instead of __nonzero__() for truthiness. 2015-11-07 01:08:25 +00:00
llgo debug: Update for debug info API change. 2015-11-05 22:04:20 +00:00
llvm Reapply "ADT: Require explicit ilist iterator/pointer conversions" 2015-11-07 00:59:29 +00:00
openmp Fix for zero chunk size 2015-11-06 20:32:44 +00:00
polly Fix non-affine region dominance of implicitely stored values 2015-11-07 00:36:50 +00:00