]> granicus.if.org Git - llvm/commit
[ELF] Fix GCC8 warnings about "fall through", NFCI
authorJonas Hahnfeld <hahnjo@hahnjo.de>
Wed, 13 Mar 2019 10:38:17 +0000 (10:38 +0000)
committerJonas Hahnfeld <hahnjo@hahnjo.de>
Wed, 13 Mar 2019 10:38:17 +0000 (10:38 +0000)
commitffd66b23e66b8e9c095832327e7fd1b4d976fd73
tree3531a19a63d3335359b5c4241e5502d5ad3a253e
parentd3c675630f10804d6272ef37c49174a239c29fbd
[ELF] Fix GCC8 warnings about "fall through", NFCI

Add break statements in Object/ELF.cpp since the code should consider the
generic tags for Hexagon, MIPS, and PPC. Add a test (copied from llvm-readobj)
to show that this works correctly (earlier versions of this patch would have
asserted).

The warnings in X86ELFObjectWriter.cpp are actually false-positives since
the nested switch() handles all possible values and returns in all cases.
Make this explicit by adding llvm_unreachable's.

Differential Revision: https://reviews.llvm.org/D58837

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356037 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Object/ELF.cpp
lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
test/tools/llvm-objdump/elf-dynamic-section-machine-specific.test [new file with mode: 0644]
test/tools/llvm-readobj/Inputs/elf-dynamic-tags-machine-specific.yaml [new file with mode: 0644]
test/tools/llvm-readobj/elf-dynamic-tags-machine-specific.test