diff options
| author | Edwin Török <edwintorok@gmail.com> | 2009-07-07 17:32:34 +0000 |
|---|---|---|
| committer | Edwin Török <edwintorok@gmail.com> | 2009-07-07 17:32:34 +0000 |
| commit | f7cbfea6ad05c37faa3449be206c7d60f8252f5d (patch) | |
| tree | 038fcdc29c6f146048427213045ae05a3e4fe0b8 /lib/ExecutionEngine | |
| parent | 6a3fb987360ceb2d861aab450f789729317a2e56 (diff) | |
| download | external_llvm-f7cbfea6ad05c37faa3449be206c7d60f8252f5d.zip external_llvm-f7cbfea6ad05c37faa3449be206c7d60f8252f5d.tar.gz external_llvm-f7cbfea6ad05c37faa3449be206c7d60f8252f5d.tar.bz2 | |
Introduce new error handling API.
This will replace exit()/abort() style error handling with an API
that allows clients to register custom error handling hooks.
The default is to call exit(1) when no error handler is provided.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74922 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
| -rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 8 | ||||
| -rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index a80513f..69518b6 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -22,6 +22,7 @@ #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MutexGuard.h" #include "llvm/System/DynamicLibrary.h" #include "llvm/System/Host.h" @@ -640,7 +641,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) { case Type::FP128TyID: { APFloat apfLHS = APFloat(LHS.IntVal); switch (CE->getOpcode()) { - default: assert(0 && "Invalid long double opcode"); abort(); + default: assert(0 && "Invalid long double opcode");llvm_unreachable(); case Instruction::FAdd: apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); GV.IntVal = apfLHS.bitcastToAPInt(); @@ -953,9 +954,8 @@ void ExecutionEngine::emitGlobals() { sys::DynamicLibrary::SearchForAddressOfSymbol(I->getName().c_str())) addGlobalMapping(I, SymAddr); else { - cerr << "Could not resolve external global address: " - << I->getName() << "\n"; - abort(); + llvm_report_error("Could not resolve external global address: " + +I->getName()); } } } diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 1d8312f..785b5b9 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -27,6 +27,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetJITInfo.h" #include "llvm/Support/Dwarf.h" +#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MutexGuard.h" #include "llvm/System/DynamicLibrary.h" #include "llvm/Config/config.h" @@ -671,9 +672,8 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) { #endif Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(GV->getName().c_str()); if (Ptr == 0 && !areDlsymStubsEnabled()) { - cerr << "Could not resolve external global address: " - << GV->getName() << "\n"; - abort(); + llvm_report_error("Could not resolve external global address: " + +GV->getName()); } addGlobalMapping(GV, Ptr); } else { |
