llvm.org GIT mirror llvm / 305b826
Make getObject const. Remove a const_cast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178980 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
3 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
154154 const MachOFormat::LinkeditDataLoadCommand *
155155 getLinkeditDataLoadCommand(LoadCommandInfo LCI) const;
156156
157 MachOObject *getObject() { return MachOObj.get(); }
157 const MachOObject *getObject() const { return MachOObj.get(); }
158158
159159 static inline bool classof(const Binary *v) {
160160 return v->isMachO();
107107
108108 // Print additional information about an address, if available.
109109 static void DumpAddress(uint64_t Address, ArrayRef Sections,
110 MachOObject *MachOObj, raw_ostream &OS) {
110 const MachOObject *MachOObj, raw_ostream &OS) {
111111 for (unsigned i = 0; i != Sections.size(); ++i) {
112112 uint64_t SectAddr = 0, SectSize = 0;
113113 Sections[i].getAddress(SectAddr);
240240
241241 OwningPtr MachOOF(static_cast(
242242 ObjectFile::createMachOObjectFile(Buff.take())));
243 MachOObject *MachOObj = MachOOF->getObject();
243 const MachOObject *MachOObj = MachOOF->getObject();
244244
245245 const Target *TheTarget = GetTarget(MachOObj);
246246 if (!TheTarget) {
253253
254254 ++SectionIndex;
255255
256 const MachOObject *MachO = const_cast(Obj)->getObject();
256 const MachOObject *MachO = Obj->getObject();
257257
258258 MachOSection Section;
259259 getSection(MachO, SecI->getRawDataRefImpl(), Section);