2005-07-01 22:44:09 +00:00
|
|
|
//===-- X86AsmPrinter.cpp - Convert X86 LLVM IR to X86 assembly -----------===//
|
2005-04-21 23:38:14 +00:00
|
|
|
//
|
2003-10-20 19:43:21 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 23:38:14 +00:00
|
|
|
//
|
2003-10-20 19:43:21 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2002-10-25 22:55:53 +00:00
|
|
|
//
|
2005-07-01 22:44:09 +00:00
|
|
|
// This file the shared super class printer that converts from our internal
|
|
|
|
// representation of machine-dependent LLVM code to Intel and AT&T format
|
|
|
|
// assembly language.
|
|
|
|
// This printer is the output mechanism used by `llc'.
|
2002-10-25 22:55:53 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-07-18 23:03:22 +00:00
|
|
|
#include "X86.h"
|
2005-07-01 22:44:09 +00:00
|
|
|
#include "X86ATTAsmPrinter.h"
|
|
|
|
#include "X86IntelAsmPrinter.h"
|
2009-08-11 23:01:09 +00:00
|
|
|
#include "llvm/Target/TargetAsmInfo.h"
|
2009-07-15 20:24:03 +00:00
|
|
|
#include "llvm/Target/TargetRegistry.h"
|
2004-02-14 06:00:36 +00:00
|
|
|
using namespace llvm;
|
2003-11-11 22:41:34 +00:00
|
|
|
|
2004-10-04 07:24:48 +00:00
|
|
|
/// createX86CodePrinterPass - Returns a pass that prints the X86 assembly code
|
|
|
|
/// for a MachineFunction to the given output stream, using the given target
|
|
|
|
/// machine description.
|
|
|
|
///
|
2009-08-13 23:48:47 +00:00
|
|
|
static AsmPrinter *createX86CodePrinterPass(formatted_raw_ostream &o,
|
|
|
|
TargetMachine &tm,
|
|
|
|
const TargetAsmInfo *tai,
|
|
|
|
bool verbose) {
|
2009-08-11 23:01:09 +00:00
|
|
|
if (tm.getTargetAsmInfo()->getAssemblerDialect() == 1)
|
2009-08-13 19:38:51 +00:00
|
|
|
return new X86IntelAsmPrinter(o, tm, tai, verbose);
|
|
|
|
return new X86ATTAsmPrinter(o, tm, tai, verbose);
|
2003-06-19 19:32:32 +00:00
|
|
|
}
|
2008-08-17 13:53:59 +00:00
|
|
|
|
2009-06-23 23:59:40 +00:00
|
|
|
// Force static initialization.
|
2009-07-15 20:24:03 +00:00
|
|
|
extern "C" void LLVMInitializeX86AsmPrinter() {
|
|
|
|
TargetRegistry::RegisterAsmPrinter(TheX86_32Target, createX86CodePrinterPass);
|
|
|
|
TargetRegistry::RegisterAsmPrinter(TheX86_64Target, createX86CodePrinterPass);
|
|
|
|
}
|