blob: 0be797f753d5446c93cb5cd7aacb34b21f50f57e [file] [log] [blame]
Pete Couperus2d1f6d62017-08-24 15:40:33 +00001//===- ARCSubtarget.h - Define Subtarget for the ARC ------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Pete Couperus2d1f6d62017-08-24 15:40:33 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the ARC specific subclass of TargetSubtargetInfo.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
14#define LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
15
16#include "ARCFrameLowering.h"
17#include "ARCISelLowering.h"
18#include "ARCInstrInfo.h"
19#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
David Blaikieb3bde2e2017-11-17 01:07:10 +000020#include "llvm/CodeGen/TargetSubtargetInfo.h"
Pete Couperus2d1f6d62017-08-24 15:40:33 +000021#include <string>
22
23#define GET_SUBTARGETINFO_HEADER
24#include "ARCGenSubtargetInfo.inc"
25
26namespace llvm {
27
28class StringRef;
29class TargetMachine;
30
31class ARCSubtarget : public ARCGenSubtargetInfo {
32 virtual void anchor();
33 ARCInstrInfo InstrInfo;
34 ARCFrameLowering FrameLowering;
35 ARCTargetLowering TLInfo;
36 SelectionDAGTargetInfo TSInfo;
37
38public:
39 /// This constructor initializes the data members to match that
40 /// of the specified triple.
41 ARCSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
42 const TargetMachine &TM);
43
44 /// Parses features string setting specified subtarget options.
45 /// Definition of function is auto generated by tblgen.
46 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
47
48 const ARCInstrInfo *getInstrInfo() const override { return &InstrInfo; }
49 const ARCFrameLowering *getFrameLowering() const override {
50 return &FrameLowering;
51 }
52 const ARCTargetLowering *getTargetLowering() const override {
53 return &TLInfo;
54 }
55 const ARCRegisterInfo *getRegisterInfo() const override {
56 return &InstrInfo.getRegisterInfo();
57 }
58 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
59 return &TSInfo;
60 }
61};
62
63} // end namespace llvm
64
65#endif // LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H