On 2012-10-11 21:38, Andrej Mitrovic wrote:

I guess it depends on what you get from clang. The XML I'm working on
has this sort of output:
   <File id="f3" name="git2/submodule.h"/>
   <File id="f4"
name="c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../include/inttypes.h"/>
   <File id="f39" 
name="c:/mingw/bin/../lib/gcc/mingw32/4.6.1/include/stddef.h"/>

I'm pretty sure I get the full path of every header. That is "/usr/home/foo/libgit2/includes/git2/submodule.h", or something similar.

This is translated into:
git2\submodule.d
mingw\include\inttypes.d
mingw\lib\gcc\mingw32\_4\_6\_1\include\stddef.d

The last one could use improvement (_4\_6\_1\ should be _4_6_1). I
call remDrive, chomp(".h"), chomp(".tcc"), translate slashes to dot,
and I make sure module names aren't keywords and it's done.

Yeah, that looks a bit ugly.

As for macros, I don't have access to those. If a symbol is
initialized with a macro then I get the post-processed value of the
macro, but I don't have the definition of the macro itself.

I haven't tackled macros yet. There are no API for this in libclang yet so I would have to create that first.

On the other hand, libclang do have an API for doxygen documentation which recently got added. If think that is awesome and it will be in the next release of Clang, which they recently announced the release schedule for.

--
/Jacob Carlborg

Reply via email to