[cfe-dev] Status/Future of libclang

Reece Dunn via cfe-dev cfe-dev at lists.llvm.org
Sat Jul 9 09:13:49 PDT 2016


On 9 July 2016 at 16:27, Jonathan Coe via cfe-dev <cfe-dev at lists.llvm.org>
wrote:

>
>
> On 9 July 2016 at 16:13, Stephen Kelly via cfe-dev <cfe-dev at lists.llvm.org
> > wrote:
>
>> Jonathan Müller via cfe-dev wrote:
>>
>> > On 08.07.2016 22:38, David Come wrote:
>> >> Just go for the C++ API : libtooling
>> >>
>> >> You will have all you need.
>>
>> You will not have compatibility between versions.
>>
>> > So you're basically saying: the state of libclang is intentional, use
>> > something else?
>>
>> Jonathan, I have the same questions as you. I also have not encountered an
>> authoritative answer.
>>
>> You might encounter the same problem I did if you want to determine the
>> default values of method parameters:
>>
>>  http://thread.gmane.org/gmane.comp.compilers.clang.devel/48738
>>
>> Our solution is the same - try to parse the text ourselves because
>> libclang
>> and the python bindings do not expose it.
>>
>>
> I've written small extensions to libclang and to the python bindings to
> get a code generator I wrote working. If there is a small number of missing
> features maybe you could do the same?
>

When I was writing by own libclang python bindings (
https://github.com/rhdunn/libclangpy) I had to write custom logic on top of
the direct bindings to fix bugs in libclang (e.g. CursorKind_LinkageSpec is
not mapped to the API, so `extern "C" ...` does not work) and some support
for the newer APIs on older versions of libclang.

I also wrote my own tests for the binding to make sure the APIs worked
consistently on the target and later versions of libclang.

My verdict was that it was a second class citizen to the unstable C++ API.

Thanks,
Reece

Hopefully there is a more authoritative answer about the state of libclang.
>>
>> Thanks,
>>
>> Steve.
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160709/5f387829/attachment.html>


More information about the cfe-dev mailing list