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

Damyan Pepper via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 16 09:22:33 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())
----------------
damyanp wrote:

Seems reasonable.  I think I was too ashamed of my suggestions to add them originally, but they were along the lines of `maybeCreateResourceBindingInitFn` or `createResourceBindingInitFnIfNeeded`.


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


More information about the cfe-commits mailing list