[llvm-branch-commits] [clang] [HLSL] Use static create methods to initialize resources in arrays (PR #157005)
Chris B via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Sep 15 12:09:49 PDT 2025
================
@@ -961,27 +952,27 @@ std::optional<LValue> CGHLSLRuntime::emitResourceArraySubscriptExpr(
// If the result of the subscript operation is a single resource, call the
// constructor.
if (ResultTy == ResourceTy) {
- QualType ThisType = CD->getThisType()->getPointeeType();
- llvm::Value *ThisPtr = CGF.getAsNaturalPointerTo(TmpVarAddress, ThisType);
-
- // Assemble the constructor parameters.
CallArgList Args;
- createResourceCtorArgs(CGM, CD, ThisPtr, Range, Index, ArrayDecl->getName(),
- RBA, VkBinding, Args);
- // Call the constructor.
- CGF.EmitCXXConstructorCall(CD, Ctor_Complete, false, false, TmpVarAddress,
- Args, ValueSlot.mayOverlap(),
- ArraySubsExpr->getExprLoc(),
- ValueSlot.isSanitizerChecked());
+ CXXMethodDecl *CreateMethod = lookupResourceInitMethodAndSetupArgs(
+ CGF.CGM, ResourceTy->getAsCXXRecordDecl(), Range, Index,
+ ArrayDecl->getName(), RBA, VkBinding, Args);
+
+ if (!CreateMethod)
+ return std::nullopt;
----------------
llvm-beanz wrote:
Same as above, what happens if this happens?
https://github.com/llvm/llvm-project/pull/157005
More information about the llvm-branch-commits
mailing list