Honor the command line specification for machine type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32483 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 032782b..c84c6fb 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -542,8 +542,19 @@
bool DarwinAsmPrinter::doInitialization(Module &M) {
- if (Subtarget.isGigaProcessor())
+ const std::string &CPU = Subtarget.getCPU();
+
+ if (CPU != "generic")
+ O << "\t.machine ppc" << CPU << "\n";
+ else if (Subtarget.isGigaProcessor())
O << "\t.machine ppc970\n";
+ else if (Subtarget.isPPC64())
+ O << "\t.machine ppc64\n";
+ else if (Subtarget.hasAltivec())
+ O << "\t.machine ppc7400\n";
+ else
+ O << "\t.machine ppc\n";
+
AsmPrinter::doInitialization(M);
// Darwin wants symbols to be quoted if they have complex names.