zpu: wip eke out some simple instructions for load/store/add
[llvm/zpu.git] / lib / Target / ZPU / ZPUTargetMachine.h
blob933c8c4737be7cdd2861744f51c0b58d2f723bd5
1 //===-- ZPUTargetMachine.h - Define TargetMachine for ZPU -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 ZPU specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef ZPUTARGETMACHINE_H
15 #define ZPUTARGETMACHINE_H
17 #include "ZPUSubtarget.h"
18 #include "ZPUInstrInfo.h"
19 #include "ZPUISelLowering.h"
20 #include "llvm/Target/TargetMachine.h"
21 #include "llvm/Target/TargetData.h"
22 #include "llvm/Target/TargetFrameInfo.h"
24 namespace llvm {
25 class formatted_raw_ostream;
27 class ZPUTargetMachine : public LLVMTargetMachine {
28 const TargetData DataLayout; // Calculates type size & alignment
29 ZPUInstrInfo InstrInfo;
30 TargetFrameInfo FrameInfo;
31 ZPUTargetLowering TLInfo;
32 ZPUSubtarget Subtarget;
33 public:
35 ZPUTargetMachine(const Target &T, const std::string &TT, const std::string &FS,
36 bool isLittle=false);
38 virtual const ZPUInstrInfo *getInstrInfo() const
39 { return &InstrInfo; }
40 virtual const TargetFrameInfo *getFrameInfo() const
41 { return &FrameInfo; }
42 virtual const TargetData *getTargetData() const
43 { return &DataLayout;}
44 virtual const ZPUSubtarget *getSubtargetImpl() const
45 { return &Subtarget; }
46 virtual const ZPURegisterInfo *getRegisterInfo() const {
47 return &InstrInfo.getRegisterInfo();
49 virtual const ZPUTargetLowering *getTargetLowering() const {
50 return &TLInfo;
52 virtual bool addInstSelector(PassManagerBase &PM,
53 CodeGenOpt::Level OptLevel);
57 } // End llvm namespace
59 #endif