[llvm] r316472 - SmallVector.h:capacity_in_bytes 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:11 PDT 2017


Author: dblaikie
Date: Tue Oct 24 10:29:11 2017
New Revision: 316472

URL: http://llvm.org/viewvc/llvm-project?rev=316472&view=rev
Log:
SmallVector.h:capacity_in_bytes 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/ADT/SmallVector.h

Modified: llvm/trunk/include/llvm/ADT/SmallVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallVector.h?rev=316472&r1=316471&r2=316472&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SmallVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SmallVector.h Tue Oct 24 10:29:11 2017
@@ -927,8 +927,8 @@ public:
   }
 };
 
-template<typename T, unsigned N>
-static inline size_t capacity_in_bytes(const SmallVector<T, N> &X) {
+template <typename T, unsigned N>
+inline size_t capacity_in_bytes(const SmallVector<T, N> &X) {
   return X.capacity_in_bytes();
 }
 




More information about the llvm-commits mailing list