[all-commits] [llvm/llvm-project] 3fe01f: [llvm-readobj] - Simplify the code that creates du...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Fri Aug 28 01:44:41 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3fe01f0e215b7a41481806698efa087be6fe8897
      https://github.com/llvm/llvm-project/commit/3fe01f0e215b7a41481806698efa087be6fe8897
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-08-28 (Fri, 28 Aug 2020)

  Changed paths:
    M llvm/tools/llvm-readobj/COFFDumper.cpp
    M llvm/tools/llvm-readobj/ELFDumper.cpp
    M llvm/tools/llvm-readobj/MachODumper.cpp
    M llvm/tools/llvm-readobj/ObjDumper.h
    M llvm/tools/llvm-readobj/WasmDumper.cpp
    M llvm/tools/llvm-readobj/XCOFFDumper.cpp
    M llvm/tools/llvm-readobj/llvm-readobj.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list