[llvm] [llvm-objdump][AVR] Detect AVR architecture from ELF flags for disassembling (PR #174731)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 27 01:19:45 PST 2026
================
@@ -41,5 +42,5 @@ std::string AVR::getFeatureSetForEFlag(unsigned EFlag) {
if (It != EFlagToFeatureSet.end())
return It->second.str();
- return "avr0";
+ return make_error<StringError>("Not valid e_flags", errc::invalid_argument);
----------------
jh7370 wrote:
I believe you probably just want `createStringError`, in common with other areas of code. Also, please refer to the LLVM coding standards for warnings and error messages. In particular:
- messages should not start with a capital letter
- please include additional relevant context, in this case the masked value that is being detected.
The message also could do with being clearer, I think. I suggest "unrecognised AVR version" would be better.
https://github.com/llvm/llvm-project/pull/174731
More information about the llvm-commits
mailing list