================
@@ -190,6 +192,71 @@ static void createResourceCtorArgs(CodeGenModule &CGM, 
CXXConstructorDecl *CD,
   Args.add(RValue::get(NameStr), AST.getPointerType(AST.CharTy.withConst()));
 }
 
+// Initializes local resource array variable. For multi-dimensional arrays it
+// calls itself recursively to initialize its sub-arrays. The Index used in the
+// resource constructor calls will begin at StartIndex and will be incremented
+// for each array element. The last used resource Index is returned to the
+// caller.
+static Value *initializeLocalResourceArray(
+    CodeGenFunction &CGF, AggValueSlot &ValueSlot,
+    const ConstantArrayType *ArrayTy, CXXConstructorDecl *CD,
+    llvm::Value *Range, llvm::Value *StartIndex, StringRef ResourceName,
+    HLSLResourceBindingAttr *RBA, HLSLVkBindingAttr *VkBinding,
+    ArrayRef<llvm::Value *> PrevGEPIndices, SourceLocation ArraySubsExprLoc) {
+
+  llvm::IntegerType *IntTy = CGF.CGM.IntTy;
+  llvm::Value *Index = StartIndex;
+  llvm::Value *One = llvm::ConstantInt::get(IntTy, 1);
+  uint64_t ArraySize = ArrayTy->getSExtSize();
----------------
alsepkow wrote:

nit: const

https://github.com/llvm/llvm-project/pull/154248
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to