mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
644ccd71c4
Currently, we have a code duplication in llvm-readobj which was introduced in D63266. The duplication was introduced to allow llvm-readobj to dump the partially broken object. Methods in ELFFile<ELFT> perform a strict validation of the inputs, what is itself good, but not for dumper tools, that might want to dump the information, even if some pieces are broken/unexpected. This patch introduces a warning handler which can be passed to ELFFile<ELFT> methods and can allow skipping the non-critical errors when needed/possible. For demonstration, I removed the duplication from llvm-readobj and implemented a warning using the new custom warning handler. It also deduplicates the strings printed, making the output less verbose. Differential revision: https://reviews.llvm.org/D65515 llvm-svn: 368260