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

Tomasz Mikolajczyk tmmikolajczyk at gmail.com
Mon Jan 27 13:41:40 PST 2014

I haven't see the code but potentially the purpose of forking is to
handle internal compiler errors, especially the case when the child
process crashes when processing an input code. That may be easily
detected and handled properly by the parent process, by collecting the
trace, logs and by encouraging user to fill an issue in the bug DB,

On Mon, Jan 27, 2014 at 9:02 PM, Yuri <yuri at rawbw.com> wrote:
> I noticed that even the simple command 'clang -c -emit-llvm c.cpp' calls
> fork, and forks into itself.
> Why does it need to do this? This would potentially complicate profiling,
> debugging, etc. All tools should be fork-aware.
> Also unnecessary operation must cause some performance hit.
> It is understandable when compiler would, for example, fork into an external
> macro preprocessor, or assembler, or linker, but why into itself?
> Yuri
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list