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
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)24 BlackfinTargetMachine::BlackfinTargetMachine(const Target &T,
25 StringRef TT,
26 StringRef CPU,
27 StringRef FS, Reloc::Model RM)
28 : LLVMTargetMachine(T, TT, CPU, FS, RM),
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
addInstSelector(PassManagerBase & PM,CodeGenOpt::Level OptLevel)37 bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
38 CodeGenOpt::Level OptLevel) {
39 PM.add(createBlackfinISelDag(*this, OptLevel));
40 return false;
41 }
42