A new pass DxilEmitMetadata is added to translate information saved in llvm ir into metadata to match DXIL spec.
Only generate DXIL validator version in this PR.
In llvm ir, validator version is saved in ModuleFlag with "dx.valver" as Key.
!llvm.module.flags = !{!0, !1} !1 = !{i32 6, !"dx.valver", !2} !2 = !{i32 1, i32 1}
DXIL validator version has major and minor versions that are specified as named metadata:
!dx.valver = !{!2} !2 = !{i32 1, i32 7}
File-scoped functions should be static:
https://www.llvm.org/docs/CodingStandards.html#anonymous-namespaces
Also, your function says it is converting to a 32-bit unsigned integer, but the return type is unsigned (which is usually but not guaranteed to be 32-bits), use uint32_t instead.
nit: Uint32->UInt32 (unsigned int is two words not one)