2009-08-02 19:32:10 +02:00
|
|
|
//===-- BlackfinTargetMachine.cpp - Define TargetMachine for Blackfin -----===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "BlackfinTargetMachine.h"
|
|
|
|
#include "Blackfin.h"
|
2009-08-22 22:48:53 +02:00
|
|
|
#include "BlackfinMCAsmInfo.h"
|
2009-08-02 19:32:10 +02:00
|
|
|
#include "llvm/PassManager.h"
|
|
|
|
#include "llvm/Target/TargetRegistry.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
extern "C" void LLVMInitializeBlackfinTarget() {
|
|
|
|
RegisterTargetMachine<BlackfinTargetMachine> X(TheBlackfinTarget);
|
2009-08-22 22:48:53 +02:00
|
|
|
RegisterAsmInfo<BlackfinMCAsmInfo> Y(TheBlackfinTarget);
|
2009-08-02 19:32:10 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
BlackfinTargetMachine::BlackfinTargetMachine(const Target &T,
|
2009-08-03 01:37:13 +02:00
|
|
|
const std::string &TT,
|
2009-08-02 19:32:10 +02:00
|
|
|
const std::string &FS)
|
2009-08-11 22:42:37 +02:00
|
|
|
: LLVMTargetMachine(T, TT),
|
2009-11-07 20:07:32 +01:00
|
|
|
DataLayout("e-p:32:32-i64:32-f64:32-n32"),
|
2009-08-03 01:37:13 +02:00
|
|
|
Subtarget(TT, FS),
|
2009-08-02 19:32:10 +02:00
|
|
|
TLInfo(*this),
|
2010-05-11 19:31:57 +02:00
|
|
|
TSInfo(*this),
|
2009-08-02 19:32:10 +02:00
|
|
|
InstrInfo(Subtarget),
|
2010-11-15 01:06:54 +01:00
|
|
|
FrameInfo(Subtarget) {
|
2009-08-02 19:32:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel) {
|
|
|
|
PM.add(createBlackfinISelDag(*this, OptLevel));
|
|
|
|
return false;
|
|
|
|
}
|