Rename tBX_Rm to tBX.
[oota-llvm.git] / lib / Target / Alpha / AlphaTargetMachine.cpp
1 //===-- AlphaTargetMachine.cpp - Define TargetMachine for Alpha -----------===//
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 "Alpha.h"
14 #include "AlphaMCAsmInfo.h"
15 #include "AlphaTargetMachine.h"
16 #include "llvm/PassManager.h"
17 #include "llvm/Support/FormattedStream.h"
18 #include "llvm/Target/TargetRegistry.h"
19 using namespace llvm;
20
21 extern "C" void LLVMInitializeAlphaTarget() { 
22   // Register the target.
23   RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget);
24   RegisterAsmInfo<AlphaMCAsmInfo> Y(TheAlphaTarget);
25 }
26
27 AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT,
28                                        const std::string &FS)
29   : LLVMTargetMachine(T, TT),
30     DataLayout("e-f128:128:128-n64"),
31     FrameLowering(Subtarget),
32     Subtarget(TT, FS),
33     TLInfo(*this),
34     TSInfo(*this) {
35   setRelocationModel(Reloc::PIC_);
36 }
37
38
39 //===----------------------------------------------------------------------===//
40 // Pass Pipeline Configuration
41 //===----------------------------------------------------------------------===//
42
43 bool AlphaTargetMachine::addInstSelector(PassManagerBase &PM,
44                                          CodeGenOpt::Level OptLevel) {
45   PM.add(createAlphaISelDag(*this));
46   return false;
47 }
48 bool AlphaTargetMachine::addPreEmitPass(PassManagerBase &PM,
49                                         CodeGenOpt::Level OptLevel) {
50   // Must run branch selection immediately preceding the asm printer
51   PM.add(createAlphaBranchSelectionPass());
52   PM.add(createAlphaLLRPPass(*this));
53   return false;
54 }