diff --git a/llvm/include/llvm/Analysis/MemoryBuiltins.h b/llvm/include/llvm/Analysis/MemoryBuiltins.h index 361a03325ac032..858a3eddca3870 100644 --- a/llvm/include/llvm/Analysis/MemoryBuiltins.h +++ b/llvm/include/llvm/Analysis/MemoryBuiltins.h @@ -62,14 +62,6 @@ bool isMallocLikeFn(const Value *V, const TargetLibraryInfo *TLI); bool isMallocLikeFn(const Value *V, function_ref GetTLI); -/// Tests if a value is a call or invoke to a library function that -/// allocates uninitialized memory with alignment (such as aligned_alloc). -bool isAlignedAllocLikeFn(const Value *V, const TargetLibraryInfo *TLI); - -/// Tests if a value is a call or invoke to a library function that -/// allocates zero-filled memory (such as calloc). -bool isCallocLikeFn(const Value *V, const TargetLibraryInfo *TLI); - /// Tests if a value is a call or invoke to a library function that /// allocates memory similar to malloc or calloc. bool isMallocOrCallocLikeFn(const Value *V, const TargetLibraryInfo *TLI); diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp index 560941bdc31bbe..af8cb78b9a5677 100644 --- a/llvm/lib/Analysis/MemoryBuiltins.cpp +++ b/llvm/lib/Analysis/MemoryBuiltins.cpp @@ -247,14 +247,14 @@ bool llvm::isMallocLikeFn( /// Tests if a value is a call or invoke to a library function that /// allocates uninitialized memory with alignment (such as aligned_alloc). -bool llvm::isAlignedAllocLikeFn(const Value *V, const TargetLibraryInfo *TLI) { +static bool isAlignedAllocLikeFn(const Value *V, const TargetLibraryInfo *TLI) { return getAllocationData(V, AlignedAllocLike, TLI) .hasValue(); } /// Tests if a value is a call or invoke to a library function that /// allocates zero-filled memory (such as calloc). -bool llvm::isCallocLikeFn(const Value *V, const TargetLibraryInfo *TLI) { +static bool isCallocLikeFn(const Value *V, const TargetLibraryInfo *TLI) { return getAllocationData(V, CallocLike, TLI).hasValue(); } diff --git a/llvm/unittests/Analysis/MemoryBuiltinsTest.cpp b/llvm/unittests/Analysis/MemoryBuiltinsTest.cpp index 05f1a586f50469..9c8e391302afe8 100644 --- a/llvm/unittests/Analysis/MemoryBuiltinsTest.cpp +++ b/llvm/unittests/Analysis/MemoryBuiltinsTest.cpp @@ -37,7 +37,6 @@ TEST(AllocSize, AllocationBuiltinsTest) { const TargetLibraryInfo *TLI = nullptr; EXPECT_FALSE(isMallocLikeFn(Caller.get(), TLI)); - EXPECT_FALSE(isCallocLikeFn(Caller.get(), TLI)); EXPECT_FALSE(isAllocLikeFn(Caller.get(), TLI)); // FIXME: We might be able to treat allocsize functions as general allocation