]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/lib/Target/Blackfin/BlackfinTargetMachine.cpp
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / lib / Target / Blackfin / BlackfinTargetMachine.cpp
1 //===-- BlackfinTargetMachine.cpp - Define TargetMachine for Blackfin -----===//
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 "BlackfinTargetMachine.h"
14 #include "Blackfin.h"
15 #include "llvm/PassManager.h"
16 #include "llvm/Target/TargetRegistry.h"
17
18 using namespace llvm;
19
20 extern "C" void LLVMInitializeBlackfinTarget() {
21   RegisterTargetMachine<BlackfinTargetMachine> X(TheBlackfinTarget);
22 }
23
24 BlackfinTargetMachine::BlackfinTargetMachine(const Target &T,
25                                              const std::string &TT,
26                                              const std::string &CPU,
27                                              const std::string &FS)
28   : LLVMTargetMachine(T, TT, CPU, FS),
29     DataLayout("e-p:32:32-i64:32-f64:32-n32"),
30     Subtarget(TT, CPU, FS),
31     TLInfo(*this),
32     TSInfo(*this),
33     InstrInfo(Subtarget),
34     FrameLowering(Subtarget) {
35 }
36
37 bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
38                                             CodeGenOpt::Level OptLevel) {
39   PM.add(createBlackfinISelDag(*this, OptLevel));
40   return false;
41 }