2005-07-02 06:44:09 +08:00
|
|
|
//===-- X86AsmPrinter.cpp - Convert X86 LLVM IR to X86 assembly -----------===//
|
2005-04-22 07:38:14 +08:00
|
|
|
//
|
2003-10-21 03:43:21 +08:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 04:36:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-22 07:38:14 +08:00
|
|
|
//
|
2003-10-21 03:43:21 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2002-10-26 06:55:53 +08:00
|
|
|
//
|
2005-07-02 06:44:09 +08: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 06:55:53 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2005-07-02 06:44:09 +08:00
|
|
|
#include "X86ATTAsmPrinter.h"
|
|
|
|
#include "X86IntelAsmPrinter.h"
|
2008-08-24 20:30:46 +08:00
|
|
|
#include "X86Subtarget.h"
|
2004-02-14 14:00:36 +08:00
|
|
|
using namespace llvm;
|
2003-11-12 06:41:34 +08:00
|
|
|
|
2004-10-04 15:24:48 +08: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.
|
|
|
|
///
|
2008-08-21 08:14:44 +08:00
|
|
|
FunctionPass *llvm::createX86CodePrinterPass(raw_ostream &o,
|
2009-02-24 16:30:20 +08:00
|
|
|
X86TargetMachine &tm,
|
2009-04-30 07:29:43 +08:00
|
|
|
CodeGenOpt::Level OptLevel,
|
|
|
|
bool verbose) {
|
2006-09-07 20:23:47 +08:00
|
|
|
const X86Subtarget *Subtarget = &tm.getSubtarget<X86Subtarget>();
|
2006-09-07 02:34:40 +08:00
|
|
|
|
2009-06-19 07:33:13 +08:00
|
|
|
if (Subtarget->isFlavorIntel())
|
2009-04-29 08:15:41 +08:00
|
|
|
return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo(),
|
|
|
|
OptLevel, verbose);
|
2009-06-19 07:33:13 +08:00
|
|
|
return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo(),
|
|
|
|
OptLevel, verbose);
|
2003-06-20 03:32:32 +08:00
|
|
|
}
|
2008-08-17 21:53:59 +08:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
static struct Register {
|
|
|
|
Register() {
|
|
|
|
X86TargetMachine::registerAsmPrinter(createX86CodePrinterPass);
|
|
|
|
}
|
|
|
|
} Registrator;
|
|
|
|
}
|
2008-11-16 05:36:30 +08:00
|
|
|
|
|
|
|
extern "C" int X86AsmPrinterForceLink;
|
|
|
|
int X86AsmPrinterForceLink = 0;
|
2009-06-17 04:12:29 +08:00
|
|
|
|
|
|
|
// Force static initialization when called from
|
|
|
|
// llvm/InitializeAllAsmPrinters.h
|
|
|
|
namespace llvm {
|
|
|
|
void InitializeX86AsmPrinter() { }
|
|
|
|
}
|