[llvm] r269499 - [MachO] Adding a few missing swapStruct functions
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Fri May 13 15:12:44 PDT 2016
Author: cbieneman
Date: Fri May 13 17:12:44 2016
New Revision: 269499
URL: http://llvm.org/viewvc/llvm-project?rev=269499&view=rev
Log:
[MachO] Adding a few missing swapStruct functions
MachO.h was missing the swapStruct functions for a few load command structures.
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=269499&r1=269498&r2=269499&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/MachO.h (original)
+++ llvm/trunk/include/llvm/Support/MachO.h Fri May 13 17:12:44 2016
@@ -1235,6 +1235,41 @@ namespace llvm {
sys::swapByteOrder(C);
}
+ inline void swapStruct(prebind_cksum_command &C) {
+ sys::swapByteOrder(C.cmd);
+ sys::swapByteOrder(C.cmdsize);
+ sys::swapByteOrder(C.cksum);
+ };
+
+ inline void swapStruct(twolevel_hints_command &C) {
+ sys::swapByteOrder(C.cmd);
+ sys::swapByteOrder(C.cmdsize);
+ sys::swapByteOrder(C.offset);
+ sys::swapByteOrder(C.nhints);
+ };
+
+ inline void swapStruct(prebound_dylib_command &C) {
+ sys::swapByteOrder(C.cmd);
+ sys::swapByteOrder(C.cmdsize);
+ sys::swapByteOrder(C.name);
+ sys::swapByteOrder(C.nmodules);
+ sys::swapByteOrder(C.linked_modules);
+ };
+
+ inline void swapStruct(fvmfile_command &C) {
+ sys::swapByteOrder(C.cmd);
+ sys::swapByteOrder(C.cmdsize);
+ sys::swapByteOrder(C.name);
+ sys::swapByteOrder(C.header_addr);
+ };
+
+ inline void swapStruct(symseg_command &C) {
+ sys::swapByteOrder(C.cmd);
+ sys::swapByteOrder(C.cmdsize);
+ sys::swapByteOrder(C.offset);
+ sys::swapByteOrder(C.size);
+ };
+
// 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