From 55a7ec33d7cafa703a1b6e6410d7c26d5b7ded0b Mon Sep 17 00:00:00 2001 From: Jim Laskey Date: Tue, 12 Dec 2006 16:07:33 +0000 Subject: 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 --- lib/Target/PowerPC/PPCAsmPrinter.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/Target/PowerPC/PPCAsmPrinter.cpp') 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::runOnMachineFunction(MachineFunction &MF) { 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. -- cgit v1.1