Darwin doesn't support #APP/#NO_APP
[oota-llvm.git] / lib / Target / PowerPC / PPCAsmPrinter.cpp
index 1a786291f0ff7a3df6ec022f91e225056acca32f..f46d8236bf28f7c838f67752cc4f46725916b7ee 100644 (file)
@@ -96,7 +96,7 @@ namespace {
     }
     
     bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
-                         unsigned AsmVariant) {
+                         unsigned AsmVariant, const char *ExtraCode) {
        printOperand(MI, OpNo);
        return false;
     }
@@ -222,18 +222,18 @@ namespace {
     : DwarfWriter(o, ap)
     {
       needsSet = true;
-      DwarfAbbrevSection = ".section __DWARFA,__debug_abbrev";
-      DwarfInfoSection = ".section __DWARFA,__debug_info";
-      DwarfLineSection = ".section __DWARFA,__debug_line";
+      DwarfAbbrevSection = ".section __DWARF,__debug_abbrev";
+      DwarfInfoSection = ".section __DWARF,__debug_info";
+      DwarfLineSection = ".section __DWARF,__debug_line";
       DwarfFrameSection =
-          ".section __DWARFA,__debug_frame,,coalesced,no_toc+strip_static_syms";
-      DwarfPubNamesSection = ".section __DWARFA,__debug_pubnames";
-      DwarfPubTypesSection = ".section __DWARFA,__debug_pubtypes";
-      DwarfStrSection = ".section __DWARFA,__debug_str";
-      DwarfLocSection = ".section __DWARFA,__debug_loc";
-      DwarfARangesSection = ".section __DWARFA,__debug_aranges";
-      DwarfRangesSection = ".section __DWARFA,__debug_ranges";
-      DwarfMacInfoSection = ".section __DWARFA,__debug_macinfo";
+          ".section __DWARF,__debug_frame,,coalesced,no_toc+strip_static_syms";
+      DwarfPubNamesSection = ".section __DWARF,__debug_pubnames";
+      DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes";
+      DwarfStrSection = ".section __DWARF,__debug_str";
+      DwarfLocSection = ".section __DWARF,__debug_loc";
+      DwarfARangesSection = ".section __DWARF,__debug_aranges";
+      DwarfRangesSection = ".section __DWARF,__debug_ranges";
+      DwarfMacInfoSection = ".section __DWARF,__debug_macinfo";
       TextSection = ".text";
       DataSection = ".data";
     }
@@ -246,8 +246,7 @@ namespace {
     DarwinDwarfWriter DW;
 
     DarwinAsmPrinter(std::ostream &O, TargetMachine &TM)
-      : PPCAsmPrinter(O, TM), DW(O, this)      
-      {
+      : PPCAsmPrinter(O, TM), DW(O, this) {
       CommentString = ";";
       GlobalPrefix = "_";
       PrivateGlobalPrefix = "L";     // Marker for constant pool idxs
@@ -258,6 +257,7 @@ namespace {
       LCOMMDirective = "\t.lcomm\t";
       StaticCtorsSection = ".mod_init_func";
       StaticDtorsSection = ".mod_term_func";
+      InlineAsmStart = InlineAsmEnd = "";  // Don't use #APP/#NO_APP
     }
 
     virtual const char *getPassName() const {
@@ -422,6 +422,15 @@ void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
       O << ", " << (unsigned int)SH << "\n";
       return;
     }
+  } else if (MI->getOpcode() == PPC::OR4 || MI->getOpcode() == PPC::OR8) {
+    if (MI->getOperand(1).getReg() == MI->getOperand(2).getReg()) {
+      O << "mr ";
+      printOperand(MI, 0);
+      O << ", ";
+      printOperand(MI, 1);
+      O << "\n";
+      return;
+    }
   }
 
   if (printInstruction(MI))