2009-08-02 17:32:10 +00: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 20:48:53 +00:00
|
|
|
#include "BlackfinMCAsmInfo.h"
|
2009-08-02 17:32:10 +00:00
|
|
|
#include "llvm/PassManager.h"
|
|
|
|
#include "llvm/Target/TargetRegistry.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
extern "C" void LLVMInitializeBlackfinTarget() {
|
|
|
|
RegisterTargetMachine<BlackfinTargetMachine> X(TheBlackfinTarget);
|
2009-08-22 20:48:53 +00:00
|
|
|
RegisterAsmInfo<BlackfinMCAsmInfo> Y(TheBlackfinTarget);
|
2009-08-02 17:32:10 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
BlackfinTargetMachine::BlackfinTargetMachine(const Target &T,
|
2009-08-02 23:37:13 +00:00
|
|
|
const std::string &TT,
|
2009-08-02 17:32:10 +00:00
|
|
|
const std::string &FS)
|
2009-08-11 20:42:37 +00:00
|
|
|
: LLVMTargetMachine(T, TT),
|
2009-11-07 19:07:32 +00:00
|
|
|
DataLayout("e-p:32:32-i64:32-f64:32-n32"),
|
2009-08-02 23:37:13 +00:00
|
|
|
Subtarget(TT, FS),
|
2009-08-02 17:32:10 +00:00
|
|
|
TLInfo(*this),
|
2010-05-11 17:31:57 +00:00
|
|
|
TSInfo(*this),
|
2009-08-02 17:32:10 +00:00
|
|
|
InstrInfo(Subtarget),
|
2011-01-10 12:39:04 +00:00
|
|
|
FrameLowering(Subtarget) {
|
2009-08-02 17:32:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel) {
|
|
|
|
PM.add(createBlackfinISelDag(*this, OptLevel));
|
|
|
|
return false;
|
|
|
|
}
|