Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 1 | //===-- BlackfinTargetMachine.h - TargetMachine for Blackfin ----*- 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 Blackfin specific subclass of TargetMachine. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef BLACKFINTARGETMACHINE_H |
| 15 | #define BLACKFINTARGETMACHINE_H |
| 16 | |
| 17 | #include "llvm/Target/TargetMachine.h" |
| 18 | #include "llvm/Target/TargetData.h" |
| 19 | #include "llvm/Target/TargetFrameInfo.h" |
| 20 | #include "BlackfinInstrInfo.h" |
| 21 | #include "BlackfinSubtarget.h" |
| 22 | #include "BlackfinISelLowering.h" |
Dan Gohman | ff7a562 | 2010-05-11 17:31:57 +0000 | [diff] [blame^] | 23 | #include "BlackfinSelectionDAGInfo.h" |
Jakob Stoklund Olesen | 6ad8c84 | 2009-10-15 18:50:52 +0000 | [diff] [blame] | 24 | #include "BlackfinIntrinsicInfo.h" |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 25 | |
| 26 | namespace llvm { |
| 27 | |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 28 | class BlackfinTargetMachine : public LLVMTargetMachine { |
| 29 | const TargetData DataLayout; |
| 30 | BlackfinSubtarget Subtarget; |
| 31 | BlackfinTargetLowering TLInfo; |
Dan Gohman | ff7a562 | 2010-05-11 17:31:57 +0000 | [diff] [blame^] | 32 | BlackfinSelectionDAGInfo TSInfo; |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 33 | BlackfinInstrInfo InstrInfo; |
| 34 | TargetFrameInfo FrameInfo; |
Jakob Stoklund Olesen | 6ad8c84 | 2009-10-15 18:50:52 +0000 | [diff] [blame] | 35 | BlackfinIntrinsicInfo IntrinsicInfo; |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 36 | public: |
Daniel Dunbar | e28039c | 2009-08-02 23:37:13 +0000 | [diff] [blame] | 37 | BlackfinTargetMachine(const Target &T, const std::string &TT, |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 38 | const std::string &FS); |
| 39 | |
| 40 | virtual const BlackfinInstrInfo *getInstrInfo() const { return &InstrInfo; } |
| 41 | virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } |
| 42 | virtual const BlackfinSubtarget *getSubtargetImpl() const { |
| 43 | return &Subtarget; |
| 44 | } |
| 45 | virtual const BlackfinRegisterInfo *getRegisterInfo() const { |
| 46 | return &InstrInfo.getRegisterInfo(); |
| 47 | } |
Dan Gohman | d858e90 | 2010-04-17 15:26:15 +0000 | [diff] [blame] | 48 | virtual const BlackfinTargetLowering* getTargetLowering() const { |
| 49 | return &TLInfo; |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 50 | } |
Dan Gohman | ff7a562 | 2010-05-11 17:31:57 +0000 | [diff] [blame^] | 51 | virtual const BlackfinSelectionDAGInfo* getSelectionDAGInfo() const { |
| 52 | return &TSInfo; |
| 53 | } |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 54 | virtual const TargetData *getTargetData() const { return &DataLayout; } |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 55 | virtual bool addInstSelector(PassManagerBase &PM, |
| 56 | CodeGenOpt::Level OptLevel); |
Jakob Stoklund Olesen | 6ad8c84 | 2009-10-15 18:50:52 +0000 | [diff] [blame] | 57 | const TargetIntrinsicInfo *getIntrinsicInfo() const { |
| 58 | return &IntrinsicInfo; |
| 59 | } |
Jakob Stoklund Olesen | d950941 | 2009-08-02 17:32:10 +0000 | [diff] [blame] | 60 | }; |
| 61 | |
| 62 | } // end namespace llvm |
| 63 | |
| 64 | #endif |