Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
and abort()/exit() -> llvm_report_error().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75363 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
index 9820493..253c001 100644
--- a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
+++ b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
@@ -14,6 +14,7 @@
#include "llvm/GlobalValue.h"
#include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/Support/Compiler.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/System/Memory.h"
#include <map>
#include <vector>
@@ -356,8 +357,7 @@
// Check for overflow.
if (CurGlobalPtr > GlobalEnd) {
// FIXME: Allocate more memory.
- fprintf(stderr, "JIT ran out of memory for globals!\n");
- abort();
+ llvm_report_error("JIT ran out of memory for globals!");
}
return Result;
@@ -555,8 +555,7 @@
~(intptr_t)(Alignment-1));
if (CurStubPtr < StubBase) {
// FIXME: allocate a new block
- fprintf(stderr, "JIT ran out of memory for function stubs!\n");
- abort();
+ llvm_report_error("JIT ran out of memory for function stubs!");
}
return CurStubPtr;
}
@@ -567,10 +566,8 @@
std::string ErrMsg;
sys::MemoryBlock B = sys::Memory::AllocateRWX(size, BOld, &ErrMsg);
if (B.base() == 0) {
- fprintf(stderr,
- "Allocation failed when allocating new memory in the JIT\n%s\n",
- ErrMsg.c_str());
- abort();
+ llvm_report_error("Allocation failed when allocating new memory in the"
+ " JIT\n" + ErrMsg);
}
Blocks.push_back(B);
return B;