clang -ast-dump-xml....

Hi !

I’m quite newbie with LLVM, so when replying please give sufficient information please. :slight_smile:

I want to use LLVM in windows, but apparently clang currently does not support linking of C++ classes against
microsoft compiler - due to export symbols mangling.

Subject was discussed on thread: http://comments.gmane.org/gmane.comp.compilers.clang.devel/20068
and I’ve tried to contact Timur Iskhodzhanov - but without success yet.

According to bugzilla - http://llvm.org/bugs/show_bug.cgi?id=12477
whole approach looks like non-stable yet.

Meanwhile - I thought to give a shot alternative approach - if I could create wrapper and stub C modules

  • wrapper for clang, which would hide C++ - narrowing to pure C exports, and stub code for microsoft compiler, which
    would do the same thing on callee side.

In order to create such wrapper / stub modules - I need to walk through function prototypes and typedefinitions
available in source code and generate code according to that meta-data.

I have located that clang has two kind of special command line arguments- like ‘-ast-dump’ and ‘-ast-dump-xml’
(available in debug version only for some reason) - which does something that I need.

For some weird reason those parameters works only with -cc1 command line parameter. (Why ?)

I’ve located one manual - http://llvm.org/docs/ProgrammersManual.html#isa which suggest also how to walk through type
information, and I guess DumpXML.cpp gives more descriptive example.

Can you recommend me how you would integrate this kind of wrapper / stub generation into llvm / clang -
may be I could refresh ‘-ast-dump-xml’ command argument to walk also for normal compilation pass - what kind of problems /
open issues you see about it ?

What does -cc1 stands for ?