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