diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-06-20 08:39:33 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-06-20 08:39:33 +0000 |
commit | 305b515c2787f47adecbe120e4b4bef55c5e5525 (patch) | |
tree | ccac9e6e0a37628f69a3658fc294da77454478e7 /include/llvm/Support | |
parent | fdc2d0faf321224393f1a5dbf05c3e3f88bb6e3e (diff) |
Remove 'static' from inline functions defined in header files.
There is a pretty staggering amount of this in LLVM's header files, this
is not all of the instances I'm afraid. These include all of the
functions that (in my build) are used by a non-static inline (or
external) function. Specifically, these issues were caught by the new
'-Winternal-linkage-in-inline' warning.
I'll try to just clean up the remainder of the clearly redundant "static
inline" cases on functions (not methods!) defined within headers if
I can do so in a reliable way.
There were even several cases of a missing 'inline' altogether, or my
personal favorite "static bool inline". Go figure. ;]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/AlignOf.h | 2 | ||||
-rw-r--r-- | include/llvm/Support/Endian.h | 8 | ||||
-rw-r--r-- | include/llvm/Support/MathExtras.h | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/include/llvm/Support/AlignOf.h b/include/llvm/Support/AlignOf.h index b63e75fd66..447b1a2e9f 100644 --- a/include/llvm/Support/AlignOf.h +++ b/include/llvm/Support/AlignOf.h @@ -57,7 +57,7 @@ struct AlignOf { /// class besides some cosmetic cleanliness. Example usage: /// alignOf<int>() returns the alignment of an int. template <typename T> -static inline unsigned alignOf() { return AlignOf<T>::Alignment; } +inline unsigned alignOf() { return AlignOf<T>::Alignment; } /// \brief Helper for building an aligned character array type. diff --git a/include/llvm/Support/Endian.h b/include/llvm/Support/Endian.h index 733ab7548f..8d5649dc1f 100644 --- a/include/llvm/Support/Endian.h +++ b/include/llvm/Support/Endian.h @@ -49,7 +49,7 @@ struct alignment_access_helper<value_type, unaligned> namespace endian { template<typename value_type, alignment align> - static value_type read_le(const void *memory) { + inline value_type read_le(const void *memory) { value_type t = reinterpret_cast<const detail::alignment_access_helper <value_type, align> *>(memory)->val; @@ -59,7 +59,7 @@ namespace endian { } template<typename value_type, alignment align> - static void write_le(void *memory, value_type value) { + inline void write_le(void *memory, value_type value) { if (sys::isBigEndianHost()) value = sys::SwapByteOrder(value); reinterpret_cast<detail::alignment_access_helper<value_type, align> *> @@ -67,7 +67,7 @@ namespace endian { } template<typename value_type, alignment align> - static value_type read_be(const void *memory) { + inline value_type read_be(const void *memory) { value_type t = reinterpret_cast<const detail::alignment_access_helper <value_type, align> *>(memory)->val; @@ -77,7 +77,7 @@ namespace endian { } template<typename value_type, alignment align> - static void write_be(void *memory, value_type value) { + inline void write_be(void *memory, value_type value) { if (sys::isLittleEndianHost()) value = sys::SwapByteOrder(value); reinterpret_cast<detail::alignment_access_helper<value_type, align> *> diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index d085c94f2a..4005161320 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -414,14 +414,14 @@ int IsInf(double d); /// MinAlign - A and B are either alignments or offsets. Return the minimum /// alignment that may be assumed after adding the two together. -static inline uint64_t MinAlign(uint64_t A, uint64_t B) { +inline uint64_t MinAlign(uint64_t A, uint64_t B) { // The largest power of 2 that divides both A and B. return (A | B) & -(A | B); } /// NextPowerOf2 - Returns the next power of two (in 64-bits) /// that is strictly greater than A. Returns zero on overflow. -static inline uint64_t NextPowerOf2(uint64_t A) { +inline uint64_t NextPowerOf2(uint64_t A) { A |= (A >> 1); A |= (A >> 2); A |= (A >> 4); |