[cfe-dev] [ping] extra libclang functionality for the xdress project

Geoffrey Irving irving at naml.us
Wed Nov 13 11:17:34 PST 2013


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

On Wed, Nov 13, 2013 at 11:11 AM, Argyrios Kyrtzidis
<kyrtzidis at apple.com> wrote:
> Hi Geoffrey,
>
> Thanks a lot for your work. I'm going to review your patches soon(ish).
>
> On Nov 13, 2013, at 10:54 AM, Geoffrey Irving <irving at naml.us> wrote:
>
>> 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
>>
>> ---------- Forwarded message ----------
>> From: Geoffrey Irving <irving at naml.us>
>> Date: Thu, Nov 7, 2013 at 11:08 AM
>> Subject: Re: [PATCH] extra libclang functionality for the xdress project
>> To: Alp Toker <alp at nuanti.com>
>> Cc: Anthony Scopatz <scopatz at gmail.com>, cfe-commits at cs.uiuc.edu,
>> Argyrios Kyrtzidis <akyrtzi at gmail.com>
>>
>>
>> On Wed, Nov 6, 2013 at 7:39 AM, Alp Toker <alp at nuanti.com> wrote:
>>>
>>> On 06/11/2013 14:55, Anthony Scopatz wrote:
>>>> Hello All,
>>>>
>>>> Could we please hear some response on this?  Thanks!
>>>
>>> Hello Anthony, Geoffrey,
>>>
>>> Thanks for the contribution.
>>>
>>> You'll need to rebase this work against current SVN, add at least a
>>> couple of standard lit tests and probably split it up into two or three
>>> bite-size chunks for review.
>>>
>>> Once that's done, it can also help to CC in others who've recently
>>> worked on the C API in order to get buy-in.
>>>
>>> As for the Geoffrey's build problem, it's best to ask that as a separate
>>> question, including details about the platform and configuration if
>>> you're still struggling.
>>>
>>> Good luck with the patch :-)
>>>
>>> Alp.
>>>
>>>
>>>
>>>>
>>>> Be Well
>>>> Anthony
>>>>
>>>>
>>>> On Sun, Nov 3, 2013 at 5:46 PM, Geoffrey Irving <irving at naml.us
>>>> <mailto:irving at naml.us>> wrote:
>>>>
>>>>    Here are four patches improving libclang in various ways for use in
>>>>    xdress (http://xdress.org).  In order, they add
>>>>
>>>>    1. Python support for clang_formatDiagnostic.
>>>>    2. Access to public / private / protected specifiers.
>>>>    3. Template argument access (as new cursor types).
>>>>    4. A clang_Cursor_getDefaultArgument function.
>>>>
>>>>    They've all been tested inside xdress, but the patches themselves do
>>>>    not include tests.  Since questions about this stuff to cfe-dev were
>>>>    ignored, I want to make sure these patches will be looked at before I
>>>>    do potentially unnecessary work.
>>>>
>>>>    Caveat: llvm trunk does not build for me due to these errors:
>>>>
>>>>        llvm-build: error: invalid native target: 'x86_64' (not in
>>>>    project)
>>>>
>>>>    Therefore, these patches were written, built, and tested again
>>>>    release_33 plus several cherry-picked libclang commits.  It's possible
>>>>    they don't compile against the trunk.
>>>>
>>>>    Any ideas what would have caused this build breakage since release_33?
>>>>
>>>>    Thanks,
>>>>    Geoffrey
>>
>> Attached are updated versions of the four patches with both python and
>> c unit tests.  If anyone prefers git-svn, they are also here:
>>
>>    https://github.com/girving/clang/commits/xdress
>>    https://github.com/girving/clang/commits/a064ac67efe8cf4cf82219e9d8988d72406d3925
>>
>> Argyrios: I cc'ed you on Alp's suggestion since you touched the
>> libclang code recently.  Please let me know if you're up for looking
>> over the code, or know someone else you might be.
>>
>> One change from the previous code: the new
>> clang_Cursor_getDefaultArgument() supports only function parameters,
>> since my naive method for extracting template argument defaults
>> (calling the getDefaultArgument() function) didn't work.  I don't
>> actually need template argument defaults for now, but here's the patch
>> that *did not* work if anyone is curious:
>>
>>    https://github.com/girving/clang/commit/72879373f65e6eb08a94dcb4d74a5ff13532db2f
>>
>> Thanks!
>> Geoffrey
>> <0001-libclang-python-Expose-clang_formatDiagnostic-to-pyt.patch><0002-libclang-python-Expose-access-control-levels.patch><0003-libclang-Add-template-argument-support.patch>_______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list