The patch prevents pollution of instruction comments with error messages
generated during unsuccessful decoding attempts.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Note that with the change in place no comments passed to AMDGPUDisassembler::errOperand() may ever be visible to the user, because that function returns a default-constructed MCOperand, which is considered invalid by addOperand() defined in AMDGPUDisassembler.cpp and so instructions having such operands will always be seen as failed decoding attempts. To expose the error messages we would need to support erroneous operands as the comment in AMDGPUDisassembler::errOperand() proposes or find another way.
Do we have any tests that errors like "Error: cannot read literal..." are still emitted when they actually cause the disassembly to fail?
llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp | ||
---|---|---|
415–416 | Is this still required? |
llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp | ||
---|---|---|
415–416 | Removed, thanks. |
Shouldn't error messages not get written to the comment stream in the first place? It seems like you're just trying to avoid getting them in the final output
I guess this OK as it fixes a bug, but I'd be happier if we had a plan for what to do with these error messages.
Shouldn't error messages not get written to the comment stream in the first place? It seems like you're just trying to avoid getting them in the final output
I think we want error messages if decoding fails, but not from a failed attempt that was followed by a successful attempt.
Is this still required?