]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lld/COFF/Error.cpp
Restructure libz, place vendor files in contrib/zlib like other third
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lld / COFF / Error.cpp
1 //===- Error.cpp ----------------------------------------------------------===//
2 //
3 //                             The LLVM Linker
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "Error.h"
11
12 #include "llvm/ADT/Twine.h"
13 #include "llvm/Support/Error.h"
14 #include "llvm/Support/raw_ostream.h"
15
16 namespace lld {
17 namespace coff {
18
19 void fatal(const Twine &Msg) {
20   llvm::errs() << Msg << "\n";
21   exit(1);
22 }
23
24 void fatal(std::error_code EC, const Twine &Msg) {
25   fatal(Msg + ": " + EC.message());
26 }
27
28 void fatal(llvm::Error &Err, const Twine &Msg) {
29   fatal(errorToErrorCode(std::move(Err)), Msg);
30 }
31
32 } // namespace coff
33 } // namespace lld