[llvm] r190730 - Make PrettyStackTraceEntry use ManagedStatic for its ThreadLocal.

Reid Kleckner rnk at google.com
Fri Sep 13 16:26:31 PDT 2013


On Fri, Sep 13, 2013 at 4:04 PM, Filip Pizlo <fpizlo at apple.com> wrote:

>
> On Sep 13, 2013, at 3:59 PM, Filip Pizlo <fpizlo at apple.com> wrote:
>
> Author: fpizlo
> Date: Fri Sep 13 17:59:47 2013
> New Revision: 190730
>
> URL: http://llvm.org/viewvc/llvm-project?rev=190730&view=rev
> Log:
> Make PrettyStackTraceEntry use ManagedStatic for its ThreadLocal.
>
> This was somewhat tricky because ~PrettyStackTraceEntry() may run after
> llvm_shutdown() has been called. This is rare and only happens for a
> common idiom
> used in the main() functions of command-line tools. This works around the
> idiom by
> skipping the stack clean-up if the PrettyStackTraceHead ManagedStatic is
> not
> constructed (i.e. llvm_shutdown() has been called).
>
>
> Modified:
>    llvm/trunk/include/llvm/Support/ManagedStatic.h
>    llvm/trunk/lib/Support/PrettyStackTrace.cpp
>
> Modified: llvm/trunk/include/llvm/Support/ManagedStatic.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ManagedStatic.h?rev=190730&r1=190729&r2=190730&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/ManagedStatic.h (original)
> +++ llvm/trunk/include/llvm/Support/ManagedStatic.h Fri Sep 13 17:59:47
> 2013
> @@ -99,7 +99,6 @@ public:
> /// llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
> void llvm_shutdown();
>
> -
>
>
> Eek!  Sorry about that. :-/
>
> Should I revert this change in a separate changeset or should I assume
> that the damage is already done and be more careful next time?
>

I wouldn't worry about it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130913/f9a3e2cb/attachment.html>


More information about the llvm-commits mailing list