mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-05 11:17:53 +00:00
Remove 'using std::error_code' from tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210876 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -41,7 +41,6 @@
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::object;
|
||||
using std::error_code;
|
||||
|
||||
namespace opts {
|
||||
cl::list<std::string> InputFilenames(cl::Positional,
|
||||
@@ -142,7 +141,7 @@ static int ReturnValue = EXIT_SUCCESS;
|
||||
|
||||
namespace llvm {
|
||||
|
||||
bool error(error_code EC) {
|
||||
bool error(std::error_code EC) {
|
||||
if (!EC)
|
||||
return false;
|
||||
|
||||
@@ -161,8 +160,7 @@ bool relocAddressLess(RelocationRef a, RelocationRef b) {
|
||||
|
||||
} // namespace llvm
|
||||
|
||||
|
||||
static void reportError(StringRef Input, error_code EC) {
|
||||
static void reportError(StringRef Input, std::error_code EC) {
|
||||
if (Input == "-")
|
||||
Input = "<stdin>";
|
||||
|
||||
@@ -180,8 +178,8 @@ static void reportError(StringRef Input, StringRef Message) {
|
||||
}
|
||||
|
||||
/// @brief Creates an format-specific object file dumper.
|
||||
static error_code createDumper(const ObjectFile *Obj, StreamWriter &Writer,
|
||||
std::unique_ptr<ObjDumper> &Result) {
|
||||
static std::error_code createDumper(const ObjectFile *Obj, StreamWriter &Writer,
|
||||
std::unique_ptr<ObjDumper> &Result) {
|
||||
if (!Obj)
|
||||
return readobj_error::unsupported_file_format;
|
||||
|
||||
@@ -200,7 +198,7 @@ static error_code createDumper(const ObjectFile *Obj, StreamWriter &Writer,
|
||||
static void dumpObject(const ObjectFile *Obj) {
|
||||
StreamWriter Writer(outs());
|
||||
std::unique_ptr<ObjDumper> Dumper;
|
||||
if (error_code EC = createDumper(Obj, Writer, Dumper)) {
|
||||
if (std::error_code EC = createDumper(Obj, Writer, Dumper)) {
|
||||
reportError(Obj->getFileName(), EC);
|
||||
return;
|
||||
}
|
||||
@@ -245,7 +243,7 @@ static void dumpArchive(const Archive *Arc) {
|
||||
ArcE = Arc->child_end();
|
||||
ArcI != ArcE; ++ArcI) {
|
||||
std::unique_ptr<Binary> child;
|
||||
if (error_code EC = ArcI->getAsBinary(child)) {
|
||||
if (std::error_code EC = ArcI->getAsBinary(child)) {
|
||||
// Ignore non-object files.
|
||||
if (EC != object_error::invalid_file_type)
|
||||
reportError(Arc->getFileName(), EC.message());
|
||||
@@ -270,7 +268,7 @@ static void dumpInput(StringRef File) {
|
||||
|
||||
// Attempt to open the binary.
|
||||
ErrorOr<Binary *> BinaryOrErr = createBinary(File);
|
||||
if (error_code EC = BinaryOrErr.getError()) {
|
||||
if (std::error_code EC = BinaryOrErr.getError()) {
|
||||
reportError(File, EC);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user