LLVM 19.0.0git
MSP430Subtarget.h
Go to the documentation of this file.
1//===-- MSP430Subtarget.h - Define Subtarget for the MSP430 ----*- 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 MSP430 specific subclass of TargetSubtargetInfo.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H
14#define LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H
15
16#include "MSP430FrameLowering.h"
17#include "MSP430ISelLowering.h"
18#include "MSP430InstrInfo.h"
19#include "MSP430RegisterInfo.h"
22#include "llvm/IR/DataLayout.h"
23#include <string>
24
25#define GET_SUBTARGETINFO_HEADER
26#include "MSP430GenSubtargetInfo.inc"
27
28namespace llvm {
29class StringRef;
30
32public:
35 };
36
37private:
38 virtual void anchor();
39 bool ExtendedInsts = false;
40 HWMultEnum HWMultMode = NoHWMult;
41 MSP430InstrInfo InstrInfo;
44 MSP430FrameLowering FrameLowering;
45
46public:
47 /// This constructor initializes the data members to match that
48 /// of the specified triple.
49 ///
50 MSP430Subtarget(const Triple &TT, const std::string &CPU,
51 const std::string &FS, const TargetMachine &TM);
52
54
55 /// ParseSubtargetFeatures - Parses features string setting specified
56 /// subtarget options. Definition of function is auto generated by tblgen.
58
59 bool hasHWMult16() const { return HWMultMode == HWMult16; }
60 bool hasHWMult32() const { return HWMultMode == HWMult32; }
61 bool hasHWMultF5() const { return HWMultMode == HWMultF5; }
62
63 const TargetFrameLowering *getFrameLowering() const override {
64 return &FrameLowering;
65 }
66 const MSP430InstrInfo *getInstrInfo() const override { return &InstrInfo; }
67 const MSP430RegisterInfo *getRegisterInfo() const override {
68 return &getInstrInfo()->getRegisterInfo();
69 }
70
71 const MSP430TargetLowering *getTargetLowering() const override {
72 return &TLInfo;
73 }
75 return &TSInfo;
76 }
77};
78} // End llvm namespace
79
80#endif // LLVM_TARGET_MSP430_SUBTARGET_H
const char LLVMTargetMachineRef TM
const MSP430RegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
const MSP430RegisterInfo * getRegisterInfo() const override
const MSP430InstrInfo * getInstrInfo() const override
bool hasHWMultF5() const
const MSP430TargetLowering * getTargetLowering() const override
bool hasHWMult32() const
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
MSP430Subtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
bool hasHWMult16() const
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
const TargetFrameLowering * getFrameLowering() const override
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Information about stack frame layout on the target.
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:76
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18