[cfe-dev] tests of bindings/python fail?

Eli Bendersky eliben at gmail.com
Sun Jul 3 20:16:57 PDT 2011

| We'll happily commit patches to keep the Python bindings working.

>   - Doug

I'm attaching a patch (diffed against trunk) with some fixes to the Python
bindings, making its tests pass again (on Linux and Windows).

Some details of the patch:

* Implemented a new function in libclang: clang_isAttr - it is similar to
existing clang_Is* functions. Also exposed it to the Python bindings as the
is_attr method of Cursor
* Fixing TranslationUnit.get_includes to only go through the argument buffer
when it contains something. This fixed a crash on Windows
* clang_getFileName returns CXString, not char*. Made appropriate fixes in
cindex.py - now the relevant tests pass and we can see the full locations
correctly again (previously there was garbage in place of the file name)
* Exposed clang_getCursorDisplayName to the python bindings

P.S. the patch file was created with 'svn diff' in the root of clang, so it
should be applied as 'patch -p0' there. I hope this is an accepted way to
submit patches - if something different is required, I'll gladly fix.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110704/92229e5f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pybindings_fixes.patch
Type: text/x-patch
Size: 6159 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110704/92229e5f/attachment.bin>

More information about the cfe-dev mailing list