summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/ErrorHandling.cpp
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2018-02-15 09:45:59 +0000
committerSerge Pavlov <sepavloff@gmail.com>2018-02-15 09:45:59 +0000
commit4500001905805be5437cfe21e9f65820202c8966 (patch)
tree93ba69588b99c6008de5d6306d91c0a9ddf0feae /llvm/lib/Support/ErrorHandling.cpp
parentce719a0def0054c03a9787ddb5a1e0235bbea103 (diff)
downloadbcm5719-llvm-4500001905805be5437cfe21e9f65820202c8966.tar.gz
bcm5719-llvm-4500001905805be5437cfe21e9f65820202c8966.zip
Revert r325224 "Report fatal error in the case of out of memory"
It caused fails on some buildbots. llvm-svn: 325227
Diffstat (limited to 'llvm/lib/Support/ErrorHandling.cpp')
-rw-r--r--llvm/lib/Support/ErrorHandling.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
index cb14749cc42..fb8ae4c1cd5 100644
--- a/llvm/lib/Support/ErrorHandling.cpp
+++ b/llvm/lib/Support/ErrorHandling.cpp
@@ -175,39 +175,6 @@ void llvm::report_bad_alloc_error(const char *Reason, bool GenCrashDiag) {
#endif
}
-#ifdef LLVM_ENABLE_EXCEPTIONS
-// Do not set custom new handler if exceptions are enabled. In this case OOM
-// errors are handled by throwing 'std::bad_alloc'.
-void llvm::install_out_of_memory_new_handler() {
-}
-#else
-// Causes crash on allocation failure. It is called prior to the handler set by
-// 'install_bad_alloc_error_handler'.
-static void out_of_memory_new_handler() {
- llvm::report_bad_alloc_error("Allocation failed");
-}
-
-// Installs new handler that causes crash on allocation failure. It does not
-// need to be called explicitly, if this file is linked to application, because
-// in this case it is called during construction of 'new_handler_installer'.
-void llvm::install_out_of_memory_new_handler() {
- static bool out_of_memory_new_handler_installed = false;
- if (!out_of_memory_new_handler_installed) {
- std::set_new_handler(out_of_memory_new_handler);
- out_of_memory_new_handler_installed = true;
- }
-}
-
-// Static object that causes installation of 'out_of_memory_new_handler' before
-// execution of 'main'.
-static class NewHandlerInstaller {
-public:
- NewHandlerInstaller() {
- install_out_of_memory_new_handler();
- }
-} new_handler_installer;
-#endif
-
void llvm::llvm_unreachable_internal(const char *msg, const char *file,
unsigned line) {
// This code intentionally doesn't call the ErrorHandler callback, because
OpenPOWER on IntegriCloud