[cfe-dev] How to compile the sources using Clang API?

Alp Toker alp at nuanti.com
Tue May 27 10:57:12 PDT 2014


On 27/05/2014 18:05, Anton Smirnov wrote:
> 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.


>
> Anybody?
>
> Thanks and regards,
> Anton.
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-dev mailing list