function_ref<const TargetLibraryInfo &(Function &)> GetTLI);
/// Tests if a value is a call or invoke to a library function that
+/// allocates uninitialized memory (such as malloc).
+bool isMallocLikeFn(const Value *V, const TargetLibraryInfo *TLI);
+bool isMallocLikeFn(const Value *V,
+ function_ref<const TargetLibraryInfo &(Function &)> GetTLI);
+
+/// 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);
/// Tests if a value is a call or invoke to a library function that
/// allocates uninitialized memory (such as malloc).
-static bool isMallocLikeFn(const Value *V, const TargetLibraryInfo *TLI) {
+bool llvm::isMallocLikeFn(const Value *V, const TargetLibraryInfo *TLI) {
return getAllocationData(V, MallocOrOpNewLike, TLI).hasValue();
}
+bool llvm::isMallocLikeFn(
+ const Value *V, function_ref<const TargetLibraryInfo &(Function &)> GetTLI) {
+ return getAllocationData(V, MallocOrOpNewLike, GetTLI)
+ .hasValue();
+}
/// Tests if a value is a call or invoke to a library function that
/// allocates uninitialized memory with alignment (such as aligned_alloc).