]> granicus.if.org Git - llvm/commitdiff
SmallVector.h:capacity_in_bytes Don't mark header functions as file-scope static
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 24 Oct 2017 17:29:11 +0000 (17:29 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 24 Oct 2017 17:29:11 +0000 (17:29 +0000)
This creates ODR violations if the function is called from another inline
function in a header and also creates binary bloat from duplicate definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316472 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallVector.h

index b3c2d836d167e16efd22fb0bf8cbd7dfbdf7a45a..a9ac98d1ad4c9148297157900acd6e8d4c86b9fe 100644 (file)
@@ -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();
 }