[DXIL] [NFC] Remove dead attribute code paths
authorChris Bieneman <cbieneman@microsoft.com>
Wed, 27 Apr 2022 15:43:31 +0000 (10:43 -0500)
committerChris Bieneman <cbieneman@microsoft.com>
Wed, 27 Apr 2022 15:46:59 +0000 (10:46 -0500)
commit05b765ff69959d546765a001b6e5058cbbea2399
tree1a742ea909a181e3ea581fc63e4bea68b9721e09
parentaed44d282249e1d61245d61194f6a8ce3c6f4bb7
[DXIL] [NFC] Remove dead attribute code paths

DXIL doesn't support attributes added after LLVM 3.7. The DXILPrepare
pass removes those attributes so they should never be present by the
time we reach the DXIL bitcode writer.

In the event that we somehow try to write a newer attribute in the DXIL
writer, we should fail hard (crash), because the output would be
invalid. This case should only be possible if the DXIL writer were
called without DXILPrepare being run first, which shouldn't be possible.

This patch also adds a default case to the switch statement over the
attribute list which covers all the removed cases and any new attribute
kinds that may be added in the future. The default case is handled like
other unsupported cases by a call to llvm_unreachable.
llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp