diff options
Diffstat (limited to 'tools/llvm-readobj/llvm-readobj.cpp')
-rw-r--r-- | tools/llvm-readobj/llvm-readobj.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/llvm-readobj/llvm-readobj.cpp b/tools/llvm-readobj/llvm-readobj.cpp index 70af4dc4cb..d66c02f413 100644 --- a/tools/llvm-readobj/llvm-readobj.cpp +++ b/tools/llvm-readobj/llvm-readobj.cpp @@ -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; } |