[llvm] [DirectX] Use an allow-list of DXIL compatible module metadata (PR #165290)

Finn Plummer via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 29 12:11:02 PDT 2025


================
@@ -364,6 +364,16 @@ static void cleanModuleFlags(Module &M) {
     M.addModuleFlag(Flag.Behavior, Flag.Key->getString(), Flag.Val);
 }
 
+using GlobalMDList = std::array<StringLiteral, 7>;
+
+// The following are compatible with DXIL but not emit with clang, they can
+// be added when applicable:
+// dx.typeAnnotations, dx.viewIDState, dx.dxrPayloadAnnotations
+static GlobalMDList CompatibleNamedModuleMDs = {
+    "llvm.ident",     "llvm.module.flags", "dx.resources",   "dx.valver",
+    "dx.shaderModel", "dx.version",        "dx.entryPoints",
+};
----------------
inbelic wrote:

I agree, unfortunately clang-format does not :(

https://github.com/llvm/llvm-project/pull/165290


More information about the llvm-commits mailing list