This mega patch converts us from using Function::a{iterator|begin|end} to
[oota-llvm.git] / lib / Target / X86 / X86AsmPrinter.cpp
1 //===-- X86AsmPrinter.cpp - Convert X86 LLVM code to Intel assembly -------===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains a printer that converts from our internal representation
11 // of machine-dependent LLVM code to Intel and AT&T format assembly
12 // language. This printer is the output mechanism used by `llc' and `lli
13 // -print-machineinstrs' on X86.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #include "X86.h"
18 #include "X86TargetMachine.h"
19 #include "llvm/Module.h"
20 #include "llvm/Assembly/Writer.h"
21 #include "llvm/CodeGen/AsmPrinter.h"
22 #include "llvm/CodeGen/MachineConstantPool.h"
23 #include "llvm/CodeGen/MachineFunctionPass.h"
24 #include "llvm/CodeGen/ValueTypes.h"
25 #include "llvm/Target/TargetMachine.h"
26 #include "llvm/Support/Mangler.h"
27 #include "llvm/ADT/Statistic.h"
28 #include "llvm/Support/CommandLine.h"
29 using namespace llvm;
30
31 namespace {
32   Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
33   enum AsmWriterFlavor { att, intel };
34
35   cl::opt<AsmWriterFlavor>
36   AsmWriterFlavor("x86-asm-syntax",
37                   cl::desc("Choose style of code to emit from X86 backend:"),
38                   cl::values(
39                              clEnumVal(att,   "  Emit AT&T-style assembly"),
40                              clEnumVal(intel, "  Emit Intel-style assembly"),
41                              clEnumValEnd),
42                   cl::init(att));
43
44   struct X86SharedAsmPrinter : public AsmPrinter {
45     X86SharedAsmPrinter(std::ostream &O, TargetMachine &TM)
46       : AsmPrinter(O, TM), forCygwin(false) { }
47
48     bool doInitialization(Module &M);
49     void printConstantPool(MachineConstantPool *MCP);
50     bool doFinalization(Module &M);
51     bool forCygwin;
52   };
53 }
54
55 static bool isScale(const MachineOperand &MO) {
56   return MO.isImmediate() &&
57     (MO.getImmedValue() == 1 || MO.getImmedValue() == 2 ||
58      MO.getImmedValue() == 4 || MO.getImmedValue() == 8);
59 }
60
61 static bool isMem(const MachineInstr *MI, unsigned Op) {
62   if (MI->getOperand(Op).isFrameIndex()) return true;
63   if (MI->getOperand(Op).isConstantPoolIndex()) return true;
64   return Op+4 <= MI->getNumOperands() &&
65     MI->getOperand(Op  ).isRegister() && isScale(MI->getOperand(Op+1)) &&
66     MI->getOperand(Op+2).isRegister() && (MI->getOperand(Op+3).isImmediate() ||
67         MI->getOperand(Op+3).isGlobalAddress());
68 }
69
70 // SwitchSection - Switch to the specified section of the executable if we are
71 // not already in it!
72 //
73 static void SwitchSection(std::ostream &OS, std::string &CurSection,
74                           const char *NewSection) {
75   if (CurSection != NewSection) {
76     CurSection = NewSection;
77     if (!CurSection.empty())
78       OS << "\t" << NewSection << "\n";
79   }
80 }
81
82 /// doInitialization - determine
83 bool X86SharedAsmPrinter::doInitialization(Module& M) {
84   forCygwin = false;
85   const std::string& TT = M.getTargetTriple();
86   if (TT.length() > 5)
87     forCygwin = TT.find("cygwin") != std::string::npos || 
88                 TT.find("mingw")  != std::string::npos;
89   else if (TT.empty()) {
90 #if defined(__CYGWIN__) || defined(__MINGW32__)
91     forCygwin = true;
92 #else
93     forCygwin = false;
94 #endif
95   }
96   if (forCygwin)
97     GlobalPrefix = "_";
98   return AsmPrinter::doInitialization(M);
99 }
100
101 /// printConstantPool - Print to the current output stream assembly
102 /// representations of the constants in the constant pool MCP. This is
103 /// used to print out constants which have been "spilled to memory" by
104 /// the code generator.
105 ///
106 void X86SharedAsmPrinter::printConstantPool(MachineConstantPool *MCP) {
107   const std::vector<Constant*> &CP = MCP->getConstants();
108   const TargetData &TD = TM.getTargetData();
109  
110   if (CP.empty()) return;
111
112   for (unsigned i = 0, e = CP.size(); i != e; ++i) {
113     O << "\t.section .rodata\n";
114     emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType()));
115     O << ".CPI" << CurrentFnName << "_" << i << ":\t\t\t\t\t" << CommentString
116       << *CP[i] << "\n";
117     emitGlobalConstant(CP[i]);
118   }
119 }
120
121 bool X86SharedAsmPrinter::doFinalization(Module &M) {
122   const TargetData &TD = TM.getTargetData();
123   std::string CurSection;
124
125   // Print out module-level global variables here.
126   for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
127     if (I->hasInitializer()) {   // External global require no code
128       O << "\n\n";
129       std::string name = Mang->getValueName(I);
130       Constant *C = I->getInitializer();
131       unsigned Size = TD.getTypeSize(C->getType());
132       unsigned Align = TD.getTypeAlignmentShift(C->getType());
133
134       if (C->isNullValue() && 
135           (I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
136            I->hasWeakLinkage() /* FIXME: Verify correct */)) {
137         SwitchSection(O, CurSection, ".data");
138         if (!forCygwin && I->hasInternalLinkage())
139           O << "\t.local " << name << "\n";
140         
141         O << "\t.comm " << name << "," << TD.getTypeSize(C->getType());
142         if (!forCygwin)
143           O << "," << (1 << Align);
144         O << "\t\t# ";
145         WriteAsOperand(O, I, true, true, &M);
146         O << "\n";
147       } else {
148         switch (I->getLinkage()) {
149         case GlobalValue::LinkOnceLinkage:
150         case GlobalValue::WeakLinkage:   // FIXME: Verify correct for weak.
151           // Nonnull linkonce -> weak
152           O << "\t.weak " << name << "\n";
153           SwitchSection(O, CurSection, "");
154           O << "\t.section\t.llvm.linkonce.d." << name << ",\"aw\",@progbits\n";
155           break;
156         case GlobalValue::AppendingLinkage:
157           // FIXME: appending linkage variables should go into a section of
158           // their name or something.  For now, just emit them as external.
159         case GlobalValue::ExternalLinkage:
160           // If external or appending, declare as a global symbol
161           O << "\t.globl " << name << "\n";
162           // FALL THROUGH
163         case GlobalValue::InternalLinkage:
164           if (C->isNullValue())
165             SwitchSection(O, CurSection, ".bss");
166           else
167             SwitchSection(O, CurSection, ".data");
168           break;
169         case GlobalValue::GhostLinkage:
170           std::cerr << "GhostLinkage cannot appear in X86AsmPrinter!\n";
171           abort();
172         }
173
174         emitAlignment(Align);
175         if (!forCygwin) {
176           O << "\t.type " << name << ",@object\n";
177           O << "\t.size " << name << "," << Size << "\n";
178         }
179         O << name << ":\t\t\t\t# ";
180         WriteAsOperand(O, I, true, true, &M);
181         O << " = ";
182         WriteAsOperand(O, C, false, false, &M);
183         O << "\n";
184         emitGlobalConstant(C);
185       }
186     }
187
188   AsmPrinter::doFinalization(M);
189   return false; // success
190 }
191
192 namespace {
193   struct X86IntelAsmPrinter : public X86SharedAsmPrinter {
194     X86IntelAsmPrinter(std::ostream &O, TargetMachine &TM)
195       : X86SharedAsmPrinter(O, TM) { }
196
197     virtual const char *getPassName() const {
198       return "X86 Intel-Style Assembly Printer";
199     }
200
201     /// printInstruction - This method is automatically generated by tablegen
202     /// from the instruction set description.  This method returns true if the
203     /// machine instruction was sufficiently described to print it, otherwise it
204     /// returns false.
205     bool printInstruction(const MachineInstr *MI);
206
207     // This method is used by the tablegen'erated instruction printer.
208     void printOperand(const MachineInstr *MI, unsigned OpNo, MVT::ValueType VT){
209       const MachineOperand &MO = MI->getOperand(OpNo);
210       if (MO.getType() == MachineOperand::MO_MachineRegister) {
211         assert(MRegisterInfo::isPhysicalRegister(MO.getReg())&&"Not physref??");
212         // Bug Workaround: See note in Printer::doInitialization about %.
213         O << "%" << TM.getRegisterInfo()->get(MO.getReg()).Name;
214       } else {
215         printOp(MO);
216       }
217     }
218
219     void printCallOperand(const MachineInstr *MI, unsigned OpNo,
220                           MVT::ValueType VT) {
221       printOp(MI->getOperand(OpNo), true); // Don't print "OFFSET".
222     }
223
224     void printMemoryOperand(const MachineInstr *MI, unsigned OpNo,
225                             MVT::ValueType VT) {
226       switch (VT) {
227       default: assert(0 && "Unknown arg size!");
228       case MVT::i8:   O << "BYTE PTR "; break;
229       case MVT::i16:  O << "WORD PTR "; break;
230       case MVT::i32:
231       case MVT::f32:  O << "DWORD PTR "; break;
232       case MVT::i64:
233       case MVT::f64:  O << "QWORD PTR "; break;
234       case MVT::f80:  O << "XWORD PTR "; break;
235       }
236       printMemReference(MI, OpNo);
237     }
238
239     void printMachineInstruction(const MachineInstr *MI);
240     void printOp(const MachineOperand &MO, bool elideOffsetKeyword = false);
241     void printMemReference(const MachineInstr *MI, unsigned Op);
242     bool runOnMachineFunction(MachineFunction &F);    
243     bool doInitialization(Module &M);
244   };
245 } // end of anonymous namespace
246
247
248 // Include the auto-generated portion of the assembly writer.
249 #include "X86GenAsmWriter1.inc"
250
251
252 /// runOnMachineFunction - This uses the printMachineInstruction()
253 /// method to print assembly for each instruction.
254 ///
255 bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
256   setupMachineFunction(MF);
257   O << "\n\n";
258
259   // Print out constants referenced by the function
260   printConstantPool(MF.getConstantPool());
261
262   // Print out labels for the function.
263   O << "\t.text\n";
264   emitAlignment(4);
265   O << "\t.globl\t" << CurrentFnName << "\n";
266   if (!forCygwin)
267     O << "\t.type\t" << CurrentFnName << ", @function\n";
268   O << CurrentFnName << ":\n";
269
270   // Print out code for the function.
271   for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
272        I != E; ++I) {
273     // Print a label for the basic block if there are any predecessors.
274     if (I->pred_begin() != I->pred_end())
275       O << ".LBB" << CurrentFnName << "_" << I->getNumber() << ":\t"
276         << CommentString << " " << I->getBasicBlock()->getName() << "\n";
277     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
278          II != E; ++II) {
279       // Print the assembly for the instruction.
280       O << "\t";
281       printMachineInstruction(II);
282     }
283   }
284
285   // We didn't modify anything.
286   return false;
287 }
288
289 void X86IntelAsmPrinter::printOp(const MachineOperand &MO,
290                                  bool elideOffsetKeyword /* = false */) {
291   const MRegisterInfo &RI = *TM.getRegisterInfo();
292   switch (MO.getType()) {
293   case MachineOperand::MO_VirtualRegister:
294     if (Value *V = MO.getVRegValueOrNull()) {
295       O << "<" << V->getName() << ">";
296       return;
297     }
298     // FALLTHROUGH
299   case MachineOperand::MO_MachineRegister:
300     if (MRegisterInfo::isPhysicalRegister(MO.getReg()))
301       // Bug Workaround: See note in Printer::doInitialization about %.
302       O << "%" << RI.get(MO.getReg()).Name;
303     else
304       O << "%reg" << MO.getReg();
305     return;
306
307   case MachineOperand::MO_SignExtendedImmed:
308   case MachineOperand::MO_UnextendedImmed:
309     O << (int)MO.getImmedValue();
310     return;
311   case MachineOperand::MO_MachineBasicBlock: {
312     MachineBasicBlock *MBBOp = MO.getMachineBasicBlock();
313     O << ".LBB" << Mang->getValueName(MBBOp->getParent()->getFunction())
314       << "_" << MBBOp->getNumber () << "\t# "
315       << MBBOp->getBasicBlock ()->getName ();
316     return;
317   }
318   case MachineOperand::MO_PCRelativeDisp:
319     std::cerr << "Shouldn't use addPCDisp() when building X86 MachineInstrs";
320     abort ();
321     return;
322   case MachineOperand::MO_GlobalAddress: {
323     if (!elideOffsetKeyword)
324       O << "OFFSET ";
325     O << Mang->getValueName(MO.getGlobal());
326     int Offset = MO.getOffset();
327     if (Offset > 0)
328       O << " + " << Offset;
329     else if (Offset < 0)
330       O << " - " << -Offset;
331     return;
332   }
333   case MachineOperand::MO_ExternalSymbol:
334     O << GlobalPrefix << MO.getSymbolName();
335     return;
336   default:
337     O << "<unknown operand type>"; return;    
338   }
339 }
340
341 void X86IntelAsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op){
342   assert(isMem(MI, Op) && "Invalid memory reference!");
343
344   const MachineOperand &BaseReg  = MI->getOperand(Op);
345   int ScaleVal                   = MI->getOperand(Op+1).getImmedValue();
346   const MachineOperand &IndexReg = MI->getOperand(Op+2);
347   const MachineOperand &DispSpec = MI->getOperand(Op+3);
348
349   if (BaseReg.isFrameIndex()) {
350     O << "[frame slot #" << BaseReg.getFrameIndex();
351     if (DispSpec.getImmedValue())
352       O << " + " << DispSpec.getImmedValue();
353     O << "]";
354     return;
355   } else if (BaseReg.isConstantPoolIndex()) {
356     O << "[.CPI" << CurrentFnName << "_"
357       << BaseReg.getConstantPoolIndex();
358
359     if (IndexReg.getReg()) {
360       O << " + ";
361       if (ScaleVal != 1)
362         O << ScaleVal << "*";
363       printOp(IndexReg);
364     }
365     
366     if (DispSpec.getImmedValue())
367       O << " + " << DispSpec.getImmedValue();
368     O << "]";
369     return;
370   }
371
372   O << "[";
373   bool NeedPlus = false;
374   if (BaseReg.getReg()) {
375     printOp(BaseReg, true);
376     NeedPlus = true;
377   }
378
379   if (IndexReg.getReg()) {
380     if (NeedPlus) O << " + ";
381     if (ScaleVal != 1)
382       O << ScaleVal << "*";
383     printOp(IndexReg);
384     NeedPlus = true;
385   }
386
387   if (DispSpec.isGlobalAddress()) {
388     if (NeedPlus)
389       O << " + ";
390     printOp(DispSpec, true);
391   } else {
392     int DispVal = DispSpec.getImmedValue();
393     if (DispVal || (!BaseReg.getReg() && !IndexReg.getReg())) {
394       if (NeedPlus)
395         if (DispVal > 0)
396           O << " + ";
397         else {
398           O << " - ";
399           DispVal = -DispVal;
400         }
401       O << DispVal;
402     }
403   }
404   O << "]";
405 }
406
407
408 /// printMachineInstruction -- Print out a single X86 LLVM instruction
409 /// MI in Intel syntax to the current output stream.
410 ///
411 void X86IntelAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
412   ++EmittedInsts;
413
414   // Call the autogenerated instruction printer routines.
415   printInstruction(MI);
416 }
417
418 bool X86IntelAsmPrinter::doInitialization(Module &M) {
419   AsmPrinter::doInitialization(M);
420   // Tell gas we are outputting Intel syntax (not AT&T syntax) assembly.
421   //
422   // Bug: gas in `intel_syntax noprefix' mode interprets the symbol `Sp' in an
423   // instruction as a reference to the register named sp, and if you try to
424   // reference a symbol `Sp' (e.g. `mov ECX, OFFSET Sp') then it gets lowercased
425   // before being looked up in the symbol table. This creates spurious
426   // `undefined symbol' errors when linking. Workaround: Do not use `noprefix'
427   // mode, and decorate all register names with percent signs.
428   O << "\t.intel_syntax\n";
429   return false;
430 }
431
432
433
434 namespace {
435   struct X86ATTAsmPrinter : public X86SharedAsmPrinter {
436     X86ATTAsmPrinter(std::ostream &O, TargetMachine &TM)
437       : X86SharedAsmPrinter(O, TM) { }
438
439     virtual const char *getPassName() const {
440       return "X86 AT&T-Style Assembly Printer";
441     }
442
443     /// printInstruction - This method is automatically generated by tablegen
444     /// from the instruction set description.  This method returns true if the
445     /// machine instruction was sufficiently described to print it, otherwise it
446     /// returns false.
447     bool printInstruction(const MachineInstr *MI);
448
449     // This method is used by the tablegen'erated instruction printer.
450     void printOperand(const MachineInstr *MI, unsigned OpNo, MVT::ValueType VT){
451       printOp(MI->getOperand(OpNo));
452     }
453
454     void printCallOperand(const MachineInstr *MI, unsigned OpNo,
455                           MVT::ValueType VT) {
456       printOp(MI->getOperand(OpNo), true); // Don't print '$' prefix.
457     }
458
459     void printMemoryOperand(const MachineInstr *MI, unsigned OpNo,
460                             MVT::ValueType VT) {
461       printMemReference(MI, OpNo);
462     }
463
464     void printMachineInstruction(const MachineInstr *MI);
465     void printOp(const MachineOperand &MO, bool isCallOperand = false);
466     void printMemReference(const MachineInstr *MI, unsigned Op);
467     bool runOnMachineFunction(MachineFunction &F);    
468   };
469 } // end of anonymous namespace
470
471
472 // Include the auto-generated portion of the assembly writer.
473 #include "X86GenAsmWriter.inc"
474
475
476 /// runOnMachineFunction - This uses the printMachineInstruction()
477 /// method to print assembly for each instruction.
478 ///
479 bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
480   setupMachineFunction(MF);
481   O << "\n\n";
482
483   // Print out constants referenced by the function
484   printConstantPool(MF.getConstantPool());
485
486   // Print out labels for the function.
487   O << "\t.text\n";
488   emitAlignment(4);
489   O << "\t.globl\t" << CurrentFnName << "\n";
490   if (!forCygwin)
491     O << "\t.type\t" << CurrentFnName << ", @function\n";
492   O << CurrentFnName << ":\n";
493
494   // Print out code for the function.
495   for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
496        I != E; ++I) {
497     // Print a label for the basic block.
498     if (I->pred_begin() != I->pred_end())
499       O << ".LBB" << CurrentFnName << "_" << I->getNumber() << ":\t"
500         << CommentString << " " << I->getBasicBlock()->getName() << "\n";
501     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
502          II != E; ++II) {
503       // Print the assembly for the instruction.
504       O << "\t";
505       printMachineInstruction(II);
506     }
507   }
508
509   // We didn't modify anything.
510   return false;
511 }
512
513 void X86ATTAsmPrinter::printOp(const MachineOperand &MO, bool isCallOp) {
514   const MRegisterInfo &RI = *TM.getRegisterInfo();
515   switch (MO.getType()) {
516   case MachineOperand::MO_VirtualRegister:
517   case MachineOperand::MO_MachineRegister:
518     assert(MRegisterInfo::isPhysicalRegister(MO.getReg()) &&
519            "Virtual registers should not make it this far!");
520     O << '%';
521     for (const char *Name = RI.get(MO.getReg()).Name; *Name; ++Name)
522       O << (char)tolower(*Name);
523     return;
524
525   case MachineOperand::MO_SignExtendedImmed:
526   case MachineOperand::MO_UnextendedImmed:
527     O << '$' << (int)MO.getImmedValue();
528     return;
529   case MachineOperand::MO_MachineBasicBlock: {
530     MachineBasicBlock *MBBOp = MO.getMachineBasicBlock();
531     O << ".LBB" << Mang->getValueName(MBBOp->getParent()->getFunction())
532       << "_" << MBBOp->getNumber () << "\t# "
533       << MBBOp->getBasicBlock ()->getName ();
534     return;
535   }
536   case MachineOperand::MO_PCRelativeDisp:
537     std::cerr << "Shouldn't use addPCDisp() when building X86 MachineInstrs";
538     abort ();
539     return;
540   case MachineOperand::MO_GlobalAddress: {
541     if (!isCallOp) O << '$';
542     O << Mang->getValueName(MO.getGlobal());
543     int Offset = MO.getOffset();
544     if (Offset > 0)
545       O << "+" << Offset;
546     else if (Offset < 0)
547       O << Offset;
548     return;
549   }
550   case MachineOperand::MO_ExternalSymbol:
551     if (!isCallOp) O << '$';
552     O << GlobalPrefix << MO.getSymbolName();
553     return;
554   default:
555     O << "<unknown operand type>"; return;    
556   }
557 }
558
559 void X86ATTAsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op){
560   assert(isMem(MI, Op) && "Invalid memory reference!");
561
562   const MachineOperand &BaseReg  = MI->getOperand(Op);
563   int ScaleVal                   = MI->getOperand(Op+1).getImmedValue();
564   const MachineOperand &IndexReg = MI->getOperand(Op+2);
565   const MachineOperand &DispSpec = MI->getOperand(Op+3);
566
567   if (BaseReg.isFrameIndex()) {
568     O << "[frame slot #" << BaseReg.getFrameIndex();
569     if (DispSpec.getImmedValue())
570       O << " + " << DispSpec.getImmedValue();
571     O << "]";
572     return;
573   } else if (BaseReg.isConstantPoolIndex()) {
574     O << ".CPI" << CurrentFnName << "_"
575       << BaseReg.getConstantPoolIndex();
576     if (DispSpec.getImmedValue())
577       O << "+" << DispSpec.getImmedValue();
578     if (IndexReg.getReg()) {
579       O << "(,";
580       printOp(IndexReg);
581       if (ScaleVal != 1)
582         O << "," << ScaleVal;
583       O << ")";
584     }
585     return;
586   }
587
588   if (DispSpec.isGlobalAddress()) {
589     printOp(DispSpec, true);
590   } else {
591     int DispVal = DispSpec.getImmedValue();
592     if (DispVal || (!IndexReg.getReg() && !BaseReg.getReg()))
593       O << DispVal;
594   }
595
596   if (IndexReg.getReg() || BaseReg.getReg()) {
597     O << "(";
598     if (BaseReg.getReg())
599       printOp(BaseReg);
600
601     if (IndexReg.getReg()) {
602       O << ",";
603       printOp(IndexReg);
604       if (ScaleVal != 1)
605         O << "," << ScaleVal;
606     }
607
608     O << ")";
609   }
610 }
611
612
613 /// printMachineInstruction -- Print out a single X86 LLVM instruction
614 /// MI in Intel syntax to the current output stream.
615 ///
616 void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
617   ++EmittedInsts;
618   // Call the autogenerated instruction printer routines.
619   printInstruction(MI);
620 }
621
622
623 /// createX86CodePrinterPass - Returns a pass that prints the X86 assembly code
624 /// for a MachineFunction to the given output stream, using the given target
625 /// machine description.
626 ///
627 FunctionPass *llvm::createX86CodePrinterPass(std::ostream &o,TargetMachine &tm){
628   switch (AsmWriterFlavor) {
629   default: 
630     assert(0 && "Unknown asm flavor!");
631   case intel:
632     return new X86IntelAsmPrinter(o, tm);
633   case att:
634     return new X86ATTAsmPrinter(o, tm);
635   }
636 }