Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 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" |
Chris Lattner | af76e59 | 2009-08-22 20:48:53 +0000 | [diff] [blame] | 15 | #include "BlackfinMCAsmInfo.h" |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 16 | #include "llvm/PassManager.h" |
| 17 | #include "llvm/Target/TargetRegistry.h" |
| 18 | |
| 19 | using namespace llvm; |
| 20 | |
| 21 | extern "C" void LLVMInitializeBlackfinTarget() { |
| 22 | RegisterTargetMachine<BlackfinTargetMachine> X(TheBlackfinTarget); |
Chris Lattner | af76e59 | 2009-08-22 20:48:53 +0000 | [diff] [blame] | 23 | RegisterAsmInfo<BlackfinMCAsmInfo> Y(TheBlackfinTarget); |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 24 | |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | BlackfinTargetMachine::BlackfinTargetMachine(const Target &T, |
Daniel Dunbar | e28039c | 2009-08-02 23:37:13 +0000 | [diff] [blame] | 28 | const std::string &TT, |
Evan Cheng | 276365d | 2011-06-30 01:53:36 +0000 | [diff] [blame] | 29 | const std::string &CPU, |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 30 | const std::string &FS) |
Chris Lattner | 0a31d2f | 2009-08-11 20:42:37 +0000 | [diff] [blame] | 31 | : LLVMTargetMachine(T, TT), |
Chris Lattner | 59a9178 | 2009-11-07 19:07:32 +0000 | [diff] [blame] | 32 | DataLayout("e-p:32:32-i64:32-f64:32-n32"), |
Evan Cheng | 276365d | 2011-06-30 01:53:36 +0000 | [diff] [blame] | 33 | Subtarget(TT, CPU, FS), |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 34 | TLInfo(*this), |
Dan Gohman | ff7a562 | 2010-05-11 17:31:57 +0000 | [diff] [blame] | 35 | TSInfo(*this), |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 36 | InstrInfo(Subtarget), |
Anton Korobeynikov | 16c29b5 | 2011-01-10 12:39:04 +0000 | [diff] [blame] | 37 | FrameLowering(Subtarget) { |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 38 | } |
| 39 | |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 40 | bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM, |
| 41 | CodeGenOpt::Level OptLevel) { |
| 42 | PM.add(createBlackfinISelDag(*this, OptLevel)); |
| 43 | return false; |
| 44 | } |