blob: e11920f568a29249545a2caab06cd8005e92d79e [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,
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000029 const std::string &FS)
Chris Lattner0a31d2f2009-08-11 20:42:37 +000030 : LLVMTargetMachine(T, TT),
Chris Lattner59a91782009-11-07 19:07:32 +000031 DataLayout("e-p:32:32-i64:32-f64:32-n32"),
Daniel Dunbare28039c2009-08-02 23:37:13 +000032 Subtarget(TT, FS),
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000033 TLInfo(*this),
Dan Gohmanff7a5622010-05-11 17:31:57 +000034 TSInfo(*this),
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000035 InstrInfo(Subtarget),
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000036 FrameLowering(Subtarget) {
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000037}
38
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000039bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
40 CodeGenOpt::Level OptLevel) {
41 PM.add(createBlackfinISelDag(*this, OptLevel));
42 return false;
43}