Simplify the code. No functionality change.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 11 Apr 2013 03:34:37 +0000 (03:34 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 11 Apr 2013 03:34:37 +0000 (03:34 +0000)
llvm-svn: 179259

llvm/tools/llvm-objdump/MachODump.cpp

index d1e7d69..89847d0 100644 (file)
@@ -56,23 +56,7 @@ static const Target *GetTarget(const MachOObjectFileBase *MachOObj) {
   // Figure out the target triple.
   if (TripleName.empty()) {
     llvm::Triple TT("unknown-unknown-unknown");
-    switch (MachOObj->getHeader()->CPUType) {
-    case llvm::MachO::CPUTypeI386:
-      TT.setArch(Triple::ArchType(Triple::x86));
-      break;
-    case llvm::MachO::CPUTypeX86_64:
-      TT.setArch(Triple::ArchType(Triple::x86_64));
-      break;
-    case llvm::MachO::CPUTypeARM:
-      TT.setArch(Triple::ArchType(Triple::arm));
-      break;
-    case llvm::MachO::CPUTypePowerPC:
-      TT.setArch(Triple::ArchType(Triple::ppc));
-      break;
-    case llvm::MachO::CPUTypePowerPC64:
-      TT.setArch(Triple::ArchType(Triple::ppc64));
-      break;
-    }
+    TT.setArch(Triple::ArchType(MachOObj->getArch()));
     TripleName = TT.str();
   }