[llvm] r269514 - [MachO] More missing swapStruct implementations

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Fri May 13 16:01:23 PDT 2016


Author: cbieneman
Date: Fri May 13 18:01:22 2016
New Revision: 269514

URL: http://llvm.org/viewvc/llvm-project?rev=269514&view=rev
Log:
[MachO] More missing swapStruct implementations

Added swapStruct for ident_command, fvmlib and fvmlib_command.

Modified:
    llvm/trunk/include/llvm/Support/MachO.h

Modified: llvm/trunk/include/llvm/Support/MachO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MachO.h?rev=269514&r1=269513&r2=269514&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/MachO.h (original)
+++ llvm/trunk/include/llvm/Support/MachO.h Fri May 13 18:01:22 2016
@@ -1270,6 +1270,23 @@ namespace llvm {
       sys::swapByteOrder(C.size);
     };
 
+    inline void swapStruct(ident_command &C) {
+      sys::swapByteOrder(C.cmd);
+      sys::swapByteOrder(C.cmdsize);
+    };
+
+    inline void swapStruct(fvmlib &C) {
+      sys::swapByteOrder(C.name);
+      sys::swapByteOrder(C.minor_version);
+      sys::swapByteOrder(C.header_addr);
+    };
+
+    inline void swapStruct(fvmlib_command &C) {
+      sys::swapByteOrder(C.cmd);
+      sys::swapByteOrder(C.cmdsize);
+      swapStruct(C.fvmlib);
+    };
+
     // Get/Set functions from <mach-o/nlist.h>
 
     static inline uint16_t GET_LIBRARY_ORDINAL(uint16_t n_desc) {




More information about the llvm-commits mailing list