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 "MBlazeSubtarget.h"
18 #include "MBlazeInstrInfo.h"
19 #include "MBlazeISelLowering.h"
20 #include "MBlazeSelectionDAGInfo.h"
21 #include "MBlazeIntrinsicInfo.h"
22 #include "MBlazeFrameInfo.h"
23 #include "MBlazeELFWriterInfo.h"
24 #include "llvm/MC/MCStreamer.h"
25 #include "llvm/Target/TargetMachine.h"
26 #include "llvm/Target/TargetData.h"
27 #include "llvm/Target/TargetFrameInfo.h"
30 class formatted_raw_ostream;
32 class MBlazeTargetMachine : public LLVMTargetMachine {
33 MBlazeSubtarget Subtarget;
34 const TargetData DataLayout; // Calculates type size & alignment
35 MBlazeInstrInfo InstrInfo;
36 MBlazeFrameInfo FrameInfo;
37 MBlazeTargetLowering TLInfo;
38 MBlazeSelectionDAGInfo TSInfo;
39 MBlazeIntrinsicInfo IntrinsicInfo;
40 MBlazeELFWriterInfo ELFWriterInfo;
42 MBlazeTargetMachine(const Target &T, const std::string &TT,
43 const std::string &FS);
45 virtual const MBlazeInstrInfo *getInstrInfo() const
46 { return &InstrInfo; }
48 virtual const TargetFrameInfo *getFrameInfo() const
49 { return &FrameInfo; }
51 virtual const MBlazeSubtarget *getSubtargetImpl() const
52 { return &Subtarget; }
54 virtual const TargetData *getTargetData() const
55 { return &DataLayout;}
57 virtual const MBlazeRegisterInfo *getRegisterInfo() const
58 { return &InstrInfo.getRegisterInfo(); }
60 virtual const MBlazeTargetLowering *getTargetLowering() const
63 virtual const MBlazeSelectionDAGInfo* getSelectionDAGInfo() const
66 const TargetIntrinsicInfo *getIntrinsicInfo() const
67 { return &IntrinsicInfo; }
69 virtual const MBlazeELFWriterInfo *getELFWriterInfo() const {
70 return &ELFWriterInfo;
73 // Pass Pipeline Configuration
74 virtual bool addInstSelector(PassManagerBase &PM,
75 CodeGenOpt::Level OptLevel);
77 virtual bool addPreEmitPass(PassManagerBase &PM,
78 CodeGenOpt::Level OptLevel);
80 } // End llvm namespace