Index: include/llvm/Object/MachO.h =================================================================== --- include/llvm/Object/MachO.h +++ include/llvm/Object/MachO.h @@ -344,6 +344,12 @@ getLinkerOptionLoadCommand(const LoadCommandInfo &L) const; MachO::version_min_command getVersionMinLoadCommand(const LoadCommandInfo &L) const; + uint32_t + getVersionMinMajor(MachO::version_min_command &C) const; + uint32_t + getVersionMinMinor(MachO::version_min_command &C) const; + uint32_t + getVersionMinUpdate(MachO::version_min_command &C) const; MachO::dylib_command getDylibIDLoadCommand(const LoadCommandInfo &L) const; MachO::dyld_info_command Index: lib/Object/MachOObjectFile.cpp =================================================================== --- lib/Object/MachOObjectFile.cpp +++ lib/Object/MachOObjectFile.cpp @@ -2001,6 +2001,21 @@ return getStruct(this, L.Ptr); } +uint32_t +MachOObjectFile::getVersionMinMajor(MachO::version_min_command &C) const { + return (C.version >> 16) & 0xffff; +} + +uint32_t +MachOObjectFile::getVersionMinMinor(MachO::version_min_command &C) const { + return (C.version >> 8) & 0xffff; +} + +uint32_t +MachOObjectFile::getVersionMinUpdate(MachO::version_min_command &C) const { + return C.version & 0xff; +} + MachO::dylib_command MachOObjectFile::getDylibIDLoadCommand(const LoadCommandInfo &L) const { return getStruct(this, L.Ptr);