[llvm] cffd268 - Demote getMallocType to implementation routine in MemoryBuiltins [NFC]

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


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

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

LOG: Demote getMallocType to implementation routine in MemoryBuiltins [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 6cbd700e67ac1..59cabf624bfbb 100644
--- a/llvm/include/llvm/Analysis/MemoryBuiltins.h
+++ b/llvm/include/llvm/Analysis/MemoryBuiltins.h
@@ -130,13 +130,6 @@ extractMallocCall(Value *I,
   return const_cast<CallInst *>(extractMallocCall((const Value *)I, GetTLI));
 }
 
-/// getMallocType - Returns the PointerType resulting from the malloc call.
-/// The PointerType depends on the number of bitcast uses of the malloc call:
-///   0: PointerType is the malloc calls' return type.
-///   1: PointerType is the bitcast's result type.
-///  >1: Unique PointerType cannot be determined, return NULL.
-PointerType *getMallocType(const CallInst *CI, const TargetLibraryInfo *TLI);
-
 /// getMallocAllocatedType - Returns the Type allocated by malloc call.
 /// The Type depends on the number of bitcast uses of the malloc call:
 ///   0: PointerType is the malloc calls' return type.

diff  --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index ffdd7a2cfd4b9..2f093a573fc96 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -373,8 +373,8 @@ static Value *computeArraySize(const CallInst *CI, const DataLayout &DL,
 ///   0: PointerType is the calls' return type.
 ///   1: PointerType is the bitcast's result type.
 ///  >1: Unique PointerType cannot be determined, return NULL.
-PointerType *llvm::getMallocType(const CallInst *CI,
-                                 const TargetLibraryInfo *TLI) {
+static PointerType *getMallocType(const CallInst *CI,
+                                  const TargetLibraryInfo *TLI) {
   assert(isMallocLikeFn(CI, TLI) && "getMallocType and not malloc call");
 
   PointerType *MallocType = nullptr;


        


More information about the llvm-commits mailing list