LLVM  14.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 
28 namespace llvm {
29 class StringRef;
30 
32 public:
33  enum HWMultEnum {
35  };
36 
37 private:
38  virtual void anchor();
39  bool ExtendedInsts = false;
40  HWMultEnum HWMultMode = NoHWMult;
41  MSP430FrameLowering FrameLowering;
42  MSP430InstrInfo InstrInfo;
43  MSP430TargetLowering TLInfo;
45 
46 public:
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 TargetRegisterInfo *getRegisterInfo() const override {
68  return &InstrInfo.getRegisterInfo();
69  }
70  const MSP430TargetLowering *getTargetLowering() const override {
71  return &TLInfo;
72  }
73  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
74  return &TSInfo;
75  }
76 };
77 } // End llvm namespace
78 
79 #endif // LLVM_TARGET_MSP430_SUBTARGET_H
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::MSP430FrameLowering
Definition: MSP430FrameLowering.h:20
llvm::MSP430Subtarget::initializeSubtargetDependencies
MSP430Subtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
Definition: MSP430Subtarget.cpp:42
llvm::TargetFrameLowering
Information about stack frame layout on the target.
Definition: TargetFrameLowering.h:43
llvm::MSP430Subtarget::getInstrInfo
const MSP430InstrInfo * getInstrInfo() const override
Definition: MSP430Subtarget.h:66
MSP430GenSubtargetInfo
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition: TargetRegisterInfo.h:233
llvm::MSP430Subtarget::MSP430Subtarget
MSP430Subtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)
This constructor initializes the data members to match that of the specified triple.
Definition: MSP430Subtarget.cpp:58
llvm::MSP430Subtarget::HWMult32
@ HWMult32
Definition: MSP430Subtarget.h:34
llvm::MSP430Subtarget::getSelectionDAGInfo
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
Definition: MSP430Subtarget.h:73
llvm::MSP430Subtarget::ParseSubtargetFeatures
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
MSP430InstrInfo.h
llvm::MSP430TargetLowering
Definition: MSP430ISelLowering.h:73
llvm::MSP430Subtarget::hasHWMult32
bool hasHWMult32() const
Definition: MSP430Subtarget.h:60
llvm::MSP430Subtarget::HWMultF5
@ HWMultF5
Definition: MSP430Subtarget.h:34
llvm::MSP430Subtarget::getFrameLowering
const TargetFrameLowering * getFrameLowering() const override
Definition: MSP430Subtarget.h:63
llvm::MSP430Subtarget::hasHWMultF5
bool hasHWMultF5() const
Definition: MSP430Subtarget.h:61
llvm::MSP430Subtarget::getRegisterInfo
const TargetRegisterInfo * getRegisterInfo() const override
Definition: MSP430Subtarget.h:67
MSP430ISelLowering.h
llvm::SelectionDAGTargetInfo
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
Definition: SelectionDAGTargetInfo.h:31
llvm::MSP430Subtarget
Definition: MSP430Subtarget.h:31
llvm::MSP430Subtarget::hasHWMult16
bool hasHWMult16() const
Definition: MSP430Subtarget.h:59
llvm::MSP430InstrInfo::getRegisterInfo
const TargetRegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
Definition: MSP430InstrInfo.h:36
MSP430FrameLowering.h
llvm::MSP430InstrInfo
Definition: MSP430InstrInfo.h:26
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:79
llvm::X86AS::FS
@ FS
Definition: X86.h:188
llvm::MSP430Subtarget::HWMult16
@ HWMult16
Definition: MSP430Subtarget.h:34
DataLayout.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
TargetSubtargetInfo.h
llvm::MSP430Subtarget::NoHWMult
@ NoHWMult
Definition: MSP430Subtarget.h:34
SelectionDAGTargetInfo.h
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
MSP430RegisterInfo.h
llvm::MSP430Subtarget::getTargetLowering
const MSP430TargetLowering * getTargetLowering() const override
Definition: MSP430Subtarget.h:70
llvm::MSP430Subtarget::HWMultEnum
HWMultEnum
Definition: MSP430Subtarget.h:33