Home | History | Annotate | Download | only in Analysis

Lines Matching refs:CI

33 static bool isMallocCall(const CallInst *CI) {
34 if (!CI)
37 Function *Callee = CI->getCalledFunction();
61 const CallInst *CI = dyn_cast<CallInst>(I);
62 return (isMallocCall(CI)) ? CI : NULL;
66 CallInst *CI = dyn_cast<CallInst>(I);
67 return (isMallocCall(CI)) ? CI : NULL;
91 static Value *computeArraySize(const CallInst *CI, const TargetData *TD,
93 if (!CI)
97 Type *T = getMallocAllocatedType(CI);
107 Value *MallocArg = CI->getArgOperand(0);
120 const CallInst *CI = extractMallocCall(I);
121 Value *ArraySize = computeArraySize(CI, TD);
124 ArraySize != ConstantInt::get(CI->getArgOperand(0)->getType(), 1))
125 return CI;
127 // CI is a non-array malloc or we can't figure out that it is an array malloc.
136 PointerType *llvm::getMallocType(const CallInst *CI) {
137 assert(isMalloc(CI) && "getMallocType and not malloc call");
143 for (Value::const_use_iterator UI = CI->use_begin(), E = CI->use_end();
156 return cast<PointerType>(CI->getType());
167 Type *llvm::getMallocAllocatedType(const CallInst *CI) {
168 PointerType *PT = getMallocType(CI);
177 Value *llvm::getMallocArraySize(CallInst *CI, const TargetData *TD,
179 assert(isMalloc(CI) && "getMallocArraySize and not malloc call");
180 return computeArraySize(CI, TD, LookThroughSExt);
189 const CallInst *CI = dyn_cast<CallInst>(I);
190 if (!CI)
192 Function *Callee = CI->getCalledFunction();
212 return CI;