[ping] extra libclang functionality for the xdress project

Alp Toker recommended I cc you folk for thoughts on my patches to
libclang, since you seem to be involved in a libclang-related
discussion. So far I haven't gotten in responses from people involved
in libclang. Thanks Alp!

The three patches are attached. They add additional functionality
that I needed to write a clang frontend for the xdress python wrapper
generator project. All three patches come with passing unit tests. I
am happy to do extra work to clean them up if requested!

If I can get these in, there will be other followup patches. Also, my
previous email had four patches: this email removes the
clang_Cursor_getDefaultArgument patch since further work exposed a bug
(it called a C++ routine which assert()'ed various conditions). This
is fixed, but I haven't yet extended the unit tests to detect the bug.
I will resubmit once I do this.

Stepping back, I would greatly appreciate any advice for how to go
about patch submission for libclang in future, since I already have a
few followup patches and may generate more going forwards (though I
think I have nearly all the functionality needed by xdress).

Thanks,
Geoffrey

0001-libclang-python-Expose-clang_formatDiagnostic-to-pyt.patch (2.09 KB)

0002-libclang-python-Expose-access-control-levels.patch (3.9 KB)

0003-libclang-Add-template-argument-support.patch (21 KB)

Hi Geoffrey,

Thanks a lot for your work. I'm going to review your patches soon(ish).

Great! There is no hurry, since I'm not blocked, and I still have
various other patches to clean up. When you do get around to them,
feel free to ask for large rewrites, given that this is intended to be
a long term stable API.

Quick configuration question: when Anthony tried to compile my code he
ran into a bunch of non-C99 errors:

    c-index-test.c:1299:3: error: ‘for’ loop initial declarations are
only allowed in C99 mode

Is there a configure option to make llvm+clang builds stricter so that
I can catch such errors in future?

Geoffrey

CMake build passes -std=c89 for c-index-test.c

Dmitri

I don't see that, which I suppose means I'm not building with cmake.
Does toplevel "configure" as recommended in the "Getting Started" page
set up a different build system?

    cd llvm
    ./configure
    make

Geoffrey

Yes, this is different. LLVM and Clang support two build systems:
autoconf-based (./configure && make), and CMake (cmake <options> &&
<make/ninja/xcodebuild>).

Dmitri