2008-05-12 16:31:42 +00:00
|
|
|
//===--- Error.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open
|
|
|
|
// Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2009-03-02 09:01:39 +00:00
|
|
|
// Exception classes for llvmc.
|
2008-05-12 16:31:42 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-03-02 09:02:28 +00:00
|
|
|
#ifndef LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H
|
|
|
|
#define LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H
|
2008-05-12 16:31:42 +00:00
|
|
|
|
|
|
|
#include <stdexcept>
|
|
|
|
|
|
|
|
namespace llvmc {
|
|
|
|
|
2009-03-02 09:01:39 +00:00
|
|
|
/// error_code - This gets thrown during the compilation process if a tool
|
|
|
|
/// invocation returns a non-zero exit code.
|
2008-05-12 16:31:42 +00:00
|
|
|
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_; }
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-03-02 09:02:28 +00:00
|
|
|
#endif // LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H
|