blob: c0aaff1a7245823ca1b6309d1cd6d2fb84e7f69b [file] [log] [blame]
Mikhail Glushenkovd61ed932008-05-12 16:31:42 +00001//===--- Error.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open
6// Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Exception classes for LLVMC.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TOOLS_LLVMC2_ERROR_H
15#define LLVM_TOOLS_LLVMC2_ERROR_H
16
17#include <stdexcept>
18
19namespace llvmc {
20
21 class error_code: public std::runtime_error {
22 int Code_;
23 public:
24 error_code (int c)
25 : std::runtime_error("Tool returned error code"), Code_(c)
26 {}
27
28 int code() const { return Code_; }
29 };
30
31}
32
33#endif //LLVM_TOOLS_LLVMC2_ERROR_H