From f1750300aad0e49383cd4b206e2354f1300a40a8 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 29 Apr 2025 18:42:22 -0700 Subject: [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 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e917f3c..f0ce462 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -5760,9 +5760,6 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D, getCUDARuntime().handleVarRegistration(D, *GV); } - if (LangOpts.HLSL) - getHLSLRuntime().handleGlobalVarDefinition(D, GV); - GV->setInitializer(Init); if (emitter) emitter->finalize(GV); -- cgit v1.1