1 //===-- ZPUTargetMachine.h - Define TargetMachine for ZPU -00--*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
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"
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
;
35 ZPUTargetMachine(const Target
&T
, const std::string
&TT
, const std::string
&FS
,
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 {
52 virtual bool addInstSelector(PassManagerBase
&PM
,
53 CodeGenOpt::Level OptLevel
);
57 } // End llvm namespace