[llvm/dwarfdump] Use the architecture string to filter.
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 10 Dec 2019 01:14:10 +0000 (17:14 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 10 Dec 2019 01:17:01 +0000 (17:17 -0800)
commitd9466653e4ddbde5e787ac8cdbe67c1f356a5f69
tree6edfed531500581d1e9a9e453ebab3a0ab2179ed
parentbc69dd2cfae37a335b9a0125e161c54548a9d2a5
[llvm/dwarfdump] Use the architecture string to filter.

Currently dwarfdump uses the ArchType to filter out architectures, which
is problematic for architectures like arm64e and x86_64h that map back
to arm64 and x86_64 respectively. The result is that the filter doesn't
work for these architectures because it matches all the variants. This
is especially bad because usually these architectures are the reason to
use the filter in the first place.

Instead, we should match the architecture based on the string name. This
means the filter works for the values printed by dwarfdump. It has the
unfortunate side effect of not working for aliases, like AArch64, but I
think that's worth the trade-off.

rdar://53653014

Differential revision: https://reviews.llvm.org/D71230
llvm/test/tools/llvm-dwarfdump/AArch64/arch.ll
llvm/test/tools/llvm-dwarfdump/filter.test [new file with mode: 0644]
llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp