71 lines · c
1//===- ARCSubtarget.h - Define Subtarget for the ARC ------------*- 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-exception6//7//===----------------------------------------------------------------------===//8//9// This file declares the ARC specific subclass of TargetSubtargetInfo.10//11//===----------------------------------------------------------------------===//12 13#ifndef LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H14#define LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H15 16#include "ARCFrameLowering.h"17#include "ARCISelLowering.h"18#include "ARCInstrInfo.h"19#include "llvm/CodeGen/TargetSubtargetInfo.h"20#include <string>21 22#define GET_SUBTARGETINFO_HEADER23#include "ARCGenSubtargetInfo.inc"24 25namespace llvm {26 27class StringRef;28class TargetMachine;29 30class ARCSubtarget : public ARCGenSubtargetInfo {31 virtual void anchor();32 ARCInstrInfo InstrInfo;33 ARCFrameLowering FrameLowering;34 ARCTargetLowering TLInfo;35 std::unique_ptr<const SelectionDAGTargetInfo> TSInfo;36 37 // ARC processor extensions38 bool Xnorm = false;39 40public:41 /// This constructor initializes the data members to match that42 /// of the specified triple.43 ARCSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,44 const TargetMachine &TM);45 46 ~ARCSubtarget() override;47 48 /// Parses features string setting specified subtarget options.49 /// Definition of function is auto generated by tblgen.50 void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);51 52 const ARCInstrInfo *getInstrInfo() const override { return &InstrInfo; }53 const ARCFrameLowering *getFrameLowering() const override {54 return &FrameLowering;55 }56 const ARCTargetLowering *getTargetLowering() const override {57 return &TLInfo;58 }59 const ARCRegisterInfo *getRegisterInfo() const override {60 return &InstrInfo.getRegisterInfo();61 }62 63 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override;64 65 bool hasNorm() const { return Xnorm; }66};67 68} // end namespace llvm69 70#endif // LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H71