[llvm-readobj] - Simplify the code that creates dumpers. NFCI.
authorGeorgii Rymar <grimar@accesssoftek.com>
Thu, 27 Aug 2020 15:20:13 +0000 (18:20 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Fri, 28 Aug 2020 08:36:10 +0000 (11:36 +0300)
commit3fe01f0e215b7a41481806698efa087be6fe8897
treeae97e2fd967da04efdd5c03393d86a7535ae579c
parent4cd14256b23a19f4e7cf96628dda6cd6cec01be7
[llvm-readobj] - Simplify the code that creates dumpers. NFCI.

We have a few helper functions like the following:
```
std::error_code create*Dumper(...)
```

In fact we do not need or want to use `std::error_code` and the code
can be simpler if we just return `std::unique_ptr<ObjDumper>`.

This patch does this change and refines the signature of `createDumper`
as well.

Differential revision: https://reviews.llvm.org/D86718
llvm/tools/llvm-readobj/COFFDumper.cpp
llvm/tools/llvm-readobj/ELFDumper.cpp
llvm/tools/llvm-readobj/MachODumper.cpp
llvm/tools/llvm-readobj/ObjDumper.h
llvm/tools/llvm-readobj/WasmDumper.cpp
llvm/tools/llvm-readobj/XCOFFDumper.cpp
llvm/tools/llvm-readobj/llvm-readobj.cpp