diff options
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/File.h')
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/File.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h new file mode 100644 index 00000000000..e002a93e4b4 --- /dev/null +++ b/lld/lib/ReaderWriter/MachO/File.h @@ -0,0 +1,37 @@ +//===- lib/ReaderWriter/MachO/File.h --------------------------------------===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLD_READER_WRITER_MACHO_FILE_H +#define LLD_READER_WRITER_MACHO_FILE_H + +#include "Atoms.h" + +#include "lld/ReaderWriter/Simple.h" + +namespace lld { +namespace mach_o { + +class MachOFile : public SimpleFile { +public: + MachOFile(StringRef path) : SimpleFile(path) {} + + void addDefinedAtom(StringRef name, ArrayRef<uint8_t> content) { + MachODefinedAtom *atom = + new (_allocator) MachODefinedAtom(*this, name, content); + addAtom(*atom); + } + +private: + llvm::BumpPtrAllocator _allocator; +}; + +} // end namespace mach_o +} // end namespace lld + +#endif |

