diff options
author | Helena Kotas <hekotas@microsoft.com> | 2025-02-20 17:27:53 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-20 17:27:53 -0800 |
commit | 776cddacb1ab8fd92bcb3aa42f9c0b348d8aa2ba (patch) | |
tree | 48c9953fed0269349e213deefa1171de7af3d292 /clang/lib/CodeGen/CGHLSLRuntime.cpp | |
parent | 9fa77c18548a4878cf53a5195f69d15a2d1d567f (diff) | |
download | llvm-776cddacb1ab8fd92bcb3aa42f9c0b348d8aa2ba.zip llvm-776cddacb1ab8fd92bcb3aa42f9c0b348d8aa2ba.tar.gz llvm-776cddacb1ab8fd92bcb3aa42f9c0b348d8aa2ba.tar.bz2 |
[HLSL] Implement default constant buffer `$Globals` (#125807)
All variable declarations in the global scope that are not resources,
static or empty are implicitly added to implicit constant buffer
`$Globals`. They are created in `hlsl_constant` address space and
collected in an implicit `HLSLBufferDecl` node that is added to the AST
at the end of the translation unit. Codegen is the same as for explicit
constant buffers.
Fixes #123801
Diffstat (limited to 'clang/lib/CodeGen/CGHLSLRuntime.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGHLSLRuntime.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp b/clang/lib/CodeGen/CGHLSLRuntime.cpp index 547220f..ed6d203 100644 --- a/clang/lib/CodeGen/CGHLSLRuntime.cpp +++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp @@ -116,7 +116,7 @@ void CGHLSLRuntime::emitBufferGlobalsAndMetadata(const HLSLBufferDecl *BufDecl, BufGlobals.push_back(ValueAsMetadata::get(BufGV)); const auto *ElemIt = LayoutStruct->element_begin(); - for (Decl *D : BufDecl->decls()) { + for (Decl *D : BufDecl->buffer_decls()) { if (isa<CXXRecordDecl, EmptyDecl>(D)) // Nothing to do for this declaration. continue; |