From 719f0d92538c917306004e541f38c79717d0c07d Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 22 Jan 2025 12:39:35 -0800 Subject: [HLSL] Fix global resource initialization (#123394) Create separate resource initialization function for each resource and add them to CodeGenModule's `CXXGlobalInits` list. Fixes #120636 and addresses this [comment ](https://github.com/llvm/llvm-project/pull/119755/files#r1894093603). --- clang/lib/CodeGen/CodeGenModule.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.h') diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index d5ef1a7..1aa5d48 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1226,6 +1226,8 @@ public: llvm::Function *getIntrinsic(unsigned IID, ArrayRef Tys = {}); + void AddCXXGlobalInit(llvm::Function *F) { CXXGlobalInits.push_back(F); } + /// Emit code for a single top level declaration. void EmitTopLevelDecl(Decl *D); -- cgit v1.1