#include "llvm/Object/MachOUniversalWriter.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/IRObjectFile.h"
#include "llvm/Object/MachO.h"
#include "llvm/Object/MachOUniversal.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBufferRef.h"
#include "llvm/Support/SwapByteOrder.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Triple.h"
usingnamespacellvm;
usingnamespaceobject;
static uint32_t calculateFileAlignment(const MachOObjectFile &O) { … }
static uint32_t calculateAlignment(const MachOObjectFile &ObjectFile) { … }
Slice::Slice(const Archive &A, uint32_t CPUType, uint32_t CPUSubType,
std::string ArchName, uint32_t Align)
: … { … }
Slice::Slice(const MachOObjectFile &O, uint32_t Align)
: … { … }
Slice::Slice(const IRObjectFile &IRO, uint32_t CPUType, uint32_t CPUSubType,
std::string ArchName, uint32_t Align)
: … { … }
Slice::Slice(const MachOObjectFile &O) : … { … }
MachoCPUTy;
static Expected<MachoCPUTy> getMachoCPUFromTriple(Triple TT) { … }
static Expected<MachoCPUTy> getMachoCPUFromTriple(StringRef TT) { … }
static MachoCPUTy getMachoCPUFromObjectFile(const MachOObjectFile &O) { … }
Expected<Slice> Slice::create(const Archive &A, LLVMContext *LLVMCtx) { … }
Expected<Slice> Slice::create(const IRObjectFile &IRO, uint32_t Align) { … }
template <typename FatArchTy> struct FatArchTraits { … };
template <> struct FatArchTraits<MachO::fat_arch> { … };
const std::string FatArchTraits<MachO::fat_arch>::StructName = …;
template <> struct FatArchTraits<MachO::fat_arch_64> { … };
const std::string FatArchTraits<MachO::fat_arch_64>::StructName = …;
template <typename FatArchTy>
static Expected<SmallVector<FatArchTy, 2>>
buildFatArchList(ArrayRef<Slice> Slices) { … }
template <typename FatArchTy>
static Error writeUniversalArchsToStream(MachO::fat_header FatHeader,
ArrayRef<Slice> Slices,
raw_ostream &Out) { … }
Error object::writeUniversalBinaryToStream(ArrayRef<Slice> Slices,
raw_ostream &Out,
FatHeaderType HeaderType) { … }
Error object::writeUniversalBinary(ArrayRef<Slice> Slices,
StringRef OutputFileName,
FatHeaderType HeaderType) { … }