LLVM API Documentation
00001 //===--- Error.h - The LLVM Compiler Driver ---------------------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open 00006 // Source License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // Exception classes for llvmc. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H 00015 #define LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H 00016 00017 #include <stdexcept> 00018 00019 namespace llvmc { 00020 00021 /// error_code - This gets thrown during the compilation process if a tool 00022 /// invocation returns a non-zero exit code. 00023 class error_code: public std::runtime_error { 00024 int Code_; 00025 public: 00026 error_code (int c) 00027 : std::runtime_error("Tool returned error code"), Code_(c) 00028 {} 00029 00030 int code() const { return Code_; } 00031 }; 00032 00033 } 00034 00035 #endif // LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H