Lines Matching refs:Size
48 // First and Second size parameters (or -1 if unused)
218 // The size of the malloc's result type must be known to determine array size.
281 /// getMallocArraySize - Returns the array size of a malloc call. If the
282 /// argument passed to malloc is a multiple of the size of the malloced type,
284 /// constant 1. Otherwise, return NULL for mallocs whose array size cannot be
360 // Utility functions to compute size of objects.
364 /// \brief Compute the size of the object pointed by Ptr. Returns true and the
365 /// object size in Size if successful, and false otherwise.
366 /// If RoundToAlign is true, then Size is rounded up to the aligment of allocas,
368 bool llvm::getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout &DL,
378 Size = 0;
380 Size = (ObjSize - Offset).getZExtValue();
386 "Number of arguments with unsolved size and offset");
388 "Number of load instructions with unsolved size and offset");
391 APInt ObjectSizeOffsetVisitor::align(APInt Size, uint64_t Align) {
393 return APInt(IntTyBits, RoundUpToAlignment(Size.getZExtValue(), Align));
394 return Size;
402 // Pointer size must be rechecked for each object visited since it could have
447 APInt Size(IntTyBits, DL.getTypeAllocSize(I.getAllocatedType()));
449 return std::make_pair(align(Size, I.getAlignment()), Zero);
453 Size *= C->getValue().zextOrSelf(IntTyBits);
454 return std::make_pair(align(Size, I.getAlignment()), Zero);
466 APInt Size(IntTyBits, DL.getTypeAllocSize(PT->getElementType()));
467 return std::make_pair(align(Size, A.getParamAlignment()), Zero);
478 APInt Size(IntTyBits, GetStringLength(CS.getArgument(0)));
479 if (!Size)
489 if (Size.ugt(MaxSize))
490 Size = MaxSize + 1;
492 return std::make_pair(Size, Zero);
499 APInt Size = Arg->getValue().zextOrSelf(IntTyBits);
500 // size determined by just 1 parameter
502 return std::make_pair(Size, Zero);
508 Size *= Arg->getValue().zextOrSelf(IntTyBits);
509 return std::make_pair(Size, Zero);
555 APInt Size(IntTyBits, DL.getTypeAllocSize(GV.getType()->getElementType()));
556 return std::make_pair(align(Size, GV.getAlignment()), Zero);
643 // now compute the size and offset
680 Value *Size = ConstantInt::get(ArraySize->getType(),
682 Size = Builder.CreateMul(Size, ArraySize);
683 return std::make_pair(Size, Zero);
705 Value *Size = Builder.CreateMul(FirstArg, SecondArg);
706 return std::make_pair(Size, Zero);
748 // create 2 PHIs: one for size and another for offset
755 // compute offset/size for each PHI incoming pointer
771 Value *Size = SizePHI, *Offset = OffsetPHI, *Tmp;
773 Size = Tmp;
774 SizePHI->replaceAllUsesWith(Size);
782 return std::make_pair(Size, Offset);
794 Value *Size = Builder.CreateSelect(I.getCondition(), TrueSide.first,
798 return std::make_pair(Size, Offset);