1 //===-- MBlazeTargetMachine.h - Define TargetMachine for MBlaze -*- 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 MBlaze specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef MBLAZE_TARGETMACHINE_H
15 #define MBLAZE_TARGETMACHINE_H
17 #include "MBlazeFrameLowering.h"
18 #include "MBlazeISelLowering.h"
19 #include "MBlazeInstrInfo.h"
20 #include "MBlazeIntrinsicInfo.h"
21 #include "MBlazeSelectionDAGInfo.h"
22 #include "MBlazeSubtarget.h"
23 #include "llvm/IR/DataLayout.h"
24 #include "llvm/MC/MCStreamer.h"
25 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/Target/TargetMachine.h"
29 class formatted_raw_ostream;
31 class MBlazeTargetMachine : public LLVMTargetMachine {
32 MBlazeSubtarget Subtarget;
33 const DataLayout DL; // Calculates type size & alignment
34 MBlazeInstrInfo InstrInfo;
35 MBlazeFrameLowering FrameLowering;
36 MBlazeTargetLowering TLInfo;
37 MBlazeSelectionDAGInfo TSInfo;
38 MBlazeIntrinsicInfo IntrinsicInfo;
39 InstrItineraryData InstrItins;
42 MBlazeTargetMachine(const Target &T, StringRef TT,
43 StringRef CPU, StringRef FS,
44 const TargetOptions &Options,
45 Reloc::Model RM, CodeModel::Model CM,
46 CodeGenOpt::Level OL);
48 virtual const MBlazeInstrInfo *getInstrInfo() const
49 { return &InstrInfo; }
51 virtual const InstrItineraryData *getInstrItineraryData() const
52 { return &InstrItins; }
54 virtual const TargetFrameLowering *getFrameLowering() const
55 { return &FrameLowering; }
57 virtual const MBlazeSubtarget *getSubtargetImpl() const
58 { return &Subtarget; }
60 virtual const DataLayout *getDataLayout() const
63 virtual const MBlazeRegisterInfo *getRegisterInfo() const
64 { return &InstrInfo.getRegisterInfo(); }
66 virtual const MBlazeTargetLowering *getTargetLowering() const
69 virtual const MBlazeSelectionDAGInfo* getSelectionDAGInfo() const
72 const TargetIntrinsicInfo *getIntrinsicInfo() const
73 { return &IntrinsicInfo; }
75 // Pass Pipeline Configuration
76 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
78 } // End llvm namespace