Issue 120636
Summary [HLSL] Fix global resource initialization
Labels HLSL
Assignees
Reporter llvm-beanz
    Currently we connect global resource initialization in `GenerateCXXGlobalInitFunc` (https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGDeclCXX.cpp#L1087), but this is really not the right place. This function can be called multiple times throughout compilation to generate different initializer functions.

Clang has a mechanism for collecting global initializer functions and including them in the final module initializer, we should instead use that mechanism by adding our initializer to CodeGenModule's CXXGlobalInits list.

We could either generate an initializer function per-resource (which I think is preferred), or we could generate a single initializer late, but either way we should not have a hook in the place it is today.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to