Convert MachOObjectFile to a template.

For now it is templated only on being 64 or 32 bits. I will add little/big
endian next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179097 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-04-09 14:49:08 +00:00
parent 32a3e78304
commit f6cfc15705
6 changed files with 890 additions and 934 deletions

View File

@ -255,7 +255,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
std::sort(Rels.begin(), Rels.end(), RelocAddressLess);
StringRef SegmentName = "";
if (const MachOObjectFile *MachO = dyn_cast<const MachOObjectFile>(Obj)) {
if (const MachOObjectFileBase *MachO = dyn_cast<const MachOObjectFileBase>(Obj)) {
DataRefImpl DR = i->getRawDataRefImpl();
SegmentName = MachO->getSectionFinalSegmentName(DR);
}
@ -591,7 +591,7 @@ static void PrintSymbolTable(const ObjectFile *o) {
else if (Section == o->end_sections())
outs() << "*UND*";
else {
if (const MachOObjectFile *MachO = dyn_cast<const MachOObjectFile>(o)) {
if (const MachOObjectFileBase *MachO = dyn_cast<const MachOObjectFileBase>(o)) {
DataRefImpl DR = Section->getRawDataRefImpl();
StringRef SegmentName = MachO->getSectionFinalSegmentName(DR);
outs() << SegmentName << ",";