This change is a big blob of code that isn't easy to break up. It
either comes in all together as a blob, works and has tests, or it
doesn't do anything.
Logically you can think of this patch as three things:
(1) Adding virtual interfaces so the bitcode writer can be overridden
(2) Adding a new bitcode writer implementation for DXIL
(3) Adding some (optional) crazy CMake goop to build the
DirectXShaderCompiler's llvm-dis as dxil-dis for testing
Is dxil-dis only a testing tool, or is it shipped in a distribution too?
If it’s only for tests then I think this is fine. If it’s shipped, then I wonder if the cmake variable should drop “TESTS”. Up to you though.