[PATCH] D64505: [Support] Move the static initializer install_out_memory_new_handler to InitLLVM

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 14:22:53 PDT 2019


rnk added a comment.

In D64505#1578699 <https://reviews.llvm.org/D64505#1578699>, @jfb wrote:

> Does it make sense to reset any previous handler in `llvm_shutdown`?


Doing so would require saving the current handler somewhere, if one exists.

InitLLVM really only works if you call it in main at the start of the program (see how it rewrites argv). If a user wants to initialize LLVM as a library and then shut it down, I would expect the user to avoid InitLLVM and instead use llvm_shutdown directly. With this change, they won't get LLVM's OOM handler, but that seems desirable. It's easy for them to set their own to one that is equivalent to LLVM's if desired.


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