1//===-- XCoreSubtarget.h - Define Subtarget for the XCore -------*- C++ -*-===//
2//
3// 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
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the XCore specific subclass of TargetSubtargetInfo.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_XCORE_XCORESUBTARGET_H
14#define LLVM_LIB_TARGET_XCORE_XCORESUBTARGET_H
15
16#include "XCoreFrameLowering.h"
17#include "XCoreISelLowering.h"
18#include "XCoreInstrInfo.h"
19#include "XCoreSelectionDAGInfo.h"
20#include "llvm/CodeGen/TargetSubtargetInfo.h"
21#include "llvm/IR/DataLayout.h"
22#include "llvm/Target/TargetMachine.h"
23#include <string>
24
25#define OPTIONS_STRUCT_DECL
26#include "XCoreOptions.inc"
27
28#define GET_SUBTARGETINFO_HEADER
29#include "XCoreGenSubtargetInfo.inc"
30
31namespace llvm {
32class StringRef;
33
34class XCoreSubtarget : public XCoreGenSubtargetInfo {
35 virtual void anchor();
36 XCoreInstrInfo InstrInfo;
37 XCoreFrameLowering FrameLowering;
38 XCoreTargetLowering TLInfo;
39 XCoreSelectionDAGInfo TSInfo;
40
41public:
42 /// This constructor initializes the data members to match that
43 /// of the specified triple.
44 ///
45 XCoreSubtarget(const Triple &TT, const std::string &CPU,
46 const std::string &FS, const TargetMachine &TM);
47
48 /// ParseSubtargetFeatures - Parses features string setting specified
49 /// subtarget options. Definition of function is auto generated by tblgen.
50 void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);
51
52 const XCoreInstrInfo *getInstrInfo() const override { return &InstrInfo; }
53 const XCoreFrameLowering *getFrameLowering() const override {
54 return &FrameLowering;
55 }
56 const XCoreTargetLowering *getTargetLowering() const override {
57 return &TLInfo;
58 }
59 const XCoreSelectionDAGInfo *getSelectionDAGInfo() const override {
60 return &TSInfo;
61 }
62 const TargetRegisterInfo *getRegisterInfo() const override {
63 return &InstrInfo.getRegisterInfo();
64 }
65};
66} // End llvm namespace
67
68#endif
69