This is an archive of the discontinued LLVM Phabricator instance.

Don't use PyInt on Python 3
AbandonedPublic

Authored by cbiesinger on Jul 8 2019, 3:33 PM.

Details

Reviewers
clayborg
Summary

In Python 3, PyInt doesn't exist (all integers are PyLongs). This patch
makes LLVM not use PyInt when compiling for Python 3. (Some code already
had such #ifs)

Event Timeline

cbiesinger created this revision.Jul 8 2019, 3:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2019, 3:33 PM
cbiesinger abandoned this revision.Jul 8 2019, 3:49 PM

It seems this wasn't necessary, I had just misconfigured my build. (I don't understand how this works though...)

Ah, this works because Swig (?) adds compatibility macros to LLDBWrapPython:
#define PyInt_Check(x) PyLong_Check(x)
#define PyInt_AsLong(x) PyLong_AsLong(x)
#define PyInt_FromLong(x) PyLong_FromLong(x)
#define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
(etc)

ok, so do you want to abandon this patch?

Yeah. (I thought I did? I'm not super familiar with this interface)

never mind, I missed that you had!