[cfe-dev] Why clang needs to fork into itself?

Yuri yuri at rawbw.com
Mon Jan 27 16:48:47 PST 2014


On 01/27/2014 16:37, Jean-Daniel Dupas wrote:
> If you want to debug/profile clang, you can invoke it directly with the -cc1 flag, and passing the right arguments.
>
> To get the full command line used to invoke the real compilation process, you can use the -### argument:
>
> clang -### -c -emit-llvm c.cpp
>
> For the record, in the early days, the clang driver was a separate binary that used to invoke the compiler (which was called ccc IIRC).
> Some time ago, the driver and the compiler were merged into a single clang binary, but it continue to work the same way it used to do. That explains why it executes itself.

I see.
So I wrote up my proposal to make this opt-in: 
http://llvm.org/bugs/show_bug.cgi?id=18638

Yuri



More information about the cfe-dev mailing list