zpu: managed to compile program that writes constant to global variable
[llvm/zpu.git] / lib / Target / Blackfin / BlackfinTargetMachine.cpp
blob66a2f689bf10f83bfe125e362d621206fb9af28b
1 //===-- 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 //
11 //===----------------------------------------------------------------------===//
13 #include "BlackfinTargetMachine.h"
14 #include "Blackfin.h"
15 #include "BlackfinMCAsmInfo.h"
16 #include "llvm/PassManager.h"
17 #include "llvm/Target/TargetRegistry.h"
19 using namespace llvm;
21 extern "C" void LLVMInitializeBlackfinTarget() {
22 RegisterTargetMachine<BlackfinTargetMachine> X(TheBlackfinTarget);
23 RegisterAsmInfo<BlackfinMCAsmInfo> Y(TheBlackfinTarget);
27 BlackfinTargetMachine::BlackfinTargetMachine(const Target &T,
28 const std::string &TT,
29 const std::string &FS)
30 : LLVMTargetMachine(T, TT),
31 DataLayout("e-p:32:32-i64:32-f64:32-n32"),
32 Subtarget(TT, FS),
33 TLInfo(*this),
34 TSInfo(*this),
35 InstrInfo(Subtarget),
36 FrameInfo(TargetFrameInfo::StackGrowsDown, 4, 0) {
39 bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
40 CodeGenOpt::Level OptLevel) {
41 PM.add(createBlackfinISelDag(*this, OptLevel));
42 return false;