[llvm] r316475 - MemoryBuiltins.h: Don't mark header functions as file-scope static

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 10:29:13 PDT 2017


Author: dblaikie
Date: Tue Oct 24 10:29:13 2017
New Revision: 316475

URL: http://llvm.org/viewvc/llvm-project?rev=316475&view=rev
Log:
MemoryBuiltins.h: Don't mark header functions as file-scope static

This creates ODR violations if the function is called from another inline                                                                   function in a header and also creates binary bloat from duplicate definitions.

Modified:
    llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h

Modified: llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h?rev=316475&r1=316474&r2=316475&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h (original)
+++ llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h Tue Oct 24 10:29:13 2017
@@ -92,8 +92,7 @@ bool isAllocLikeFn(const Value *V, const
 /// is a malloc call.  Since CallInst::CreateMalloc() only creates calls, we
 /// ignore InvokeInst here.
 const CallInst *extractMallocCall(const Value *I, const TargetLibraryInfo *TLI);
-static inline CallInst *extractMallocCall(Value *I,
-                                          const TargetLibraryInfo *TLI) {
+inline CallInst *extractMallocCall(Value *I, const TargetLibraryInfo *TLI) {
   return const_cast<CallInst*>(extractMallocCall((const Value*)I, TLI));
 }
 
@@ -127,8 +126,7 @@ Value *getMallocArraySize(CallInst *CI,
 /// extractCallocCall - Returns the corresponding CallInst if the instruction
 /// is a calloc call.
 const CallInst *extractCallocCall(const Value *I, const TargetLibraryInfo *TLI);
-static inline CallInst *extractCallocCall(Value *I,
-                                          const TargetLibraryInfo *TLI) {
+inline CallInst *extractCallocCall(Value *I, const TargetLibraryInfo *TLI) {
   return const_cast<CallInst*>(extractCallocCall((const Value*)I, TLI));
 }
 
@@ -140,7 +138,7 @@ static inline CallInst *extractCallocCal
 /// isFreeCall - Returns non-null if the value is a call to the builtin free()
 const CallInst *isFreeCall(const Value *I, const TargetLibraryInfo *TLI);
 
-static inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI) {
+inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI) {
   return const_cast<CallInst*>(isFreeCall((const Value*)I, TLI));
 }
 




More information about the llvm-commits mailing list