LLVM API Documentation

BlackfinTargetMachine.cpp

Go to the documentation of this file.
00001 //===-- BlackfinTargetMachine.cpp - Define TargetMachine for Blackfin -----===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 //
00011 //===----------------------------------------------------------------------===//
00012 
00013 #include "BlackfinTargetMachine.h"
00014 #include "Blackfin.h"
00015 #include "BlackfinTargetAsmInfo.h"
00016 #include "llvm/PassManager.h"
00017 #include "llvm/Target/TargetRegistry.h"
00018 
00019 using namespace llvm;
00020 
00021 extern "C" void LLVMInitializeBlackfinTarget() {
00022   RegisterTargetMachine<BlackfinTargetMachine> X(TheBlackfinTarget);
00023   RegisterAsmInfo<BlackfinTargetAsmInfo> Y(TheBlackfinTarget);
00024 
00025 }
00026 
00027 BlackfinTargetMachine::BlackfinTargetMachine(const Target &T,
00028                                              const std::string &TT,
00029                                              const std::string &FS)
00030   : LLVMTargetMachine(T, TT),
00031     DataLayout("e-p:32:32-i64:32-f64:32"),
00032     Subtarget(TT, FS),
00033     TLInfo(*this),
00034     InstrInfo(Subtarget),
00035     FrameInfo(TargetFrameInfo::StackGrowsDown, 4, 0) {
00036 }
00037 
00038 bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
00039                                             CodeGenOpt::Level OptLevel) {
00040   PM.add(createBlackfinISelDag(*this, OptLevel));
00041   return false;
00042 }