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 "MBlazeIntrinsicInfo.h"
21 #include "llvm/Target/TargetMachine.h"
22 #include "llvm/Target/TargetData.h"
23 #include "llvm/Target/TargetFrameInfo.h"
26 class formatted_raw_ostream;
28 class MBlazeTargetMachine : public LLVMTargetMachine {
29 MBlazeSubtarget Subtarget;
30 const TargetData DataLayout; // Calculates type size & alignment
31 MBlazeInstrInfo InstrInfo;
32 TargetFrameInfo FrameInfo;
33 MBlazeTargetLowering TLInfo;
34 MBlazeIntrinsicInfo IntrinsicInfo;
36 MBlazeTargetMachine(const Target &T, const std::string &TT,
37 const std::string &FS);
39 virtual const MBlazeInstrInfo *getInstrInfo() const
40 { return &InstrInfo; }
42 virtual const TargetFrameInfo *getFrameInfo() const
43 { return &FrameInfo; }
45 virtual const MBlazeSubtarget *getSubtargetImpl() const
46 { return &Subtarget; }
48 virtual const TargetData *getTargetData() const
49 { return &DataLayout;}
51 virtual const MBlazeRegisterInfo *getRegisterInfo() const
52 { return &InstrInfo.getRegisterInfo(); }
54 virtual MBlazeTargetLowering *getTargetLowering() const
55 { return const_cast<MBlazeTargetLowering*>(&TLInfo); }
57 const TargetIntrinsicInfo *getIntrinsicInfo() const
58 { return &IntrinsicInfo; }
60 // Pass Pipeline Configuration
61 virtual bool addInstSelector(PassManagerBase &PM,
62 CodeGenOpt::Level OptLevel);
64 virtual bool addPreEmitPass(PassManagerBase &PM,
65 CodeGenOpt::Level OptLevel);
67 } // End llvm namespace