[llvm] 4b0fc92 - Delete unused extractCallocCall routine [NFC]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 6 18:16:54 PST 2022


Author: Philip Reames
Date: 2022-01-06T18:02:13-08:00
New Revision: 4b0fc924a93c9138868df7215267a09ee63b35eb

URL: https://github.com/llvm/llvm-project/commit/4b0fc924a93c9138868df7215267a09ee63b35eb
DIFF: https://github.com/llvm/llvm-project/commit/4b0fc924a93c9138868df7215267a09ee63b35eb.diff

LOG: Delete unused extractCallocCall routine [NFC]

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/MemoryBuiltins.h
    llvm/lib/Analysis/MemoryBuiltins.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/MemoryBuiltins.h b/llvm/include/llvm/Analysis/MemoryBuiltins.h
index 59cabf624bfb..06cc77ffee69 100644
--- a/llvm/include/llvm/Analysis/MemoryBuiltins.h
+++ b/llvm/include/llvm/Analysis/MemoryBuiltins.h
@@ -146,18 +146,6 @@ Value *getMallocArraySize(CallInst *CI, const DataLayout &DL,
                           const TargetLibraryInfo *TLI,
                           bool LookThroughSExt = false);
 
-//===----------------------------------------------------------------------===//
-//  calloc Call Utility Functions.
-//
-
-/// extractCallocCall - Returns the corresponding CallInst if the instruction
-/// is a calloc call.
-const CallInst *extractCallocCall(const Value *I, const TargetLibraryInfo *TLI);
-inline CallInst *extractCallocCall(Value *I, const TargetLibraryInfo *TLI) {
-  return const_cast<CallInst*>(extractCallocCall((const Value*)I, TLI));
-}
-
-
 //===----------------------------------------------------------------------===//
 //  free Call Utility Functions.
 //

diff  --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index 2f093a573fc9..437b7c89d5a8 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -422,13 +422,6 @@ Value *llvm::getMallocArraySize(CallInst *CI, const DataLayout &DL,
   return computeArraySize(CI, DL, TLI, LookThroughSExt);
 }
 
-/// extractCallocCall - Returns the corresponding CallInst if the instruction
-/// is a calloc call.
-const CallInst *llvm::extractCallocCall(const Value *I,
-                                        const TargetLibraryInfo *TLI) {
-  return isCallocLikeFn(I, TLI) ? cast<CallInst>(I) : nullptr;
-}
-
 /// isLibFreeFunction - Returns true if the function is a builtin free()
 bool llvm::isLibFreeFunction(const Function *F, const LibFunc TLIFn) {
   unsigned ExpectedNumParams;


        


More information about the llvm-commits mailing list