How to compile the sources using Clang API?

Hey!

I’m using Clang in my IDE on mobile devices as built-in analyzer and for syntax highlighting. Can i (and how?) to compile the sources with Clang C++ API without executables running?

I’ve found blog post about it (http://fdiv.net/2012/08/15/compiling-code-clang-api), but it seems that Driver class runs clang and ld executables behind the scene.

Anybody?

Thanks and regards,
Anton.

Hey!

I'm using Clang in my IDE on mobile devices as built-in analyzer and for syntax highlighting. Can i (and how?) to compile the sources with Clang C++ API without executables running?

I've found blog post about it (http://fdiv.net/2012/08/15/compiling-code-clang-api), but it seems that `Driver` class runs `clang` and `ld` executables behind the scene.

It's possible to short-circuit the clang -cc1 / -as invocation to run in-process with a minor code tweak to the driver (there was a patch on the list, but it's easy enough to do yourself if you take a look where the process is invoked).

There's no easy way to do that for the linker invocation at present, however, since it's a distinct executable. Fortunately there are few linker invocations compared to the former during a typical compilation.

It's likely we'll be investigating proper in-process compilation support in small steps over the next release cycle.

Alp.

Thanks for showing direction!

Sorry, i did not catch that: in-memory linking is not possible at this time?