Home | History | Annotate | Download | only in Blackfin
      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/Support/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                                              StringRef TT,
     26                                              StringRef CPU,
     27                                              StringRef FS,
     28                                              Reloc::Model RM,
     29                                              CodeModel::Model CM)
     30   : LLVMTargetMachine(T, TT, CPU, FS, RM, CM),
     31     DataLayout("e-p:32:32-i64:32-f64:32-n32"),
     32     Subtarget(TT, CPU, FS),
     33     TLInfo(*this),
     34     TSInfo(*this),
     35     InstrInfo(Subtarget),
     36     FrameLowering(Subtarget) {
     37 }
     38 
     39 bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
     40                                             CodeGenOpt::Level OptLevel) {
     41   PM.add(createBlackfinISelDag(*this, OptLevel));
     42   return false;
     43 }
     44