diff options
author | Enrico Granata <egranata@apple.com> | 2013-06-21 18:57:30 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-06-21 18:57:30 +0000 |
commit | c972c70e6097addb1255f602cdc4ae20a3e560d8 (patch) | |
tree | 450a6422415903296a08be1d33bd70e5ef456691 /lldb/scripts/Python/build-swig-Python.sh | |
parent | b6e6cd356e3be97e4412cddeeaa71269a5919fca (diff) | |
download | bcm5719-llvm-c972c70e6097addb1255f602cdc4ae20a3e560d8.tar.gz bcm5719-llvm-c972c70e6097addb1255f602cdc4ae20a3e560d8.zip |
Change the SWIG wrappers to stop directly casting SB object to SWIG objects, and instead use a safer type-checked API (thanks templates)
Any time a SWIG wrapper needs a PyObject for an SB object, it now should call into SBTypeToSWIGWrapper<SBType>(SBType*)
If you try to use it on an SBType for which there is not an implementation yet, LLDB will fail to link - just add your specialization to python-swigsafecast.swig and rebuild
This is the first step in simplifying our SWIG Wrapper layer
llvm-svn: 184580
Diffstat (limited to 'lldb/scripts/Python/build-swig-Python.sh')
-rwxr-xr-x | lldb/scripts/Python/build-swig-Python.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/scripts/Python/build-swig-Python.sh b/lldb/scripts/Python/build-swig-Python.sh index efbc7485a6c..96c4b2b73f6 100755 --- a/lldb/scripts/Python/build-swig-Python.sh +++ b/lldb/scripts/Python/build-swig-Python.sh @@ -46,6 +46,7 @@ swig_input_file=${SRC_ROOT}/scripts/lldb.swig swig_python_extensions=${SRC_ROOT}/scripts/Python/python-extensions.swig swig_python_wrapper=${SRC_ROOT}/scripts/Python/python-wrapper.swig swig_python_typemaps=${SRC_ROOT}/scripts/Python/python-typemaps.swig +swig_python_swigsafecast=${SRC_ROOT}/scripts/Python/python-swigsafecast.swig if [ "$LLDB_DISABLE_PYTHON" = "1" ] ; then # We don't want Python for this build, but touch the output file so we don't have to @@ -278,6 +279,19 @@ then fi fi +if [ $NeedToUpdate -eq 0 ] +then + if [ ${swig_python_swigsafecast} -nt ${swig_output_file} ] + then + NeedToUpdate=1 + if [ $Debug -eq 1 ] + then + echo "${swig_python_swigsafecast} is newer than ${swig_output_file}" + echo "swig file will need to be re-built." + fi + fi +fi + python_version=`/usr/bin/env python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'` if [ $MakefileCalled -eq 0 ] |