CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
[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 "AlphaJITInfo.h"
15 #include "AlphaMCAsmInfo.h"
16 #include "AlphaTargetMachine.h"
17 #include "llvm/PassManager.h"
18 #include "llvm/Support/FormattedStream.h"
19 #include "llvm/Target/TargetRegistry.h"
20 using namespace llvm;
21
22 extern "C" void LLVMInitializeAlphaTarget() { 
23   // Register the target.
24   RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget);
25   RegisterAsmInfo<AlphaMCAsmInfo> Y(TheAlphaTarget);
26 }
27
28 AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT,
29                                        const std::string &FS)
30   : LLVMTargetMachine(T, TT),
31     DataLayout("e-f128:128:128-n64"),
32     FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
33     JITInfo(*this),
34     Subtarget(TT, FS),
35     TLInfo(*this),
36     TSInfo(*this) {
37   setRelocationModel(Reloc::PIC_);
38 }
39
40
41 //===----------------------------------------------------------------------===//
42 // Pass Pipeline Configuration
43 //===----------------------------------------------------------------------===//
44
45 bool AlphaTargetMachine::addInstSelector(PassManagerBase &PM,
46                                          CodeGenOpt::Level OptLevel) {
47   PM.add(createAlphaISelDag(*this));
48   return false;
49 }
50 bool AlphaTargetMachine::addPreEmitPass(PassManagerBase &PM,
51                                         CodeGenOpt::Level OptLevel) {
52   // Must run branch selection immediately preceding the asm printer
53   PM.add(createAlphaBranchSelectionPass());
54   PM.add(createAlphaLLRPPass(*this));
55   return false;
56 }
57 bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM,
58                                         CodeGenOpt::Level OptLevel,
59                                         JITCodeEmitter &JCE) {
60   PM.add(createAlphaJITCodeEmitterPass(*this, JCE));
61   return false;
62 }