Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 1 | //===-- MBlazeTargetMachine.h - Define TargetMachine for MBlaze --- 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 MBlaze specific subclass of TargetMachine. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef MBLAZE_TARGETMACHINE_H |
| 15 | #define MBLAZE_TARGETMACHINE_H |
| 16 | |
| 17 | #include "MBlazeSubtarget.h" |
| 18 | #include "MBlazeInstrInfo.h" |
| 19 | #include "MBlazeISelLowering.h" |
Dan Gohman | ff7a562 | 2010-05-11 17:31:57 +0000 | [diff] [blame] | 20 | #include "MBlazeSelectionDAGInfo.h" |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 21 | #include "MBlazeIntrinsicInfo.h" |
| 22 | #include "llvm/Target/TargetMachine.h" |
| 23 | #include "llvm/Target/TargetData.h" |
| 24 | #include "llvm/Target/TargetFrameInfo.h" |
| 25 | |
| 26 | namespace llvm { |
| 27 | class formatted_raw_ostream; |
| 28 | |
| 29 | class MBlazeTargetMachine : public LLVMTargetMachine { |
| 30 | MBlazeSubtarget Subtarget; |
| 31 | const TargetData DataLayout; // Calculates type size & alignment |
| 32 | MBlazeInstrInfo InstrInfo; |
| 33 | TargetFrameInfo FrameInfo; |
| 34 | MBlazeTargetLowering TLInfo; |
Dan Gohman | ff7a562 | 2010-05-11 17:31:57 +0000 | [diff] [blame] | 35 | MBlazeSelectionDAGInfo TSInfo; |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 36 | MBlazeIntrinsicInfo IntrinsicInfo; |
| 37 | public: |
| 38 | MBlazeTargetMachine(const Target &T, const std::string &TT, |
| 39 | const std::string &FS); |
| 40 | |
| 41 | virtual const MBlazeInstrInfo *getInstrInfo() const |
| 42 | { return &InstrInfo; } |
| 43 | |
| 44 | virtual const TargetFrameInfo *getFrameInfo() const |
| 45 | { return &FrameInfo; } |
| 46 | |
| 47 | virtual const MBlazeSubtarget *getSubtargetImpl() const |
| 48 | { return &Subtarget; } |
| 49 | |
| 50 | virtual const TargetData *getTargetData() const |
| 51 | { return &DataLayout;} |
| 52 | |
| 53 | virtual const MBlazeRegisterInfo *getRegisterInfo() const |
| 54 | { return &InstrInfo.getRegisterInfo(); } |
| 55 | |
Dan Gohman | d858e90 | 2010-04-17 15:26:15 +0000 | [diff] [blame] | 56 | virtual const MBlazeTargetLowering *getTargetLowering() const |
| 57 | { return &TLInfo; } |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 58 | |
Dan Gohman | ff7a562 | 2010-05-11 17:31:57 +0000 | [diff] [blame] | 59 | virtual const MBlazeSelectionDAGInfo* getSelectionDAGInfo() const |
| 60 | { return &TSInfo; } |
| 61 | |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 62 | const TargetIntrinsicInfo *getIntrinsicInfo() const |
| 63 | { return &IntrinsicInfo; } |
| 64 | |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 65 | // Pass Pipeline Configuration |
| 66 | virtual bool addInstSelector(PassManagerBase &PM, |
| 67 | CodeGenOpt::Level OptLevel); |
| 68 | |
| 69 | virtual bool addPreEmitPass(PassManagerBase &PM, |
| 70 | CodeGenOpt::Level OptLevel); |
| 71 | }; |
| 72 | } // End llvm namespace |
| 73 | |
| 74 | #endif |