[clang] [llvm] [HLSL] Add handle initialization for simple resource declarations (PR #111207)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 16 13:53:47 PDT 2024


================
@@ -1121,6 +1121,11 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn,
       if (Decls[i])
         EmitRuntimeCall(Decls[i]);
 
+    if (getLangOpts().HLSL)
+      if (llvm::Function *ResInitFn =
+              CGM.getHLSLRuntime().createResourceBindingInitFn())
----------------
hekota wrote:

Yeah, I had `createResourceBindingInitFnIfNeeded` and did not like it. The `maybe*` variant is better, but I think I'll just leave this as is now.

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


More information about the cfe-commits mailing list