Files
llvm/lld/ELF/Error.cpp
Rui Ueyama 1940424632 ELF: Report multiple errors from the driver.
This patch let the driver keep going until it parses all
command line options.

http://reviews.llvm.org/D16645

llvm-svn: 259143
2016-01-29 01:54:52 +00:00

58 lines
1.1 KiB
C++

//===- 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"
#include "llvm/Support/raw_ostream.h"
namespace lld {
namespace elf2 {
bool HasError;
void warning(const Twine &Msg) { llvm::errs() << Msg << "\n"; }
void error(const Twine &Msg) {
llvm::errs() << Msg << "\n";
HasError = true;
}
bool error(std::error_code EC, const Twine &Prefix) {
if (!EC)
return false;
error(Prefix + ": " + EC.message());
return true;
}
bool error(std::error_code EC) {
if (!EC)
return false;
error(EC.message());
return true;
}
void fatal(const Twine &Msg) {
llvm::errs() << Msg << "\n";
exit(1);
}
void fatal(std::error_code EC, const Twine &Prefix) {
if (EC)
fatal(Prefix + ": " + EC.message());
}
void fatal(std::error_code EC) {
if (EC)
fatal(EC.message());
}
} // namespace elf2
} // namespace lld