================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits