[PATCH] extra libclang functionality for the xdress project

Geoffrey Irving irving at naml.us
Thu Nov 7 11:08:10 PST 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libclang-python-Expose-clang_formatDiagnostic-to-pyt.patch
Type: text/x-patch
Size: 2142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131107/81231f9f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-libclang-python-Expose-access-control-levels.patch
Type: text/x-patch
Size: 3990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131107/81231f9f/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-libclang-Add-template-argument-support.patch
Type: text/x-patch
Size: 21530 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131107/81231f9f/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-libclang-Add-clang_Cursor_getDefaultArgument.patch
Type: text/x-patch
Size: 6850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131107/81231f9f/attachment-0003.bin>


More information about the cfe-commits mailing list