Kill off <TARGET>MachineModule variables, and <TARGETASMPRINTER>ForceLink
[oota-llvm.git] / lib / Target / XCore / XCoreTargetMachine.cpp
1 //===-- XCoreTargetMachine.cpp - Define TargetMachine for XCore -----------===//
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 //
11 //===----------------------------------------------------------------------===//
12
13 #include "XCoreTargetAsmInfo.h"
14 #include "XCoreTargetMachine.h"
15 #include "XCore.h"
16 #include "llvm/Module.h"
17 #include "llvm/PassManager.h"
18 #include "llvm/Target/TargetMachineRegistry.h"
19 using namespace llvm;
20
21 extern Target TheXCoreTarget;
22 namespace {
23   // Register the target.
24   RegisterTarget<XCoreTargetMachine> X(TheXCoreTarget, "xcore", "XCore");
25 }
26
27 // Force static initialization.
28 extern "C" void LLVMInitializeXCoreTarget() { 
29   TargetRegistry::RegisterAsmPrinter(TheXCoreTarget,
30                                      &createXCoreCodePrinterPass);
31 }
32
33 const TargetAsmInfo *XCoreTargetMachine::createTargetAsmInfo() const {
34   return new XCoreTargetAsmInfo(*this);
35 }
36
37 /// XCoreTargetMachine ctor - Create an ILP32 architecture model
38 ///
39 XCoreTargetMachine::XCoreTargetMachine(const Target &T, const Module &M, 
40                                        const std::string &FS)
41   : LLVMTargetMachine(T),
42     Subtarget(*this, M, FS),
43     DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-"
44                "i16:16:32-i32:32:32-i64:32:32"),
45     InstrInfo(),
46     FrameInfo(*this),
47     TLInfo(*this) {
48 }
49
50 bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM,
51                                          CodeGenOpt::Level OptLevel) {
52   PM.add(createXCoreISelDag(*this));
53   return false;
54 }