blob: 631d846f3c9cb6142f0d7524e85bcf1a38d734ab [file] [log] [blame]
Pete Couperus2d1f6d62017-08-24 15:40:33 +00001//===- 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 Blaikieb3bde2e2017-11-17 01:07:10 +000021#include "llvm/CodeGen/TargetSubtargetInfo.h"
Pete Couperus2d1f6d62017-08-24 15:40:33 +000022#include <string>
23
24#define GET_SUBTARGETINFO_HEADER
25#include "ARCGenSubtargetInfo.inc"
26
27namespace llvm {
28
29class StringRef;
30class TargetMachine;
31
32class ARCSubtarget : public ARCGenSubtargetInfo {
33 virtual void anchor();
34 ARCInstrInfo InstrInfo;
35 ARCFrameLowering FrameLowering;
36 ARCTargetLowering TLInfo;
37 SelectionDAGTargetInfo TSInfo;
38
39public:
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