[cfe-dev] Status/Future of libclang
Jacob Carlborg via cfe-dev
cfe-dev at lists.llvm.org
Sun Jul 10 12:06:32 PDT 2016
On 2016-07-08 21:10, Jonathan Müller via cfe-dev wrote:
> Hello,
>
> I'm working on a C++ documentation generator "standardese"
> (https://github.com/foonathan/standardese/). I'm using libclang for
> parsing.
>
> Unfortunately I've run into an issue with it: the API isn't providing me
> all the information that I need. There are things that aren't exposed by
> the API, for example whether a constructor is explicit, a function
> constexpr, or the noexcept expression.
>
> I was forced to go to manual parsing of the source code of a cursor by
> tokenizing it with the help of Boost.Wave (because libclang doesn't give
> me the preprocessed tokens). This worked relatively good but I now ran
> into an issue with template specializations (parsing `template <> class
> c<a < b> {};), so my naive approach doesn't work anymore and I'd need to
> write a fully fledged parser.
Have you tried clang_tokenize [1]? You might need to set the correct
options as well when creating the translation unit. Like
CXTranslationUnit_DetailedPreprocessingRecord [2].
> I've also encountered a few things that might be bugs.
> I can report those, but when looking at
> https://llvm.org/bugs/buglist.cgi?product=clang&component=libclang&resolution=---&list_id=100919,
> there are almost only unassigned, NEW bugs.
>
> I would volunteer to maintain it myself but I have no experience with
> the internal APIs or the clang project and I'm lacking the time to learn
> them *and* work on standardese.
>
> So my question: Is there someone actively maintaining libclang? What are
> the future plans for the API?
> If there is someone I'll provide active feedback and feature requests.
[1]
http://clang.llvm.org/doxygen/group__CINDEX__LEX.html#ga6b315a71102d4f6c95eb68894a3bda8a
[2]
http://clang.llvm.org/doxygen/group__CINDEX__TRANSLATION__UNIT.html#gab1e4965c1ebe8e41d71e90203a723fe9
--
/Jacob Carlborg
More information about the cfe-dev
mailing list