[PATCH] D64505: [Support] Move the static initializer install_out_memory_new_handler to InitLLVM
JF Bastien via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 10 15:56:43 PDT 2019
jfb added a comment.
In D64505#1579592 <https://reviews.llvm.org/D64505#1579592>, @rnk wrote:
> In D64505#1579577 <https://reviews.llvm.org/D64505#1579577>, @jfb wrote:
>
> > So you're saying: maybe it's a bug if we install one but there was already one installed?
>
>
> Yes. And the user can call llvm_shutdown without setting creating an `InitLLVM` object, so llvm_shutdown shouldn't assume that LLVM's new handler is in use.
>
> So, I think this change is fine as is:
>
> - LLVM tools want this OOM handler, and they use InitLLVM to set up crash handlers
> - Users of LLVM as a library should avoid InitLLVM and set their own OOM handler if they want one
Is there a diagnostic that we can add to catch misuses for `InitLLVM`?
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64505/new/
https://reviews.llvm.org/D64505
More information about the llvm-commits
mailing list