Lines Matching refs:NumElements
555 llvm::Value *&numElements,
574 // We multiply the size of all dimensions for NumElements.
575 // e.g for 'int[2][3]', ElemType is 'int' and NumElements is 6.
576 numElements = CGF.EmitScalarExpr(e->getArraySize());
577 assert(isa<llvm::IntegerType>(numElements->getType()));
588 = cast<llvm::IntegerType>(numElements->getType());
609 dyn_cast<llvm::ConstantInt>(numElements)) {
618 // We want to do all this arithmetic in size_t. If numElements is
633 // Scale numElements by that. This might overflow, but we don't
636 numElements = llvm::ConstantInt::get(CGF.SizeTy,
665 // 1) if isSigned, we need to check whether numElements is negative;
667 // numElements is larger than something representable in size_t;
668 // 3) if minElements > 0, we need to check whether numElements is smaller
671 // sizeWithoutCookie := numElements * typeSizeMultiplier
689 hasOverflow = CGF.Builder.CreateICmpUGE(numElements, thresholdV);
690 numElements = CGF.Builder.CreateTrunc(numElements, CGF.SizeTy);
695 numElements = CGF.Builder.CreateSExt(numElements, CGF.SizeTy);
703 hasOverflow = CGF.Builder.CreateICmpSLT(numElements,
708 numElements = CGF.Builder.CreateZExt(numElements, CGF.SizeTy);
711 assert(numElements->getType() == CGF.SizeTy);
716 hasOverflow = CGF.Builder.CreateICmpULT(numElements,
723 CGF.Builder.CreateICmpULT(numElements,
728 size = numElements;
733 // This step also causes numElements to be scaled up by the
754 // Also scale up numElements by the array size multiplier.
760 numElements = size;
766 numElements = CGF.Builder.CreateMul(numElements, asmV);
770 // numElements doesn't need to be scaled.
843 llvm::Value *numElements) {
850 Builder.CreateInBoundsGEP(beginPtr, numElements, "array.end");
894 if (llvm::ConstantInt *constNum = dyn_cast<llvm::ConstantInt>(numElements)) {
964 llvm::Value *NumElements,
984 CGF.EmitCXXAggrConstructorCall(Ctor, NumElements, NewPtr,
995 CGF.EmitNewArrayInitializer(E, ElementType, NewPtr, NumElements);
1214 llvm::Value *numElements = 0;
1217 EmitCXXNewAllocSize(*this, E, minElements, numElements,
1310 numElements,
1318 EmitNewInitializer(*this, E, allocType, result, numElements,
1487 llvm::Value *NumElements;
1493 llvm::Value *NumElements,
1496 : Ptr(Ptr), OperatorDelete(OperatorDelete), NumElements(NumElements),
1524 Size = CGF.Builder.CreateMul(Size, NumElements);
1547 llvm::Value *numElements = 0;
1551 numElements, allocatedPtr, cookieSize);
1559 numElements, elementType,
1564 assert(numElements && "no element count for a type with a destructor!");
1567 CGF.Builder.CreateInBoundsGEP(deletedPtr, numElements, "delete.end");