zpu: managed to compile program that writes constant to global variable
[llvm/zpu.git] / lib / Target / Mips / MipsTargetMachine.h
blobd63976fcfc3e7bb1114749f70795be19f6b02565
1 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -00--*- C++ -*-===//
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 // This file declares the Mips specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSTARGETMACHINE_H
15 #define MIPSTARGETMACHINE_H
17 #include "MipsSubtarget.h"
18 #include "MipsInstrInfo.h"
19 #include "MipsISelLowering.h"
20 #include "MipsSelectionDAGInfo.h"
21 #include "llvm/Target/TargetMachine.h"
22 #include "llvm/Target/TargetData.h"
23 #include "llvm/Target/TargetFrameInfo.h"
25 namespace llvm {
26 class formatted_raw_ostream;
28 class MipsTargetMachine : public LLVMTargetMachine {
29 MipsSubtarget Subtarget;
30 const TargetData DataLayout; // Calculates type size & alignment
31 MipsInstrInfo InstrInfo;
32 TargetFrameInfo FrameInfo;
33 MipsTargetLowering TLInfo;
34 MipsSelectionDAGInfo TSInfo;
35 public:
36 MipsTargetMachine(const Target &T, const std::string &TT,
37 const std::string &FS, bool isLittle);
39 virtual const MipsInstrInfo *getInstrInfo() const
40 { return &InstrInfo; }
41 virtual const TargetFrameInfo *getFrameInfo() const
42 { return &FrameInfo; }
43 virtual const MipsSubtarget *getSubtargetImpl() const
44 { return &Subtarget; }
45 virtual const TargetData *getTargetData() const
46 { return &DataLayout;}
48 virtual const MipsRegisterInfo *getRegisterInfo() const {
49 return &InstrInfo.getRegisterInfo();
52 virtual const MipsTargetLowering *getTargetLowering() const {
53 return &TLInfo;
56 virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
57 return &TSInfo;
60 // Pass Pipeline Configuration
61 virtual bool addInstSelector(PassManagerBase &PM,
62 CodeGenOpt::Level OptLevel);
63 virtual bool addPreEmitPass(PassManagerBase &PM,
64 CodeGenOpt::Level OptLevel);
67 /// MipselTargetMachine - Mipsel target machine.
68 ///
69 class MipselTargetMachine : public MipsTargetMachine {
70 public:
71 MipselTargetMachine(const Target &T, const std::string &TT,
72 const std::string &FS);
75 } // End llvm namespace
77 #endif