llvm.org GIT mirror llvm / 0be4eaf
Remove two uses of getObject. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178985 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
3 changed file(s) with 6 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
159159 getSymbol64TableEntry(DataRefImpl DRI) const;
160160 const MachOFormat::SymbolTableEntry *
161161 getSymbolTableEntry(DataRefImpl DRI) const;
162 bool is64Bit() const;
162163
163164 const MachOObject *getObject() const { return MachOObj.get(); }
164165
4040 }
4141 }
4242
43 bool MachOObjectFile::is64Bit() const {
44 return MachOObj->is64Bit();
45 }
4346
4447 ObjectFile *ObjectFile::createMachOObjectFile(MemoryBuffer *Buffer) {
4548 error_code ec;
156156 };
157157 }
158158
159 static bool is64BitLoadCommand(const MachOObject *MachOObj, DataRefImpl DRI) {
160 LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
161 if (LCI.Command.Type == macho::LCT_Segment64)
162 return true;
163 assert(LCI.Command.Type == macho::LCT_Segment && "Unexpected Type.");
164 return false;
165 }
166
167159 static void getSection(const MachOObjectFile *Obj,
168160 DataRefImpl DRI,
169161 MachOSection &Section) {
170 const MachOObject *MachOObj = Obj->getObject();
171
172 if (is64BitLoadCommand(MachOObj, DRI)) {
162 if (Obj->is64Bit()) {
173163 const MachOFormat::Section64 *Sect = Obj->getSection64(DRI);
174164
175165 Section.Address = Sect->Address;
199189 static void getSymbol(const MachOObjectFile *Obj,
200190 DataRefImpl DRI,
201191 MachOSymbol &Symbol) {
202 const MachOObject *MachOObj = Obj->getObject();
203 if (MachOObj->is64Bit()) {
192 if (Obj->is64Bit()) {
204193 const MachOFormat::Symbol64TableEntry *Entry =
205194 Obj->getSymbol64TableEntry( DRI);
206195 Symbol.StringIndex = Entry->StringIndex;