1 //===-- IA64TargetMachine.cpp - Define TargetMachine for IA64 -------------===//
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 implements the IA64 specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #include "IA64TargetAsmInfo.h"
15 #include "IA64TargetMachine.h"
17 #include "llvm/Module.h"
18 #include "llvm/PassManager.h"
19 #include "llvm/Target/TargetMachineRegistry.h"
22 // Register the target
23 extern Target TheIA64Target;
24 static RegisterTarget<IA64TargetMachine> X(TheIA64Target, "ia64",
25 "IA-64 (Itanium) [experimental]");
27 // Force static initialization.
28 extern "C" void LLVMInitializeIA64Target() { }
30 const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const {
31 return new IA64TargetAsmInfo(*this);
34 /// IA64TargetMachine ctor - Create an LP64 architecture model
36 IA64TargetMachine::IA64TargetMachine(const Target &T, const Module &M,
37 const std::string &FS)
38 : LLVMTargetMachine(T),
39 DataLayout("e-f80:128:128"),
40 FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
41 TLInfo(*this) { // FIXME? check this stuff
45 //===----------------------------------------------------------------------===//
46 // Pass Pipeline Configuration
47 //===----------------------------------------------------------------------===//
49 bool IA64TargetMachine::addInstSelector(PassManagerBase &PM,
50 CodeGenOpt::Level OptLevel) {
51 PM.add(createIA64DAGToDAGInstructionSelector(*this));
55 bool IA64TargetMachine::addPreEmitPass(PassManagerBase &PM,
56 CodeGenOpt::Level OptLevel) {
57 // Make sure everything is bundled happily
58 PM.add(createIA64BundlingPass(*this));
61 bool IA64TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
62 CodeGenOpt::Level OptLevel,
64 formatted_raw_ostream &Out) {
65 FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
67 llvm_report_error("unable to create assembly printer");