[llvm] dac82b5 - Revert "[MemoryBuiltins] [NFC] Add missing section comments"

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 14 08:34:30 PST 2022


Author: Philip Reames
Date: 2022-01-14T08:34:21-08:00
New Revision: dac82b53e22deb0d8282ff407fb4c13d01d31fe3

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

LOG: Revert "[MemoryBuiltins] [NFC] Add missing section comments"

This reverts commit 83338d5032424741accb1e851408021b47b84c08.  Comments in source are non-idiomatic and naming choice in head is unclear.

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 5daa46267f5f3..858a3eddca387 100644
--- a/llvm/include/llvm/Analysis/MemoryBuiltins.h
+++ b/llvm/include/llvm/Analysis/MemoryBuiltins.h
@@ -49,10 +49,6 @@ class Type;
 class UndefValue;
 class Value;
 
-//===----------------------------------------------------------------------===//
-//  Properties of allocation functions
-//
-
 /// Tests if a value is a call or invoke to a library function that
 /// allocates or reallocates memory (either malloc, calloc, realloc, or strdup
 /// like).
@@ -82,6 +78,20 @@ bool isReallocLikeFn(const Value *V, const TargetLibraryInfo *TLI);
 /// reallocates memory (e.g., realloc).
 bool isReallocLikeFn(const Function *F, const TargetLibraryInfo *TLI);
 
+//===----------------------------------------------------------------------===//
+//  free Call Utility Functions.
+//
+
+/// isLibFreeFunction - Returns true if the function is a builtin free()
+bool isLibFreeFunction(const Function *F, const LibFunc TLIFn);
+
+/// isFreeCall - Returns non-null if the value is a call to the builtin free()
+const CallInst *isFreeCall(const Value *I, const TargetLibraryInfo *TLI);
+
+inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI) {
+  return const_cast<CallInst*>(isFreeCall((const Value*)I, TLI));
+}
+
 //===----------------------------------------------------------------------===//
 //  Properties of allocation functions
 //
@@ -113,20 +123,6 @@ Constant *getInitialValueOfAllocation(const CallBase *Alloc,
                                       const TargetLibraryInfo *TLI,
                                       Type *Ty);
 
-//===----------------------------------------------------------------------===//
-//  free Call Utility Functions.
-//
-
-/// isLibFreeFunction - Returns true if the function is a builtin free()
-bool isLibFreeFunction(const Function *F, const LibFunc TLIFn);
-
-/// isFreeCall - Returns non-null if the value is a call to the builtin free()
-const CallInst *isFreeCall(const Value *I, const TargetLibraryInfo *TLI);
-
-inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI) {
-  return const_cast<CallInst*>(isFreeCall((const Value*)I, TLI));
-}
-
 //===----------------------------------------------------------------------===//
 //  Utility functions to compute size of objects.
 //

diff  --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index 9299b53aaf694..af8cb78b9a567 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -223,10 +223,6 @@ static Optional<AllocFnsTy> getAllocationSize(const Value *V,
   return Result;
 }
 
-
-//===----------------------------------------------------------------------===//
-//  Properties of allocation functions
-//
 /// Tests if a value is a call or invoke to a library function that
 /// allocates or reallocates memory (either malloc, calloc, realloc, or strdup
 /// like).
@@ -286,10 +282,6 @@ bool llvm::isReallocLikeFn(const Function *F, const TargetLibraryInfo *TLI) {
   return getAllocationDataForFunction(F, ReallocLike, TLI).hasValue();
 }
 
-
-//===----------------------------------------------------------------------===//
-//  Properties of allocation functions
-//
 bool llvm::isAllocRemovable(const CallBase *CB, const TargetLibraryInfo *TLI) {
   assert(isAllocationFn(CB, TLI));
 
@@ -408,10 +400,6 @@ Constant *llvm::getInitialValueOfAllocation(const CallBase *Alloc,
   return nullptr;
 }
 
-
-//===----------------------------------------------------------------------===//
-//  free Call Utility Functions.
-//
 /// 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