@@ -512,28 +512,28 @@ static Value *createHandle(CGBuilderTy &Builder, CodeGenModule &CGM,
512512 return CreateHandle;
513513}
514514
515- static void CreateAndStoreHandle (GlobalVariable *GV, unsigned int Slot,
516- unsigned int Space, uint32_t structIdx ,
515+ static void createAndStoreHandle (GlobalVariable *GV, unsigned int Slot,
516+ unsigned int Space, uint32_t StructIdx ,
517517 CodeGenModule &CGM, CGBuilderTy &Builder) {
518518 llvm::Type *HandleTy = GV->getValueType ();
519- assert ((!HandleTy->isTargetExtTy () || structIdx == 0 ) &&
519+ assert ((!HandleTy->isTargetExtTy () || StructIdx == 0 ) &&
520520 " No struct to index into." );
521521 assert ((HandleTy->isTargetExtTy () || HandleTy->isStructTy ()) &&
522522 " Unexpected type." );
523523 assert ((HandleTy->isTargetExtTy () ||
524- HandleTy->getStructElementType (structIdx )->isTargetExtTy ()) &&
524+ HandleTy->getStructElementType (StructIdx )->isTargetExtTy ()) &&
525525 " Can not access handle." );
526526
527527 if (!HandleTy->isTargetExtTy ())
528- HandleTy = HandleTy->getStructElementType (structIdx );
528+ HandleTy = HandleTy->getStructElementType (StructIdx );
529529
530530 // FIXME: resource arrays are not yet implemented. Using size 1.
531531 // FIXME: NonUniformResourceIndex bit is not yet implemented. Using false;
532532 const DataLayout &DL = CGM.getModule ().getDataLayout ();
533533 Value *CreateHandle =
534534 createHandle (Builder, CGM, HandleTy, Space, Slot, 1 , 0 , false );
535535 CreateHandle->setName (Twine (GV->getName ()).concat (" _h" ));
536- Value *HandleRef = Builder.CreateStructGEP (GV->getValueType (), GV, structIdx );
536+ Value *HandleRef = Builder.CreateStructGEP (GV->getValueType (), GV, StructIdx );
537537 Builder.CreateAlignedStore (CreateHandle, HandleRef,
538538 HandleRef->getPointerAlignment (DL));
539539}
@@ -552,13 +552,13 @@ static void createResourceInitFn(CodeGenModule &CGM, llvm::GlobalVariable *GV,
552552 CGBuilderTy Builder (CGM, Ctx);
553553 Builder.SetInsertPoint (EntryBB);
554554
555- CreateAndStoreHandle (GV, Slot, Space, 0 , CGM, Builder);
555+ createAndStoreHandle (GV, Slot, Space, 0 , CGM, Builder);
556556 StructType *ST = dyn_cast<StructType>(GV->getValueType ());
557557 if (ST && ST->getNumElements () > 1 ) {
558558 // TODO(124561): This needs to be updated to get the correct slot for
559559 // SPIR-V. Using a placeholder value for now.
560560 uint32_t CounterSlot = (CGM.getTriple ().isSPIRV () ? Slot + 1 : Slot);
561- CreateAndStoreHandle (GV, CounterSlot, Space, 1 , CGM, Builder);
561+ createAndStoreHandle (GV, CounterSlot, Space, 1 , CGM, Builder);
562562 }
563563
564564 Builder.CreateRetVoid ();
0 commit comments