Pete Couperus | 2d1f6d6 | 2017-08-24 15:40:33 +0000 | [diff] [blame] | 1 | //===- ARCSubtarget.h - Define Subtarget for the ARC ------------*- 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 ARC specific subclass of TargetSubtargetInfo. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H |
| 15 | #define LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H |
| 16 | |
| 17 | #include "ARCFrameLowering.h" |
| 18 | #include "ARCISelLowering.h" |
| 19 | #include "ARCInstrInfo.h" |
| 20 | #include "llvm/CodeGen/SelectionDAGTargetInfo.h" |
David Blaikie | b3bde2e | 2017-11-17 01:07:10 +0000 | [diff] [blame] | 21 | #include "llvm/CodeGen/TargetSubtargetInfo.h" |
Pete Couperus | 2d1f6d6 | 2017-08-24 15:40:33 +0000 | [diff] [blame] | 22 | #include <string> |
| 23 | |
| 24 | #define GET_SUBTARGETINFO_HEADER |
| 25 | #include "ARCGenSubtargetInfo.inc" |
| 26 | |
| 27 | namespace llvm { |
| 28 | |
| 29 | class StringRef; |
| 30 | class TargetMachine; |
| 31 | |
| 32 | class ARCSubtarget : public ARCGenSubtargetInfo { |
| 33 | virtual void anchor(); |
| 34 | ARCInstrInfo InstrInfo; |
| 35 | ARCFrameLowering FrameLowering; |
| 36 | ARCTargetLowering TLInfo; |
| 37 | SelectionDAGTargetInfo TSInfo; |
| 38 | |
| 39 | public: |
| 40 | /// This constructor initializes the data members to match that |
| 41 | /// of the specified triple. |
| 42 | ARCSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, |
| 43 | const TargetMachine &TM); |
| 44 | |
| 45 | /// Parses features string setting specified subtarget options. |
| 46 | /// Definition of function is auto generated by tblgen. |
| 47 | void ParseSubtargetFeatures(StringRef CPU, StringRef FS); |
| 48 | |
| 49 | const ARCInstrInfo *getInstrInfo() const override { return &InstrInfo; } |
| 50 | const ARCFrameLowering *getFrameLowering() const override { |
| 51 | return &FrameLowering; |
| 52 | } |
| 53 | const ARCTargetLowering *getTargetLowering() const override { |
| 54 | return &TLInfo; |
| 55 | } |
| 56 | const ARCRegisterInfo *getRegisterInfo() const override { |
| 57 | return &InstrInfo.getRegisterInfo(); |
| 58 | } |
| 59 | const SelectionDAGTargetInfo *getSelectionDAGInfo() const override { |
| 60 | return &TSInfo; |
| 61 | } |
| 62 | }; |
| 63 | |
| 64 | } // end namespace llvm |
| 65 | |
| 66 | #endif // LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H |