[llvm] r316477 - BinaryFormat/MachO.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:14 PDT 2017


Author: dblaikie
Date: Tue Oct 24 10:29:14 2017
New Revision: 316477

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

Modified: llvm/trunk/include/llvm/BinaryFormat/MachO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BinaryFormat/MachO.h?rev=316477&r1=316476&r2=316477&view=diff
==============================================================================
--- llvm/trunk/include/llvm/BinaryFormat/MachO.h (original)
+++ llvm/trunk/include/llvm/BinaryFormat/MachO.h Tue Oct 24 10:29:14 2017
@@ -1373,19 +1373,19 @@ inline void swapStruct(fvmlib_command &C
 
 // Get/Set functions from <mach-o/nlist.h>
 
-static inline uint16_t GET_LIBRARY_ORDINAL(uint16_t n_desc) {
+inline uint16_t GET_LIBRARY_ORDINAL(uint16_t n_desc) {
   return (((n_desc) >> 8u) & 0xffu);
 }
 
-static inline void SET_LIBRARY_ORDINAL(uint16_t &n_desc, uint8_t ordinal) {
+inline void SET_LIBRARY_ORDINAL(uint16_t &n_desc, uint8_t ordinal) {
   n_desc = (((n_desc)&0x00ff) | (((ordinal)&0xff) << 8));
 }
 
-static inline uint8_t GET_COMM_ALIGN(uint16_t n_desc) {
+inline uint8_t GET_COMM_ALIGN(uint16_t n_desc) {
   return (n_desc >> 8u) & 0x0fu;
 }
 
-static inline void SET_COMM_ALIGN(uint16_t &n_desc, uint8_t align) {
+inline void SET_COMM_ALIGN(uint16_t &n_desc, uint8_t align) {
   n_desc = ((n_desc & 0xf0ffu) | ((align & 0x0fu) << 8u));
 }
 
@@ -1449,15 +1449,13 @@ enum CPUSubTypeX86 {
   CPU_SUBTYPE_X86_ARCH1 = 4,
   CPU_SUBTYPE_X86_64_H = 8
 };
-static inline int CPU_SUBTYPE_INTEL(int Family, int Model) {
+inline int CPU_SUBTYPE_INTEL(int Family, int Model) {
   return Family | (Model << 4);
 }
-static inline int CPU_SUBTYPE_INTEL_FAMILY(CPUSubTypeX86 ST) {
+inline int CPU_SUBTYPE_INTEL_FAMILY(CPUSubTypeX86 ST) {
   return ((int)ST) & 0x0f;
 }
-static inline int CPU_SUBTYPE_INTEL_MODEL(CPUSubTypeX86 ST) {
-  return ((int)ST) >> 4;
-}
+inline int CPU_SUBTYPE_INTEL_MODEL(CPUSubTypeX86 ST) { return ((int)ST) >> 4; }
 enum { CPU_SUBTYPE_INTEL_FAMILY_MAX = 15, CPU_SUBTYPE_INTEL_MODEL_ALL = 0 };
 
 enum CPUSubTypeARM {




More information about the llvm-commits mailing list