summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2015-09-02 20:53:43 +0000
committerEnrico Granata <egranata@apple.com>2015-09-02 20:53:43 +0000
commit17168384cdbddebdc47f894a28a059ad6edd00c9 (patch)
treeee08da2983ef47d5d809eeb90d6622bd551a7d2a /lldb/scripts/Python
parentb6f39cbba284d1adfa1505c29857e1ea3b3cfe13 (diff)
downloadbcm5719-llvm-17168384cdbddebdc47f894a28a059ad6edd00c9.tar.gz
bcm5719-llvm-17168384cdbddebdc47f894a28a059ad6edd00c9.zip
We want Python int or long to both be usable as-a tid_t for API purposes. Introduce a typemap to this effect
llvm-svn: 246709
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r--lldb/scripts/Python/python-typemaps.swig12
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/scripts/Python/python-typemaps.swig b/lldb/scripts/Python/python-typemaps.swig
index 91d4c7360d5..a3ce3b3de72 100644
--- a/lldb/scripts/Python/python-typemaps.swig
+++ b/lldb/scripts/Python/python-typemaps.swig
@@ -25,6 +25,18 @@
}
}
+%typemap(in) lldb::tid_t {
+ if (PyInt_Check($input))
+ $1 = PyInt_AsLong($input);
+ else if (PyLong_Check($input))
+ $1 = PyLong_AsLong($input);
+ else
+ {
+ PyErr_SetString(PyExc_ValueError, "Expecting an integer");
+ return NULL;
+ }
+}
+
%typemap(typecheck) char ** {
/* Check if is a list */
$1 = 1;
OpenPOWER on IntegriCloud