diff options
Diffstat (limited to 'llvm/lib/Analysis/MemoryBuiltins.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemoryBuiltins.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp index 68e997656d84..4f2b5b34304d 100644 --- a/llvm/lib/Analysis/MemoryBuiltins.cpp +++ b/llvm/lib/Analysis/MemoryBuiltins.cpp @@ -111,7 +111,7 @@ static const std::pair<LibFunc, AllocFnsTy> AllocationFnData[] = { {LibFunc_reallocf, {ReallocLike, 2, 1, -1}}, {LibFunc_strdup, {StrDupLike, 1, -1, -1}}, {LibFunc_strndup, {StrDupLike, 2, 1, -1}}, - {LibFunc___kmpc_alloc_shared, {MallocLike, 1, 0, -1}} + {LibFunc___kmpc_alloc_shared, {MallocLike, 1, 0, -1}}, // TODO: Handle "int posix_memalign(void **, size_t, size_t)" }; @@ -135,9 +135,8 @@ static const Function *getCalledFunction(const Value *V, bool LookThroughBitCast return nullptr; } -/// Returns the allocation data for the given value if it's either a call to a -/// known allocation function, or a call to a function with the allocsize -/// attribute. +/// Returns the allocation data for the given value if it's a call to a known +/// allocation function. static Optional<AllocFnsTy> getAllocationDataForFunction(const Function *Callee, AllocType AllocTy, const TargetLibraryInfo *TLI) { @@ -610,7 +609,7 @@ ObjectSizeOffsetVisitor::ObjectSizeOffsetVisitor(const DataLayout &DL, SizeOffsetType ObjectSizeOffsetVisitor::compute(Value *V) { IntTyBits = DL.getIndexTypeSizeInBits(V->getType()); - Zero = APInt::getNullValue(IntTyBits); + Zero = APInt::getZero(IntTyBits); V = V->stripPointerCasts(); if (Instruction *I = dyn_cast<Instruction>(V)) { |