1 //===-- X86AsmPrinter.cpp - Convert X86 LLVM code to AT&T assembly --------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains a printer that converts from our internal representation
11 // of machine-dependent LLVM code to X86 machine code.
13 //===----------------------------------------------------------------------===//
15 #include "X86AsmPrinter.h"
16 #include "X86ATTInstPrinter.h"
17 #include "X86IntelInstPrinter.h"
18 #include "X86MCInstLower.h"
21 #include "X86COFFMachineModuleInfo.h"
22 #include "X86MachineFunctionInfo.h"
23 #include "X86TargetMachine.h"
24 #include "llvm/CallingConv.h"
25 #include "llvm/DerivedTypes.h"
26 #include "llvm/Module.h"
27 #include "llvm/Type.h"
28 #include "llvm/Assembly/Writer.h"
29 #include "llvm/MC/MCAsmInfo.h"
30 #include "llvm/MC/MCContext.h"
31 #include "llvm/MC/MCExpr.h"
32 #include "llvm/MC/MCSectionMachO.h"
33 #include "llvm/MC/MCStreamer.h"
34 #include "llvm/MC/MCSymbol.h"
35 #include "llvm/CodeGen/MachineJumpTableInfo.h"
36 #include "llvm/CodeGen/MachineModuleInfoImpls.h"
37 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
38 #include "llvm/Support/ErrorHandling.h"
39 #include "llvm/Target/Mangler.h"
40 #include "llvm/Target/TargetOptions.h"
41 #include "llvm/Target/TargetRegistry.h"
42 #include "llvm/ADT/SmallString.h"
45 //===----------------------------------------------------------------------===//
46 // Primitive Helper Functions.
47 //===----------------------------------------------------------------------===//
49 void X86AsmPrinter::PrintPICBaseSymbol(raw_ostream &O) const {
50 const TargetLowering *TLI = TM.getTargetLowering();
51 O << *static_cast<const X86TargetLowering*>(TLI)->getPICBaseSymbol(MF,
55 /// runOnMachineFunction - Emit the function body.
57 bool X86AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
58 SetupMachineFunction(MF);
60 if (Subtarget->isTargetCOFF()) {
61 const Function *F = MF.getFunction();
62 OutStreamer.EmitRawText("\t.def\t " + Twine(CurrentFnSym->getName()) +
64 Twine(F->hasInternalLinkage() ? COFF::C_STAT : COFF::C_EXT) +
65 ";\t.type\t" + Twine(COFF::DT_FCN << COFF::N_BTSHFT)
69 // Have common code print out the function header with linkage info etc.
72 // Emit the rest of the function body.
75 // We didn't modify anything.
79 /// printSymbolOperand - Print a raw symbol reference operand. This handles
80 /// jump tables, constant pools, global address and external symbols, all of
81 /// which print to a label with various suffixes for relocation types etc.
82 void X86AsmPrinter::printSymbolOperand(const MachineOperand &MO,
84 switch (MO.getType()) {
85 default: llvm_unreachable("unknown symbol type!");
86 case MachineOperand::MO_JumpTableIndex:
87 O << *GetJTISymbol(MO.getIndex());
89 case MachineOperand::MO_ConstantPoolIndex:
90 O << *GetCPISymbol(MO.getIndex());
91 printOffset(MO.getOffset(), O);
93 case MachineOperand::MO_GlobalAddress: {
94 const GlobalValue *GV = MO.getGlobal();
97 if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB)
98 GVSym = GetSymbolWithGlobalValueBase(GV, "$stub");
99 else if (MO.getTargetFlags() == X86II::MO_DARWIN_NONLAZY ||
100 MO.getTargetFlags() == X86II::MO_DARWIN_NONLAZY_PIC_BASE ||
101 MO.getTargetFlags() == X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE)
102 GVSym = GetSymbolWithGlobalValueBase(GV, "$non_lazy_ptr");
104 GVSym = Mang->getSymbol(GV);
106 // Handle dllimport linkage.
107 if (MO.getTargetFlags() == X86II::MO_DLLIMPORT)
108 GVSym = OutContext.GetOrCreateSymbol(Twine("__imp_") + GVSym->getName());
110 if (MO.getTargetFlags() == X86II::MO_DARWIN_NONLAZY ||
111 MO.getTargetFlags() == X86II::MO_DARWIN_NONLAZY_PIC_BASE) {
112 MCSymbol *Sym = GetSymbolWithGlobalValueBase(GV, "$non_lazy_ptr");
113 MachineModuleInfoImpl::StubValueTy &StubSym =
114 MMI->getObjFileInfo<MachineModuleInfoMachO>().getGVStubEntry(Sym);
115 if (StubSym.getPointer() == 0)
116 StubSym = MachineModuleInfoImpl::
117 StubValueTy(Mang->getSymbol(GV), !GV->hasInternalLinkage());
118 } else if (MO.getTargetFlags() == X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE){
119 MCSymbol *Sym = GetSymbolWithGlobalValueBase(GV, "$non_lazy_ptr");
120 MachineModuleInfoImpl::StubValueTy &StubSym =
121 MMI->getObjFileInfo<MachineModuleInfoMachO>().getHiddenGVStubEntry(Sym);
122 if (StubSym.getPointer() == 0)
123 StubSym = MachineModuleInfoImpl::
124 StubValueTy(Mang->getSymbol(GV), !GV->hasInternalLinkage());
125 } else if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB) {
126 MCSymbol *Sym = GetSymbolWithGlobalValueBase(GV, "$stub");
127 MachineModuleInfoImpl::StubValueTy &StubSym =
128 MMI->getObjFileInfo<MachineModuleInfoMachO>().getFnStubEntry(Sym);
129 if (StubSym.getPointer() == 0)
130 StubSym = MachineModuleInfoImpl::
131 StubValueTy(Mang->getSymbol(GV), !GV->hasInternalLinkage());
134 // If the name begins with a dollar-sign, enclose it in parens. We do this
135 // to avoid having it look like an integer immediate to the assembler.
136 if (GVSym->getName()[0] != '$')
139 O << '(' << *GVSym << ')';
140 printOffset(MO.getOffset(), O);
143 case MachineOperand::MO_ExternalSymbol: {
144 const MCSymbol *SymToPrint;
145 if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB) {
146 SmallString<128> TempNameStr;
147 TempNameStr += StringRef(MO.getSymbolName());
148 TempNameStr += StringRef("$stub");
150 MCSymbol *Sym = GetExternalSymbolSymbol(TempNameStr.str());
151 MachineModuleInfoImpl::StubValueTy &StubSym =
152 MMI->getObjFileInfo<MachineModuleInfoMachO>().getFnStubEntry(Sym);
153 if (StubSym.getPointer() == 0) {
154 TempNameStr.erase(TempNameStr.end()-5, TempNameStr.end());
155 StubSym = MachineModuleInfoImpl::
156 StubValueTy(OutContext.GetOrCreateSymbol(TempNameStr.str()),
159 SymToPrint = StubSym.getPointer();
161 SymToPrint = GetExternalSymbolSymbol(MO.getSymbolName());
164 // If the name begins with a dollar-sign, enclose it in parens. We do this
165 // to avoid having it look like an integer immediate to the assembler.
166 if (SymToPrint->getName()[0] != '$')
169 O << '(' << *SymToPrint << '(';
174 switch (MO.getTargetFlags()) {
176 llvm_unreachable("Unknown target flag on GV operand");
177 case X86II::MO_NO_FLAG: // No flag.
179 case X86II::MO_DARWIN_NONLAZY:
180 case X86II::MO_DLLIMPORT:
181 case X86II::MO_DARWIN_STUB:
182 // These affect the name of the symbol, not any suffix.
184 case X86II::MO_GOT_ABSOLUTE_ADDRESS:
186 PrintPICBaseSymbol(O);
189 case X86II::MO_PIC_BASE_OFFSET:
190 case X86II::MO_DARWIN_NONLAZY_PIC_BASE:
191 case X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE:
193 PrintPICBaseSymbol(O);
195 case X86II::MO_TLSGD: O << "@TLSGD"; break;
196 case X86II::MO_GOTTPOFF: O << "@GOTTPOFF"; break;
197 case X86II::MO_INDNTPOFF: O << "@INDNTPOFF"; break;
198 case X86II::MO_TPOFF: O << "@TPOFF"; break;
199 case X86II::MO_NTPOFF: O << "@NTPOFF"; break;
200 case X86II::MO_GOTPCREL: O << "@GOTPCREL"; break;
201 case X86II::MO_GOT: O << "@GOT"; break;
202 case X86II::MO_GOTOFF: O << "@GOTOFF"; break;
203 case X86II::MO_PLT: O << "@PLT"; break;
207 /// print_pcrel_imm - This is used to print an immediate value that ends up
208 /// being encoded as a pc-relative value. These print slightly differently, for
209 /// example, a $ is not emitted.
210 void X86AsmPrinter::print_pcrel_imm(const MachineInstr *MI, unsigned OpNo,
212 const MachineOperand &MO = MI->getOperand(OpNo);
213 switch (MO.getType()) {
214 default: llvm_unreachable("Unknown pcrel immediate operand");
215 case MachineOperand::MO_Immediate:
218 case MachineOperand::MO_MachineBasicBlock:
219 O << *MO.getMBB()->getSymbol();
221 case MachineOperand::MO_GlobalAddress:
222 case MachineOperand::MO_ExternalSymbol:
223 printSymbolOperand(MO, O);
229 void X86AsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
230 raw_ostream &O, const char *Modifier) {
231 const MachineOperand &MO = MI->getOperand(OpNo);
232 switch (MO.getType()) {
233 default: llvm_unreachable("unknown operand type!");
234 case MachineOperand::MO_Register: {
236 unsigned Reg = MO.getReg();
237 if (Modifier && strncmp(Modifier, "subreg", strlen("subreg")) == 0) {
238 EVT VT = (strcmp(Modifier+6,"64") == 0) ?
239 MVT::i64 : ((strcmp(Modifier+6, "32") == 0) ? MVT::i32 :
240 ((strcmp(Modifier+6,"16") == 0) ? MVT::i16 : MVT::i8));
241 Reg = getX86SubSuperRegister(Reg, VT);
243 O << X86ATTInstPrinter::getRegisterName(Reg);
247 case MachineOperand::MO_Immediate:
248 O << '$' << MO.getImm();
251 case MachineOperand::MO_JumpTableIndex:
252 case MachineOperand::MO_ConstantPoolIndex:
253 case MachineOperand::MO_GlobalAddress:
254 case MachineOperand::MO_ExternalSymbol: {
256 printSymbolOperand(MO, O);
262 void X86AsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op,
264 unsigned char value = MI->getOperand(Op).getImm();
265 assert(value <= 7 && "Invalid ssecc argument!");
267 case 0: O << "eq"; break;
268 case 1: O << "lt"; break;
269 case 2: O << "le"; break;
270 case 3: O << "unord"; break;
271 case 4: O << "neq"; break;
272 case 5: O << "nlt"; break;
273 case 6: O << "nle"; break;
274 case 7: O << "ord"; break;
278 void X86AsmPrinter::printLeaMemReference(const MachineInstr *MI, unsigned Op,
279 raw_ostream &O, const char *Modifier) {
280 const MachineOperand &BaseReg = MI->getOperand(Op);
281 const MachineOperand &IndexReg = MI->getOperand(Op+2);
282 const MachineOperand &DispSpec = MI->getOperand(Op+3);
284 // If we really don't want to print out (rip), don't.
285 bool HasBaseReg = BaseReg.getReg() != 0;
286 if (HasBaseReg && Modifier && !strcmp(Modifier, "no-rip") &&
287 BaseReg.getReg() == X86::RIP)
290 // HasParenPart - True if we will print out the () part of the mem ref.
291 bool HasParenPart = IndexReg.getReg() || HasBaseReg;
293 if (DispSpec.isImm()) {
294 int DispVal = DispSpec.getImm();
295 if (DispVal || !HasParenPart)
298 assert(DispSpec.isGlobal() || DispSpec.isCPI() ||
299 DispSpec.isJTI() || DispSpec.isSymbol());
300 printSymbolOperand(MI->getOperand(Op+3), O);
304 assert(IndexReg.getReg() != X86::ESP &&
305 "X86 doesn't allow scaling by ESP");
309 printOperand(MI, Op, O, Modifier);
311 if (IndexReg.getReg()) {
313 printOperand(MI, Op+2, O, Modifier);
314 unsigned ScaleVal = MI->getOperand(Op+1).getImm();
316 O << ',' << ScaleVal;
322 void X86AsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op,
323 raw_ostream &O, const char *Modifier) {
324 assert(isMem(MI, Op) && "Invalid memory reference!");
325 const MachineOperand &Segment = MI->getOperand(Op+4);
326 if (Segment.getReg()) {
327 printOperand(MI, Op+4, O, Modifier);
330 printLeaMemReference(MI, Op, O, Modifier);
333 void X86AsmPrinter::printPICLabel(const MachineInstr *MI, unsigned Op,
335 PrintPICBaseSymbol(O);
337 PrintPICBaseSymbol(O);
341 bool X86AsmPrinter::printAsmMRegister(const MachineOperand &MO, char Mode,
343 unsigned Reg = MO.getReg();
345 default: return true; // Unknown mode.
346 case 'b': // Print QImode register
347 Reg = getX86SubSuperRegister(Reg, MVT::i8);
349 case 'h': // Print QImode high register
350 Reg = getX86SubSuperRegister(Reg, MVT::i8, true);
352 case 'w': // Print HImode register
353 Reg = getX86SubSuperRegister(Reg, MVT::i16);
355 case 'k': // Print SImode register
356 Reg = getX86SubSuperRegister(Reg, MVT::i32);
358 case 'q': // Print DImode register
359 Reg = getX86SubSuperRegister(Reg, MVT::i64);
363 O << '%' << X86ATTInstPrinter::getRegisterName(Reg);
367 /// PrintAsmOperand - Print out an operand for an inline asm expression.
369 bool X86AsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
371 const char *ExtraCode, raw_ostream &O) {
372 // Does this asm operand have a single letter operand modifier?
373 if (ExtraCode && ExtraCode[0]) {
374 if (ExtraCode[1] != 0) return true; // Unknown modifier.
376 const MachineOperand &MO = MI->getOperand(OpNo);
378 switch (ExtraCode[0]) {
379 default: return true; // Unknown modifier.
380 case 'a': // This is an address. Currently only 'i' and 'r' are expected.
385 if (MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isSymbol()) {
386 printSymbolOperand(MO, O);
391 printOperand(MI, OpNo, O);
397 case 'c': // Don't print "$" before a global var name or constant.
400 else if (MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isSymbol())
401 printSymbolOperand(MO, O);
403 printOperand(MI, OpNo, O);
406 case 'A': // Print '*' before a register (it must be a register)
409 printOperand(MI, OpNo, O);
414 case 'b': // Print QImode register
415 case 'h': // Print QImode high register
416 case 'w': // Print HImode register
417 case 'k': // Print SImode register
418 case 'q': // Print DImode register
420 return printAsmMRegister(MO, ExtraCode[0], O);
421 printOperand(MI, OpNo, O);
424 case 'P': // This is the operand of a call, treat specially.
425 print_pcrel_imm(MI, OpNo, O);
428 case 'n': // Negate the immediate or print a '-' before the operand.
429 // Note: this is a temporary solution. It should be handled target
430 // independently as part of the 'MC' work.
439 printOperand(MI, OpNo, O);
443 bool X86AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
444 unsigned OpNo, unsigned AsmVariant,
445 const char *ExtraCode,
447 if (ExtraCode && ExtraCode[0]) {
448 if (ExtraCode[1] != 0) return true; // Unknown modifier.
450 switch (ExtraCode[0]) {
451 default: return true; // Unknown modifier.
452 case 'b': // Print QImode register
453 case 'h': // Print QImode high register
454 case 'w': // Print HImode register
455 case 'k': // Print SImode register
456 case 'q': // Print SImode register
457 // These only apply to registers, ignore on mem.
459 case 'P': // Don't print @PLT, but do print as memory.
460 printMemReference(MI, OpNo, O, "no-rip");
464 printMemReference(MI, OpNo, O);
468 void X86AsmPrinter::EmitStartOfAsmFile(Module &M) {
469 if (Subtarget->isTargetDarwin())
470 OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
474 void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
475 if (Subtarget->isTargetDarwin()) {
476 // All darwin targets use mach-o.
477 MachineModuleInfoMachO &MMIMacho =
478 MMI->getObjFileInfo<MachineModuleInfoMachO>();
480 // Output stubs for dynamically-linked functions.
481 MachineModuleInfoMachO::SymbolListTy Stubs;
483 Stubs = MMIMacho.GetFnStubList();
484 if (!Stubs.empty()) {
485 const MCSection *TheSection =
486 OutContext.getMachOSection("__IMPORT", "__jump_table",
487 MCSectionMachO::S_SYMBOL_STUBS |
488 MCSectionMachO::S_ATTR_SELF_MODIFYING_CODE |
489 MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
490 5, SectionKind::getMetadata());
491 OutStreamer.SwitchSection(TheSection);
493 for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
495 OutStreamer.EmitLabel(Stubs[i].first);
496 // .indirect_symbol _foo
497 OutStreamer.EmitSymbolAttribute(Stubs[i].second.getPointer(),
498 MCSA_IndirectSymbol);
499 // hlt; hlt; hlt; hlt; hlt hlt = 0xf4 = -12.
500 const char HltInsts[] = { -12, -12, -12, -12, -12 };
501 OutStreamer.EmitBytes(StringRef(HltInsts, 5), 0/*addrspace*/);
505 OutStreamer.AddBlankLine();
508 // Output stubs for external and common global variables.
509 Stubs = MMIMacho.GetGVStubList();
510 if (!Stubs.empty()) {
511 const MCSection *TheSection =
512 OutContext.getMachOSection("__IMPORT", "__pointers",
513 MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
514 SectionKind::getMetadata());
515 OutStreamer.SwitchSection(TheSection);
517 for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
518 // L_foo$non_lazy_ptr:
519 OutStreamer.EmitLabel(Stubs[i].first);
520 // .indirect_symbol _foo
521 MachineModuleInfoImpl::StubValueTy &MCSym = Stubs[i].second;
522 OutStreamer.EmitSymbolAttribute(MCSym.getPointer(),
523 MCSA_IndirectSymbol);
526 // External to current translation unit.
527 OutStreamer.EmitIntValue(0, 4/*size*/, 0/*addrspace*/);
529 // Internal to current translation unit.
531 // When we place the LSDA into the TEXT section, the type info
532 // pointers need to be indirect and pc-rel. We accomplish this by
533 // using NLPs. However, sometimes the types are local to the file. So
534 // we need to fill in the value for the NLP in those cases.
535 OutStreamer.EmitValue(MCSymbolRefExpr::Create(MCSym.getPointer(),
537 4/*size*/, 0/*addrspace*/);
540 OutStreamer.AddBlankLine();
543 Stubs = MMIMacho.GetHiddenGVStubList();
544 if (!Stubs.empty()) {
545 OutStreamer.SwitchSection(getObjFileLowering().getDataSection());
548 for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
549 // L_foo$non_lazy_ptr:
550 OutStreamer.EmitLabel(Stubs[i].first);
552 OutStreamer.EmitValue(MCSymbolRefExpr::
553 Create(Stubs[i].second.getPointer(),
555 4/*size*/, 0/*addrspace*/);
558 OutStreamer.AddBlankLine();
561 // Funny Darwin hack: This flag tells the linker that no global symbols
562 // contain code that falls through to other global symbols (e.g. the obvious
563 // implementation of multiple entry points). If this doesn't occur, the
564 // linker can safely perform dead code stripping. Since LLVM never
565 // generates code that does this, it is always safe to set.
566 OutStreamer.EmitAssemblerFlag(MCAF_SubsectionsViaSymbols);
569 if (Subtarget->isTargetCOFF()) {
570 X86COFFMachineModuleInfo &COFFMMI =
571 MMI->getObjFileInfo<X86COFFMachineModuleInfo>();
573 // Emit type information for external functions
574 for (X86COFFMachineModuleInfo::stub_iterator I = COFFMMI.stub_begin(),
575 E = COFFMMI.stub_end(); I != E; ++I) {
576 OutStreamer.EmitRawText("\t.def\t " + Twine(I->getKeyData()) +
577 ";\t.scl\t" + Twine(COFF::C_EXT) +
579 Twine(COFF::DT_FCN << COFF::N_BTSHFT) +
583 if (Subtarget->isTargetCygMing()) {
584 // Necessary for dllexport support
585 std::vector<const MCSymbol*> DLLExportedFns, DLLExportedGlobals;
587 const TargetLoweringObjectFileCOFF &TLOFCOFF =
588 static_cast<const TargetLoweringObjectFileCOFF&>(getObjFileLowering());
590 for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I)
591 if (I->hasDLLExportLinkage())
592 DLLExportedFns.push_back(Mang->getSymbol(I));
594 for (Module::const_global_iterator I = M.global_begin(),
595 E = M.global_end(); I != E; ++I)
596 if (I->hasDLLExportLinkage())
597 DLLExportedGlobals.push_back(Mang->getSymbol(I));
599 // Output linker support code for dllexported globals on windows.
600 if (!DLLExportedGlobals.empty() || !DLLExportedFns.empty()) {
601 OutStreamer.SwitchSection(TLOFCOFF.getDrectveSection());
602 for (unsigned i = 0, e = DLLExportedGlobals.size(); i != e; ++i)
603 OutStreamer.EmitRawText("\t.ascii \" -export:" +
604 Twine(DLLExportedGlobals[i]->getName()) +
607 for (unsigned i = 0, e = DLLExportedFns.size(); i != e; ++i)
608 OutStreamer.EmitRawText("\t.ascii \" -export:" +
609 Twine(DLLExportedFns[i]->getName()) + "\"");
614 if (Subtarget->isTargetELF()) {
615 const TargetLoweringObjectFileELF &TLOFELF =
616 static_cast<const TargetLoweringObjectFileELF &>(getObjFileLowering());
618 MachineModuleInfoELF &MMIELF = MMI->getObjFileInfo<MachineModuleInfoELF>();
620 // Output stubs for external and common global variables.
621 MachineModuleInfoELF::SymbolListTy Stubs = MMIELF.GetGVStubList();
622 if (!Stubs.empty()) {
623 OutStreamer.SwitchSection(TLOFELF.getDataRelSection());
624 const TargetData *TD = TM.getTargetData();
626 for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
627 OutStreamer.EmitLabel(Stubs[i].first);
628 OutStreamer.EmitSymbolValue(Stubs[i].second.getPointer(),
629 TD->getPointerSize(), 0);
637 //===----------------------------------------------------------------------===//
638 // Target Registry Stuff
639 //===----------------------------------------------------------------------===//
641 static MCInstPrinter *createX86MCInstPrinter(const Target &T,
642 unsigned SyntaxVariant,
643 const MCAsmInfo &MAI) {
644 if (SyntaxVariant == 0)
645 return new X86ATTInstPrinter(MAI);
646 if (SyntaxVariant == 1)
647 return new X86IntelInstPrinter(MAI);
651 // Force static initialization.
652 extern "C" void LLVMInitializeX86AsmPrinter() {
653 RegisterAsmPrinter<X86AsmPrinter> X(TheX86_32Target);
654 RegisterAsmPrinter<X86AsmPrinter> Y(TheX86_64Target);
656 TargetRegistry::RegisterMCInstPrinter(TheX86_32Target,createX86MCInstPrinter);
657 TargetRegistry::RegisterMCInstPrinter(TheX86_64Target,createX86MCInstPrinter);