[lld] r285224 - Call _exit.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 21:06:44 PST 2016


On Wed, Oct 26, 2016 at 11:59 AM, Rafael Espindola via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: rafael
> Date: Wed Oct 26 13:59:00 2016
> New Revision: 285224
>
> URL: http://llvm.org/viewvc/llvm-project?rev=285224&view=rev
> Log:
> Call _exit.
>
> As the state of lld gets more complicated, shutting down gets more
> expensive.
>
> In a normal lld run we can just call _exit immediately after renaming
> the temporary output file. We still want the ability to run a full
> shutdown since that is useful for detecting memory leaks.
>
> This patch adds a --full-shutdown flag and changes lit to use it.
>

Sorry for thread-necromancing.
A side-effect of this change is that, given we don't call destructors,
we lose some diagnostic capabilities that I (personally) consider
important.
Most notably, -mllvm -time-passes (on an LTO build) won't print
anything to stdout unless --full-shutdown is passed on the cmdline.
It's a bit of a POLA violation.
Considering how long an LTO build of reasonably sized software takes,
it's not the best user experience, IMHO. Also, understanding why
nothing is printed is not entirely obvious (need to know about
--full-shutdown and understand that -time-passes actually prints in
the destructor [the latter should be more natural to understand, but
still]).

With that in mind, I'm not sure there's a lot we can do without
switching the default (which I'm not entirely in favour of). Maybe,
Rafael, we can document what's the lld default behavior and bring this
case as an example so that people are less surprised?

Let me know what you think.


--
Davide


More information about the llvm-commits mailing list