diff options
author | Helena Kotas <hekotas@microsoft.com> | 2025-01-22 12:39:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-22 12:39:35 -0800 |
commit | 719f0d92538c917306004e541f38c79717d0c07d (patch) | |
tree | 34dfff932794e2207d2cd93fc6f5e8cd052e9374 /clang/lib/CodeGen/CodeGenModule.h | |
parent | 7e622b61320543b3706711609f1f32fd9ea3788d (diff) | |
download | llvm-719f0d92538c917306004e541f38c79717d0c07d.zip llvm-719f0d92538c917306004e541f38c79717d0c07d.tar.gz llvm-719f0d92538c917306004e541f38c79717d0c07d.tar.bz2 |
[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).
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 2 |
1 files changed, 2 insertions, 0 deletions
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<llvm::Type *> Tys = {}); + void AddCXXGlobalInit(llvm::Function *F) { CXXGlobalInits.push_back(F); } + /// Emit code for a single top level declaration. void EmitTopLevelDecl(Decl *D); |