2005-07-02 00:44:09 +02:00
|
|
|
//===-- X86AsmPrinter.cpp - Convert X86 LLVM IR to X86 assembly -----------===//
|
2005-04-22 01:38:14 +02:00
|
|
|
//
|
2003-10-20 21:43:21 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 21:36:04 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-22 01:38:14 +02:00
|
|
|
//
|
2003-10-20 21:43:21 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2002-10-26 00:55:53 +02:00
|
|
|
//
|
2005-07-02 00:44:09 +02: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-26 00:55:53 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2005-07-02 00:44:09 +02:00
|
|
|
#include "X86ATTAsmPrinter.h"
|
|
|
|
#include "X86IntelAsmPrinter.h"
|
2005-11-21 23:39:40 +01:00
|
|
|
#include "X86Subtarget.h"
|
2004-02-14 07:00:36 +01:00
|
|
|
using namespace llvm;
|
2003-11-11 23:41:34 +01:00
|
|
|
|
2004-10-04 09:24:48 +02: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.
|
|
|
|
///
|
2006-03-14 00:20:37 +01:00
|
|
|
FunctionPass *llvm::createX86CodePrinterPass(std::ostream &o,
|
2006-09-06 20:34:40 +02:00
|
|
|
X86TargetMachine &tm) {
|
2006-09-07 14:23:47 +02:00
|
|
|
const X86Subtarget *Subtarget = &tm.getSubtarget<X86Subtarget>();
|
2006-09-06 20:34:40 +02:00
|
|
|
|
2006-09-07 14:23:47 +02:00
|
|
|
if (Subtarget->isFlavorIntel()) {
|
2006-09-08 00:06:40 +02:00
|
|
|
return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo());
|
2006-09-07 14:23:47 +02:00
|
|
|
} else {
|
2006-09-08 00:06:40 +02:00
|
|
|
return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo());
|
2004-10-04 09:24:48 +02:00
|
|
|
}
|
2003-06-19 21:32:32 +02:00
|
|
|
}
|