[cfe-dev] Why clang needs to fork into itself?
dimitry at andric.com
Mon Jan 27 13:56:58 PST 2014
Unfortunately, it is also incredibly wasteful. And lib/Support/Unix/Program.inc does not even use vfork(), which is at least a little lighter on system resources.
If I recall correctly, this point has already come up way in the past, but I cannot find the thread right now. I do recall that some fixes were proposed, but got shot down due to various problems... :-/
On 27 Jan 2014, at 22:41, Tomasz Mikolajczyk <tmmikolajczyk at gmail.com> wrote:
> 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?
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
More information about the cfe-dev