diff options
author | Chris Lattner <sabre@nondot.org> | 2006-07-07 17:31:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-07-07 17:31:41 +0000 |
commit | 1fb6e0d79da834bed4ff965ae4ad876f583afce4 (patch) | |
tree | 47a0e305555b9e291b8395853deceff9d0d8d889 /llvm/lib | |
parent | 5053e153e3d251e03915dcd69523d9b6c70424e6 (diff) | |
download | bcm5719-llvm-1fb6e0d79da834bed4ff965ae4ad876f583afce4.tar.gz bcm5719-llvm-1fb6e0d79da834bed4ff965ae4ad876f583afce4.zip |
Change AllocateRWX/DeallocateRWX do not throw an exception.
llvm-svn: 29057
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp index ef9e43a44f7..5e130167279 100644 --- a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -414,17 +414,17 @@ unsigned char *JITMemoryManager::allocateStub(unsigned StubSize) { } sys::MemoryBlock JITMemoryManager::getNewMemoryBlock(unsigned size) { - try { - // Allocate a new block close to the last one. - const sys::MemoryBlock *BOld = Blocks.empty() ? 0 : &Blocks.front(); - sys::MemoryBlock B = sys::Memory::AllocateRWX(size, BOld); - Blocks.push_back(B); - return B; - } catch (std::string &err) { + // Allocate a new block close to the last one. + const sys::MemoryBlock *BOld = Blocks.empty() ? 0 : &Blocks.front(); + std::string ErrMsg; + sys::MemoryBlock B = sys::Memory::AllocateRWX(size, BOld, &ErrMsg); + if (B.base() == 0) { std::cerr << "Allocation failed when allocating new memory in the JIT\n"; - std::cerr << err << "\n"; + std::cerr << ErrMsg << "\n"; abort(); } + Blocks.push_back(B); + return B; } //===----------------------------------------------------------------------===// |