[llvm] r316471 - DenseMap.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: 316471

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

Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=316471&r1=316470&r2=316471&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Tue Oct 24 10:29:11 2017
@@ -1214,9 +1214,8 @@ private:
   }
 };
 
-template<typename KeyT, typename ValueT, typename KeyInfoT>
-static inline size_t
-capacity_in_bytes(const DenseMap<KeyT, ValueT, KeyInfoT> &X) {
+template <typename KeyT, typename ValueT, typename KeyInfoT>
+inline size_t capacity_in_bytes(const DenseMap<KeyT, ValueT, KeyInfoT> &X) {
   return X.getMemorySize();
 }
 




More information about the llvm-commits mailing list