1 //===-- MSP430Subtarget.h - Define Subtarget for the MSP430 ----*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the MSP430 specific subclass of TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H
15 #define LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H
17 #include "MSP430FrameLowering.h"
18 #include "MSP430ISelLowering.h"
19 #include "MSP430InstrInfo.h"
20 #include "MSP430RegisterInfo.h"
21 #include "llvm/CodeGen/SelectionDAGTargetInfo.h"
22 #include "llvm/IR/DataLayout.h"
23 #include "llvm/Target/TargetSubtargetInfo.h"
26 #define GET_SUBTARGETINFO_HEADER
27 #include "MSP430GenSubtargetInfo.inc"
32 class MSP430Subtarget : public MSP430GenSubtargetInfo {
35 NoHWMult, HWMult16, HWMult32, HWMultF5
39 virtual void anchor();
41 HWMultEnum HWMultMode;
42 MSP430FrameLowering FrameLowering;
43 MSP430InstrInfo InstrInfo;
44 MSP430TargetLowering TLInfo;
45 SelectionDAGTargetInfo TSInfo;
48 /// This constructor initializes the data members to match that
49 /// of the specified triple.
51 MSP430Subtarget(const Triple &TT, const std::string &CPU,
52 const std::string &FS, const TargetMachine &TM);
54 MSP430Subtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
56 /// ParseSubtargetFeatures - Parses features string setting specified
57 /// subtarget options. Definition of function is auto generated by tblgen.
58 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
60 bool hasHWMult16() const { return HWMultMode == HWMult16; }
61 bool hasHWMult32() const { return HWMultMode == HWMult32; }
62 bool hasHWMultF5() const { return HWMultMode == HWMultF5; }
64 const TargetFrameLowering *getFrameLowering() const override {
65 return &FrameLowering;
67 const MSP430InstrInfo *getInstrInfo() const override { return &InstrInfo; }
68 const TargetRegisterInfo *getRegisterInfo() const override {
69 return &InstrInfo.getRegisterInfo();
71 const MSP430TargetLowering *getTargetLowering() const override {
74 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
78 } // End llvm namespace
80 #endif // LLVM_TARGET_MSP430_SUBTARGET_H