[llvm-commits] [llvm] r129980 - /llvm/trunk/lib/Object/MachOObjectFile.cpp
Eric Christopher
echristo at apple.com
Thu Apr 21 21:08:58 PDT 2011
Author: echristo
Date: Thu Apr 21 23:08:58 2011
New Revision: 129980
URL: http://llvm.org/viewvc/llvm-project?rev=129980&view=rev
Log:
Make the file format strings a little prettier for mach-o.
Modified:
llvm/trunk/lib/Object/MachOObjectFile.cpp
Modified: llvm/trunk/lib/Object/MachOObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOObjectFile.cpp?rev=129980&r1=129979&r2=129980&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/MachOObjectFile.cpp Thu Apr 21 23:08:58 2011
@@ -281,31 +281,27 @@
if (!MachOObj->is64Bit()) {
switch (MachOObj->getHeader().CPUType) {
case 0x00000007:
- return "MACHO32-i386";
- case 0x01000007:
- return "MACHO32-x86-64";
+ return "Mach-O 32-bit i386";
case 0x0000000c:
- return "MACHO32-arm";
+ return "Mach-O arm";
case 0x00000012:
- return "MACHO32-ppc";
- case 0x01000012:
- return "MACHO32-ppc64";
+ return "Mach-O 32-bit ppc";
+ default:
+ assert((MachOObj->getHeader().CPUType & 0x01000000) == 0 &&
+ "64-bit object file when we're not 64-bit?");
+ return "Mach-O 32-bit unknown";
}
}
switch (MachOObj->getHeader().CPUType) {
- case 0x00000007:
- return "MACHO64-i386";
case 0x01000007:
- return "MACHO64-x86-64";
- case 0x0000000c:
- return "MACHO64-arm";
- case 0x00000012:
- return "MACHO64-ppc";
+ return "Mach-O 64-bit x86-64";
case 0x01000012:
- return "MACHO64-ppc64";
+ return "Mach-O 64-bit ppc64";
default:
- return "MACHO64-unknown";
+ assert((MachOObj->getHeader().CPUType & 0x01000000) == 1 &&
+ "32-bit object file when we're 64-bit?");
+ return "Mach-O 64-bit unknown";
}
}
More information about the llvm-commits
mailing list