[PATCH] D74023: [RISCV] ELF attribute section for RISC-V
Hsiangkai Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 27 09:22:21 PST 2020
HsiangKai marked an inline comment as done.
HsiangKai added inline comments.
================
Comment at: llvm/lib/Object/ELFObjectFile.cpp:308
+ default:
+ llvm_unreachable("Unknown extension in Arch attribute.");
+ case 'i':
----------------
jhenderson wrote:
> jhenderson wrote:
> > HsiangKai wrote:
> > > MaskRay wrote:
> > > > The `defualt` branch is still reachable, thus it is incorrect to use llvm_unreachable.
> > > > You may want to return an Error.
> > > Encoding part only accepts `iemafdc`. Decoding part should expect these features only. Default case should be unreachable.
> > Is it unreachable if somebody provides an invalid binary (i.e. with something incorrectly encoded)? Decoding needs to handle invalid binaries without crashing on an llvm_unreachable.
> Please add a test case for an unknown letter.
I will add a test for it later.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74023/new/
https://reviews.llvm.org/D74023
More information about the llvm-commits
mailing list