[llvm-commits] [llvm] r120187 - in /llvm/trunk/lib/Target: ARM/ARMAsmBackend.cpp PowerPC/PPCAsmBackend.cpp X86/X86AsmBackend.cpp

Daniel Dunbar daniel at zuster.org
Fri Nov 26 20:38:36 PST 2010


Author: ddunbar
Date: Fri Nov 26 22:38:36 2010
New Revision: 120187

URL: http://llvm.org/viewvc/llvm-project?rev=120187&view=rev
Log:
MC/Mach-O: Switch to using MachOFormat.h.
 - I'm leaving MachO.h, because I believe it has external consumers, but I would really like to eliminate it (we have stylistic disagreements with one another).

Modified:
    llvm/trunk/lib/Target/ARM/ARMAsmBackend.cpp
    llvm/trunk/lib/Target/PowerPC/PPCAsmBackend.cpp
    llvm/trunk/lib/Target/X86/X86AsmBackend.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmBackend.cpp?rev=120187&r1=120186&r2=120187&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmBackend.cpp Fri Nov 26 22:38:36 2010
@@ -17,8 +17,8 @@
 #include "llvm/MC/MCObjectWriter.h"
 #include "llvm/MC/MCSectionELF.h"
 #include "llvm/MC/MCSectionMachO.h"
+#include "llvm/Object/MachOFormat.h"
 #include "llvm/Support/ELF.h"
-#include "llvm/Support/MachO.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Target/TargetRegistry.h"
@@ -115,8 +115,9 @@
 
   MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
     // FIXME: Subtarget info should be derived. Force v7 for now.
-    return createMachObjectWriter(OS, /*Is64Bit=*/false, MachO::CPUTypeARM,
-                                  MachO::CPUSubType_ARM_V7,
+    return createMachObjectWriter(OS, /*Is64Bit=*/false,
+                                  object::mach::CTM_ARM,
+                                  object::mach::CSARM_V7,
                                   /*IsLittleEndian=*/true);
   }
 

Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmBackend.cpp?rev=120187&r1=120186&r2=120187&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmBackend.cpp Fri Nov 26 22:38:36 2010
@@ -13,8 +13,8 @@
 #include "llvm/MC/MCSectionMachO.h"
 #include "llvm/MC/MCObjectFormat.h"
 #include "llvm/MC/MCObjectWriter.h"
+#include "llvm/Object/MachOFormat.h"
 #include "llvm/Target/TargetRegistry.h"
-#include "llvm/Support/MachO.h"
 using namespace llvm;
 
 namespace {
@@ -72,9 +72,9 @@
     MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
       bool is64 = getPointerSize() == 8;
       return createMachObjectWriter(OS, /*Is64Bit=*/is64,
-                                    is64 ? MachO::CPUTypePowerPC64 : 
-                                    MachO::CPUTypePowerPC64,
-                                    MachO::CPUSubType_POWERPC_ALL,
+                                    (is64 ? object::mach::CTM_PowerPC64 :
+                                     object::mach::CTM_PowerPC),
+                                    object::mach::CSPPC_ALL,
                                     /*IsLittleEndian=*/false);
     }
     

Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmBackend.cpp?rev=120187&r1=120186&r2=120187&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86AsmBackend.cpp Fri Nov 26 22:38:36 2010
@@ -18,15 +18,14 @@
 #include "llvm/MC/MCSectionCOFF.h"
 #include "llvm/MC/MCSectionELF.h"
 #include "llvm/MC/MCSectionMachO.h"
+#include "llvm/Object/MachOFormat.h"
 #include "llvm/Support/ELF.h"
-#include "llvm/Support/MachO.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Target/TargetRegistry.h"
 #include "llvm/Target/TargetAsmBackend.h"
 using namespace llvm;
 
-
 static unsigned getFixupKindLog2Size(unsigned Kind) {
   switch (Kind) {
   default: assert(0 && "invalid fixup kind!");
@@ -360,8 +359,9 @@
   }
 
   MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
-    return createMachObjectWriter(OS, /*Is64Bit=*/false, MachO::CPUTypeI386,
-                                  MachO::CPUSubType_I386_ALL,
+    return createMachObjectWriter(OS, /*Is64Bit=*/false,
+                                  object::mach::CTM_i386,
+                                  object::mach::CSX86_ALL,
                                   /*IsLittleEndian=*/true);
   }
 };
@@ -378,8 +378,9 @@
   }
 
   MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
-    return createMachObjectWriter(OS, /*Is64Bit=*/true, MachO::CPUTypeX86_64,
-                                  MachO::CPUSubType_I386_ALL,
+    return createMachObjectWriter(OS, /*Is64Bit=*/true,
+                                  object::mach::CTM_x86_64,
+                                  object::mach::CSX86_ALL,
                                   /*IsLittleEndian=*/true);
   }
 





More information about the llvm-commits mailing list