• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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"
21 #include "llvm/CodeGen/TargetSubtargetInfo.h"
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 
getInstrInfo()49   const ARCInstrInfo *getInstrInfo() const override { return &InstrInfo; }
getFrameLowering()50   const ARCFrameLowering *getFrameLowering() const override {
51     return &FrameLowering;
52   }
getTargetLowering()53   const ARCTargetLowering *getTargetLowering() const override {
54     return &TLInfo;
55   }
getRegisterInfo()56   const ARCRegisterInfo *getRegisterInfo() const override {
57     return &InstrInfo.getRegisterInfo();
58   }
getSelectionDAGInfo()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
67