aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/HLSLExternalSemaSource.cpp
diff options
context:
space:
mode:
authorHelena Kotas <hekotas@microsoft.com>2025-04-29 18:42:22 -0700
committerGitHub <noreply@github.com>2025-04-29 18:42:22 -0700
commitf1750300aad0e49383cd4b206e2354f1300a40a8 (patch)
treee6443b8ca2289d7bada44ad1804823c95e672303 /clang/lib/Sema/HLSLExternalSemaSource.cpp
parent6bb4ce0f6ff462b58bacc8dbc47719b7009f9b18 (diff)
downloadllvm-f1750300aad0e49383cd4b206e2354f1300a40a8.zip
llvm-f1750300aad0e49383cd4b206e2354f1300a40a8.tar.gz
llvm-f1750300aad0e49383cd4b206e2354f1300a40a8.tar.bz2
[HLSL] Resource initialization by constructors (#135120)
- Adds resource constructor that takes explicit binding for all resource classes. - Updates implementation of default resource constructor to initialize resource handle to `poison`. - Removes initialization of resource classes from Codegen. - Initialization of `cbuffer` still needs to happen in `CGHLSLRuntime` because it does not have a corresponding resource class type. - Adds `ImplicitCastExpr` for builtin function calls. Sema adds these automatically when a method of a template class is instantiated, but some resource classes like `ByteAddressBuffer` are not templates so they need to have this added explicitly. Design proposal: llvm/wg-hlsl#197 Closes #134154
Diffstat (limited to 'clang/lib/Sema/HLSLExternalSemaSource.cpp')
-rw-r--r--clang/lib/Sema/HLSLExternalSemaSource.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/HLSLExternalSemaSource.cpp b/clang/lib/Sema/HLSLExternalSemaSource.cpp
index f5477ac..f09232a 100644
--- a/clang/lib/Sema/HLSLExternalSemaSource.cpp
+++ b/clang/lib/Sema/HLSLExternalSemaSource.cpp
@@ -131,7 +131,8 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S,
bool RawBuffer) {
return BuiltinTypeDeclBuilder(S, Decl)
.addHandleMember(RC, IsROV, RawBuffer)
- .addDefaultHandleConstructor();
+ .addDefaultHandleConstructor()
+ .addHandleConstructorFromBinding();
}
// This function is responsible for constructing the constraint expression for