From d39c594d39df7f283c2fb8a704a3f31c501180d9 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 17 Sep 2010 15:48:55 +0000 Subject: Vendor import of llvm r114020 (from the release_28 branch): http://llvm.org/svn/llvm-project/llvm/branches/release_28@114020 Approved by: rpaulo (mentor) --- include/llvm/CompilerDriver/Error.h | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'include/llvm/CompilerDriver/Error.h') diff --git a/include/llvm/CompilerDriver/Error.h b/include/llvm/CompilerDriver/Error.h index fa678cfbfb92..013094e5dd79 100644 --- a/include/llvm/CompilerDriver/Error.h +++ b/include/llvm/CompilerDriver/Error.h @@ -7,28 +7,22 @@ // //===----------------------------------------------------------------------===// // -// Exception classes for llvmc. +// Error handling. // //===----------------------------------------------------------------------===// #ifndef LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H #define LLVM_INCLUDE_COMPILER_DRIVER_ERROR_H -#include +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/raw_ostream.h" 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(llvm::StringRef Err) { + extern const char* ProgramName; + llvm::errs() << ProgramName << ": " << Err << '\n'; + } } -- cgit v1.2.3