Implement MachOObjectFile::getHeader directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178994 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-04-07 19:26:57 +00:00
parent 18fdb398ea
commit 433611bdf3
3 changed files with 30 additions and 19 deletions
+11 -1
View File
@@ -125,6 +125,16 @@ namespace MachOFormat {
support::ulittle32_t DataOffset;
support::ulittle32_t DataSize;
};
struct Header {
support::ulittle32_t Magic;
support::ulittle32_t CPUType;
support::ulittle32_t CPUSubtype;
support::ulittle32_t FileType;
support::ulittle32_t NumLoadCommands;
support::ulittle32_t SizeOfLoadCommands;
support::ulittle32_t Flags;
};
}
class MachOObjectFile : public ObjectFile {
@@ -164,7 +174,7 @@ public:
bool is64Bit() const;
const MachOFormat::LoadCommand *getLoadCommandInfo(unsigned Index) const;
void ReadULEB128s(uint64_t Index, SmallVectorImpl<uint64_t> &Out) const;
const macho::Header &getHeader() const;
const MachOFormat::Header *getHeader() const;
unsigned getHeaderSize() const;
StringRef getData(size_t Offset, size_t Size) const;