2015-08-06 22:58:50 +08:00
|
|
|
//===- Error.cpp ----------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Linker
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "Error.h"
|
|
|
|
|
|
|
|
#include "llvm/ADT/Twine.h"
|
2016-07-15 08:40:46 +08:00
|
|
|
#include "llvm/Support/Error.h"
|
2015-08-06 22:58:50 +08:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
|
|
|
|
namespace lld {
|
|
|
|
namespace coff {
|
|
|
|
|
2016-07-15 07:37:14 +08:00
|
|
|
void fatal(const Twine &Msg) {
|
2015-08-06 22:58:50 +08:00
|
|
|
llvm::errs() << Msg << "\n";
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2016-07-15 08:40:46 +08:00
|
|
|
void fatal(std::error_code EC, const Twine &Msg) {
|
|
|
|
fatal(Msg + ": " + EC.message());
|
2015-08-06 22:58:50 +08:00
|
|
|
}
|
|
|
|
|
2016-07-15 08:40:46 +08:00
|
|
|
void fatal(llvm::Error &Err, const Twine &Msg) {
|
|
|
|
fatal(errorToErrorCode(std::move(Err)), Msg);
|
2016-06-30 06:27:45 +08:00
|
|
|
}
|
|
|
|
|
2015-08-06 22:58:50 +08:00
|
|
|
} // namespace coff
|
|
|
|
} // namespace lld
|