reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

lib/Transforms/InstCombine/InstCombineCalls.cpp
 4218   unsigned NumArgs = Call.getNumArgOperands();
 4219   ConstantInt *Op0C = dyn_cast<ConstantInt>(Call.getOperand(0));
 4221       (NumArgs == 1) ? nullptr : dyn_cast<ConstantInt>(Call.getOperand(1));
 4226   if (isMallocLikeFn(&Call, TLI) && Op0C) {
 4227     if (isOpNewLikeFn(&Call, TLI))
 4228       Call.addAttribute(AttributeList::ReturnIndex,
 4230                             Call.getContext(), Op0C->getZExtValue()));
 4232       Call.addAttribute(AttributeList::ReturnIndex,
 4234                             Call.getContext(), Op0C->getZExtValue()));
 4235   } else if (isReallocLikeFn(&Call, TLI) && Op1C) {
 4236     Call.addAttribute(AttributeList::ReturnIndex,
 4238                           Call.getContext(), Op1C->getZExtValue()));
 4239   } else if (isCallocLikeFn(&Call, TLI) && Op0C && Op1C) {
 4244       Call.addAttribute(AttributeList::ReturnIndex,
 4246                             Call.getContext(), Size.getZExtValue()));
 4247   } else if (isStrdupLikeFn(&Call, TLI)) {
 4248     uint64_t Len = GetStringLength(Call.getOperand(0));
 4252         Call.addAttribute(AttributeList::ReturnIndex,
 4254                               Call.getContext(), Len));
 4257         Call.addAttribute(
 4260                 Call.getContext(), std::min(Len, Op1C->getZExtValue() + 1)));