mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
Get rid of exceptions in llvmc.
llvmc can be now compiled with llvm-gcc on Windows. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109215 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -7,29 +7,27 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Exception classes for llvmc.
|
||||
// Error handling.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H
|
||||
#define LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H
|
||||
|
||||
#include <stdexcept>
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace llvmc {
|
||||
|
||||
/// error_code - This gets thrown during the compilation process if a tool
|
||||
/// invocation returns a non-zero exit code.
|
||||
class error_code: public std::runtime_error {
|
||||
int Code_;
|
||||
public:
|
||||
error_code (int c)
|
||||
: std::runtime_error("Tool returned error code"), Code_(c)
|
||||
{}
|
||||
|
||||
int code() const { return Code_; }
|
||||
};
|
||||
inline void PrintError(const char* Err) {
|
||||
extern const char* ProgramName;
|
||||
llvm::errs() << ProgramName << ": " << Err << '\n';
|
||||
}
|
||||
|
||||
inline void PrintError(const std::string& Err) {
|
||||
PrintError(Err.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
#endif // LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H
|
||||
|
Reference in New Issue
Block a user