Path: blob/main/contrib/llvm-project/llvm/lib/Target/MSP430/MSP430Subtarget.h
35267 views
//===-- MSP430Subtarget.h - Define Subtarget for the MSP430 ----*- C++ -*--===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file declares the MSP430 specific subclass of TargetSubtargetInfo.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H13#define LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H1415#include "MSP430FrameLowering.h"16#include "MSP430ISelLowering.h"17#include "MSP430InstrInfo.h"18#include "MSP430RegisterInfo.h"19#include "llvm/CodeGen/SelectionDAGTargetInfo.h"20#include "llvm/CodeGen/TargetSubtargetInfo.h"21#include "llvm/IR/DataLayout.h"22#include <string>2324#define GET_SUBTARGETINFO_HEADER25#include "MSP430GenSubtargetInfo.inc"2627namespace llvm {28class StringRef;2930class MSP430Subtarget : public MSP430GenSubtargetInfo {31public:32enum HWMultEnum {33NoHWMult, HWMult16, HWMult32, HWMultF534};3536private:37virtual void anchor();38bool ExtendedInsts = false;39HWMultEnum HWMultMode = NoHWMult;40MSP430InstrInfo InstrInfo;41MSP430TargetLowering TLInfo;42SelectionDAGTargetInfo TSInfo;43MSP430FrameLowering FrameLowering;4445public:46/// This constructor initializes the data members to match that47/// of the specified triple.48///49MSP430Subtarget(const Triple &TT, const std::string &CPU,50const std::string &FS, const TargetMachine &TM);5152MSP430Subtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);5354/// ParseSubtargetFeatures - Parses features string setting specified55/// subtarget options. Definition of function is auto generated by tblgen.56void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);5758bool hasHWMult16() const { return HWMultMode == HWMult16; }59bool hasHWMult32() const { return HWMultMode == HWMult32; }60bool hasHWMultF5() const { return HWMultMode == HWMultF5; }6162const TargetFrameLowering *getFrameLowering() const override {63return &FrameLowering;64}65const MSP430InstrInfo *getInstrInfo() const override { return &InstrInfo; }66const MSP430RegisterInfo *getRegisterInfo() const override {67return &getInstrInfo()->getRegisterInfo();68}6970const MSP430TargetLowering *getTargetLowering() const override {71return &TLInfo;72}73const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {74return &TSInfo;75}76};77} // End llvm namespace7879#endif // LLVM_TARGET_MSP430_SUBTARGET_H808182