[clang] [llvm] [HLSL] Add handle initialization for simple resource declarations (PR #111207)
Damyan Pepper via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 14 14:42:18 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:
Originally I asked: "What does it mean if `createResourceBindingInitFn` returns nullptr?" I asked this because I assumed that this function returning nullptr would indicate an error. I think it actually returns null if no function is needed? Wonder if this could be reflected in the name? Or maybe this is a common convention in this codebase?
https://github.com/llvm/llvm-project/pull/111207
More information about the cfe-commits
mailing list