Lines Matching full:numelements
504 llvm::Value *&numElements,
523 // We multiply the size of all dimensions for NumElements.
524 // e.g for 'int[2][3]', ElemType is 'int' and NumElements is 6.
525 numElements = CGF.EmitScalarExpr(e->getArraySize());
526 assert(isa<llvm::IntegerType>(numElements->getType()));
537 = cast<llvm::IntegerType>(numElements->getType());
558 dyn_cast<llvm::ConstantInt>(numElements)) {
567 // We want to do all this arithmetic in size_t. If numElements is
582 // Scale numElements by that. This might overflow, but we don't
585 numElements = llvm::ConstantInt::get(CGF.SizeTy,
614 // 1) if isSigned, we need to check whether numElements is negative;
616 // numElements is larger than something representable in size_t;
617 // 3) if minElements > 0, we need to check whether numElements is smaller
620 // sizeWithoutCookie := numElements * typeSizeMultiplier
638 hasOverflow = CGF.Builder.CreateICmpUGE(numElements, thresholdV);
639 numElements = CGF.Builder.CreateTrunc(numElements, CGF.SizeTy);
644 numElements = CGF.Builder.CreateSExt(numElements, CGF.SizeTy);
652 hasOverflow = CGF.Builder.CreateICmpSLT(numElements,
657 numElements = CGF.Builder.CreateZExt(numElements, CGF.SizeTy);
660 assert(numElements->getType() == CGF.SizeTy);
665 hasOverflow = CGF.Builder.CreateICmpULT(numElements,
672 CGF.Builder.CreateICmpULT(numElements,
677 size = numElements;
682 // This step also causes numElements to be scaled up by the
703 // Also scale up numElements by the array size multiplier.
709 numElements = size;
715 numElements = CGF.Builder.CreateMul(numElements, asmV);
719 // numElements doesn't need to be scaled.
789 llvm::Value *BeginPtr, llvm::Value *NumElements,
899 llvm::ConstantInt *ConstNum = dyn_cast<llvm::ConstantInt>(NumElements);
931 NumElements = Builder.CreateSub(
932 NumElements,
933 llvm::ConstantInt::get(NumElements->getType(), InitListElements));
934 EmitCXXAggrConstructorCall(Ctor, NumElements, CurPtr, CCE,
968 Builder.CreateInBoundsGEP(BeginPtr, NumElements, "array.end");
1022 llvm::Value *NewPtr, llvm::Value *NumElements,
1026 CGF.EmitNewArrayInitializer(E, ElementType, ElementTy, NewPtr, NumElements,
1259 llvm::Value *numElements = nullptr;
1262 EmitCXXNewAllocSize(*this, E, minElements, numElements,
1330 numElements,
1338 EmitNewInitializer(*this, E, allocType, elementTy, result, numElements,
1494 llvm::Value *NumElements;
1500 llvm::Value *NumElements,
1503 : Ptr(Ptr), OperatorDelete(OperatorDelete), NumElements(NumElements),
1531 Size = CGF.Builder.CreateMul(Size, NumElements);
1554 llvm::Value *numElements = nullptr;
1558 numElements, allocatedPtr, cookieSize);
1566 numElements, elementType,
1571 assert(numElements && "no element count for a type with a destructor!");
1574 CGF.Builder.CreateInBoundsGEP(deletedPtr, numElements, "delete.end");