• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
LLVMInitializeBlackfinTarget()20 extern "C" void LLVMInitializeBlackfinTarget() {
21   RegisterTargetMachine<BlackfinTargetMachine> X(TheBlackfinTarget);
22 }
23 
BlackfinTargetMachine(const Target & T,StringRef TT,StringRef CPU,StringRef FS,Reloc::Model RM,CodeModel::Model CM)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 
addInstSelector(PassManagerBase & PM,CodeGenOpt::Level OptLevel)39 bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
40                                             CodeGenOpt::Level OptLevel) {
41   PM.add(createBlackfinISelDag(*this, OptLevel));
42   return false;
43 }
44