SuccessChanges

Summary

  1. [llvm-reduce] Skip chunks that lead to broken modules. (details)
  2. [unittests/Object] - Add testing for missing ELF formats. (details)
  3. [llvm-readobj][test] - Test "Format" values. (details)
  4. [llvm-readobj] - Simplify the code that creates dumpers. NFCI. (details)
Commit ba7c79cb3a69dd6ec2256afa9913214e63aea0d7 by flo
[llvm-reduce] Skip chunks that lead to broken modules.

Some reduction passes may create invalid IR. I am not aware of any use
case where we would like to proceed reducing invalid IR. Various utils
used here, including CloneModule, assume the module to clone is valid
and crash otherwise.

Ideally, no reduction pass would create invalid IR, but some currently
do. ReduceInstructions can be fixed relatively easily (D86210), but
others are harder. For example, ReduceBasicBlocks may remove result in
invalid PHI nodes.

For now, skip the chunks. If we get to the point where all reduction
passes result in valid IR, we may want to turn this into an assertion.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D86212
The file was modifiedllvm/tools/llvm-reduce/deltas/Delta.cpp
The file was modifiedllvm/test/Reduce/remove-function-bodies-used-in-globals.ll
Commit c78d2766fd2c253f149a7b25498273d7f934873c by grimar
[unittests/Object] - Add testing for missing ELF formats.

This adds all missing format values that are defined in
ELFObjectFile<ELFT>::getFileFormatName().

Differential revision: https://reviews.llvm.org/D86625
The file was modifiedllvm/unittests/Object/ELFObjectFileTest.cpp
Commit 4cd14256b23a19f4e7cf96628dda6cd6cec01be7 by grimar
[llvm-readobj][test] - Test "Format" values.

This adds testing for the "Format" field printed with `--file-headers`.

llvm-readelf doesn't use them, so only llvm-readobj needs to be tested.

All possible values are defined and tested in `ELFObjectFile<ELFT>::getFileFormatName()`.
Here we test just a few arbitrary ones.

Differential revision: https://reviews.llvm.org/D86350
The file was addedllvm/test/tools/llvm-readobj/ELF/file-header-format.test
Commit 3fe01f0e215b7a41481806698efa087be6fe8897 by grimar
[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
The file was modifiedllvm/tools/llvm-readobj/COFFDumper.cpp
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
The file was modifiedllvm/tools/llvm-readobj/ObjDumper.h
The file was modifiedllvm/tools/llvm-readobj/XCOFFDumper.cpp
The file was modifiedllvm/tools/llvm-readobj/llvm-readobj.cpp
The file was modifiedllvm/tools/llvm-readobj/MachODumper.cpp
The file was modifiedllvm/tools/llvm-readobj/WasmDumper.cpp