[llvm] [AMDGPU] Add disassembler diagnostics for invalid kernel descriptors (PR #87400)
Emma Pilkington via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 9 08:42:56 PDT 2024
================
@@ -160,7 +161,7 @@ class MCDisassembler {
/// case.
virtual std::optional<DecodeStatus>
onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size, ArrayRef<uint8_t> Bytes,
- uint64_t Address, raw_ostream &CStream) const;
+ uint64_t Address, raw_ostream &ErrS) const;
----------------
epilk wrote:
Using an `Error` to represent errors seems like a nice refactor, but an Error return isn't sufficient for this function. It has three cases: a) nullopt, meaning the disassembler didn't have any handling for this symbol, b) Fail, meaning an error was encountered, and c) Success. b & c both indicate to objdump that some bytes were consumed, so `Size` must be set. In the update I changed the return type to bool, where true means the target disassembler had some handling for this symbol, with an Error out param to indicate whether it contained errors.
https://github.com/llvm/llvm-project/pull/87400
More information about the llvm-commits
mailing list