blob: 477c43882f33aea256c97bce3d259dd857ccee98 [file] [log] [blame]
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +00001//===-- 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 Lattneraf76e592009-08-22 20:48:53 +000015#include "BlackfinMCAsmInfo.h"
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000016#include "llvm/PassManager.h"
17#include "llvm/Target/TargetRegistry.h"
18
19using namespace llvm;
20
21extern "C" void LLVMInitializeBlackfinTarget() {
22 RegisterTargetMachine<BlackfinTargetMachine> X(TheBlackfinTarget);
Chris Lattneraf76e592009-08-22 20:48:53 +000023 RegisterAsmInfo<BlackfinMCAsmInfo> Y(TheBlackfinTarget);
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000024
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000025}
26
27BlackfinTargetMachine::BlackfinTargetMachine(const Target &T,
Daniel Dunbare28039c2009-08-02 23:37:13 +000028 const std::string &TT,
Evan Cheng276365d2011-06-30 01:53:36 +000029 const std::string &CPU,
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000030 const std::string &FS)
Chris Lattner0a31d2f2009-08-11 20:42:37 +000031 : LLVMTargetMachine(T, TT),
Chris Lattner59a91782009-11-07 19:07:32 +000032 DataLayout("e-p:32:32-i64:32-f64:32-n32"),
Evan Cheng276365d2011-06-30 01:53:36 +000033 Subtarget(TT, CPU, FS),
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000034 TLInfo(*this),
Dan Gohmanff7a5622010-05-11 17:31:57 +000035 TSInfo(*this),
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000036 InstrInfo(Subtarget),
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000037 FrameLowering(Subtarget) {
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000038}
39
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000040bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
41 CodeGenOpt::Level OptLevel) {
42 PM.add(createBlackfinISelDag(*this, OptLevel));
43 return false;
44}