X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FObject%2FMachO.h;h=63523133bacfa7a0b3272a6e0e41c741c41ed5ef;hb=40ec40a17940e1ddbe2e3dc57efc9cdcfd36fe12;hp=0fe327d6adcad2f6cc52131cc3013ff2acbd353a;hpb=dbdf667725714114182c2161d05e2038f8bdbc59;p=oota-llvm.git diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h index 0fe327d6adc..63523133bac 100644 --- a/include/llvm/Object/MachO.h +++ b/include/llvm/Object/MachO.h @@ -190,6 +190,8 @@ public: const char *Ptr; // Where in memory the load command is. MachO::load_command C; // The command itself. }; + typedef SmallVector LoadCommandList; + typedef LoadCommandList::const_iterator load_command_iterator; MachOObjectFile(MemoryBufferRef Object, bool IsLittleEndian, bool Is64Bits, std::error_code &EC); @@ -204,9 +206,8 @@ public: std::error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const override; - std::error_code getSymbolAlignment(DataRefImpl Symb, - uint32_t &Res) const override; - std::error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override; + uint32_t getSymbolAlignment(DataRefImpl Symb) const override; + uint64_t getSymbolSize(DataRefImpl Symb) const override; std::error_code getSymbolType(DataRefImpl Symb, SymbolRef::Type &Res) const override; uint32_t getSymbolFlags(DataRefImpl Symb) const override; @@ -241,9 +242,6 @@ public: std::error_code getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl &Result) const override; - std::error_code - getRelocationValueString(DataRefImpl Rel, - SmallVectorImpl &Result) const override; std::error_code getRelocationHidden(DataRefImpl Rel, bool &Result) const override; uint8_t getRelocationLength(DataRefImpl Rel) const; @@ -274,10 +272,14 @@ public: dice_iterator begin_dices() const; dice_iterator end_dices() const; - + + load_command_iterator begin_load_commands() const; + load_command_iterator end_load_commands() const; + iterator_range load_commands() const; + /// For use iterating over all exported symbols. iterator_range exports() const; - + /// For use examining a trie not in a MachOObjectFile. static iterator_range exports(ArrayRef Trie); @@ -330,10 +332,6 @@ public: unsigned getAnyRelocationType(const MachO::any_relocation_info &RE) const; SectionRef getAnyRelocationSection(const MachO::any_relocation_info &RE) const; - // Walk load commands. - LoadCommandInfo getFirstLoadCommandInfo() const; - LoadCommandInfo getNextLoadCommandInfo(const LoadCommandInfo &L) const; - // MachO specific structures. MachO::section getSection(DataRefImpl DRI) const; MachO::section_64 getSection64(DataRefImpl DRI) const; @@ -431,10 +429,15 @@ public: } private: + // Walk load commands. + LoadCommandInfo getFirstLoadCommandInfo() const; + LoadCommandInfo getNextLoadCommandInfo(const LoadCommandInfo &L) const; + typedef SmallVector SectionList; SectionList Sections; typedef SmallVector LibraryList; LibraryList Libraries; + LoadCommandList LoadCommands; typedef SmallVector LibraryShortName; mutable LibraryShortName LibrariesShortNames; const char *SymtabLoadCmd;