remove a dead bool.
[llvm/avr.git] / lib / Target / X86 / AsmPrinter / X86AsmPrinter.cpp
blob6b2da9ef8cf0f54f88f83594169f2532c1b0a507
1 //===-- X86AsmPrinter.cpp - Convert X86 LLVM IR to X86 assembly -----------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file the shared super class printer that converts from our internal
11 // representation of machine-dependent LLVM code to Intel and AT&T format
12 // assembly language.
13 // This printer is the output mechanism used by `llc'.
15 //===----------------------------------------------------------------------===//
17 #include "X86.h"
18 #include "X86ATTAsmPrinter.h"
19 #include "X86IntelAsmPrinter.h"
20 #include "X86ATTInstPrinter.h"
21 #include "llvm/MC/MCAsmInfo.h"
22 #include "llvm/Target/TargetRegistry.h"
23 using namespace llvm;
25 /// createX86CodePrinterPass - Returns a pass that prints the X86 assembly code
26 /// for a MachineFunction to the given output stream, using the given target
27 /// machine description.
28 ///
29 static AsmPrinter *createX86CodePrinterPass(formatted_raw_ostream &o,
30 TargetMachine &tm,
31 const MCAsmInfo *tai,
32 bool verbose) {
33 if (tm.getMCAsmInfo()->getAssemblerDialect() == 1)
34 return new X86IntelAsmPrinter(o, tm, tai, verbose);
35 return new X86ATTAsmPrinter(o, tm, tai, verbose);
39 static MCInstPrinter *createX86MCInstPrinter(const Target &T,
40 unsigned SyntaxVariant,
41 const MCAsmInfo &MAI,
42 raw_ostream &O) {
43 if (SyntaxVariant == 0)
44 return new X86ATTInstPrinter(O, MAI);
46 // Don't support intel syntax instprinter yet.
47 return 0;
50 // Force static initialization.
51 extern "C" void LLVMInitializeX86AsmPrinter() {
52 TargetRegistry::RegisterAsmPrinter(TheX86_32Target, createX86CodePrinterPass);
53 TargetRegistry::RegisterAsmPrinter(TheX86_64Target, createX86CodePrinterPass);
55 TargetRegistry::RegisterMCInstPrinter(TheX86_32Target,createX86MCInstPrinter);
56 TargetRegistry::RegisterMCInstPrinter(TheX86_64Target,createX86MCInstPrinter);